Class: Warp
- Inherits:
-
Chingu::GameObject
- Object
- Chingu::GameObject
- Warp
- Defined in:
- lib/prkwars/warp.rb
Overview
Class holding the warp effect used whenever an enemy game object spawns somewhere.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Warp
constructor
Sets the image of a warp as well as its fade rate.
-
#update ⇒ Object
Destroys a
Warpif it faded out.
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( = {}) super() @fade_rate = -8 @image = Image['media/warp.png'] end |
Instance Method Details
#update ⇒ Object
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 |