Class: Warp

Inherits:
Chingu::GameObject
  • Object
show all
Defined in:
lib/prkwars/warp.rb

Overview

Class holding the warp effect used whenever an enemy game object spawns somewhere.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Warp

Sets the image of a warp as well as its fade rate.



10
11
12
13
14
15
# File 'lib/prkwars/warp.rb', line 10

def initialize(options = {})
  super(options)

  @fade_rate = -8
  @image = Image['media/warp.png']
end

Instance Method Details

#updateObject

Destroys a Warp if it faded out.



19
20
21
# File 'lib/prkwars/warp.rb', line 19

def update
  destroy! if color.alpha.zero?
end