Class: BulletTurret
- Inherits:
-
Chingu::GameObject
- Object
- Chingu::GameObject
- BulletTurret
- Includes:
- GamespacePersistence
- Defined in:
- lib/prkwars/bullet_turret.rb
Overview
A bullet shot by the Turret enemy unit. Destroys itself if out of bounds.
Instance Method Summary collapse
-
#initialize(gamespace, options = {}) ⇒ BulletTurret
constructor
A new instance of BulletTurret.
- #update ⇒ Object
Methods included from GamespacePersistence
Constructor Details
#initialize(gamespace, options = {}) ⇒ BulletTurret
11 12 13 14 15 |
# File 'lib/prkwars/bullet_turret.rb', line 11 def initialize(gamespace, = {}) super() @image = Image['media/bullet_turret.png'] @gamespace = gamespace end |
Instance Method Details
#update ⇒ Object
17 18 19 |
# File 'lib/prkwars/bullet_turret.rb', line 17 def update destroy! unless in_bounds(self, @gamespace) end |