Class: GamesParadise::Fort
- Inherits:
-
Object
- Object
- GamesParadise::Fort
- Defined in:
- lib/games_paradise/gui/gosu/battle_city/fort.rb
Instance Attribute Summary collapse
-
#living ⇒ Object
Returns the value of attribute living.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
-
#draw ⇒ Object
# === draw ========================================================================= #.
-
#initialize ⇒ Fort
constructor
# === initialize ========================================================================= #.
Constructor Details
#initialize ⇒ Fort
#
initialize
#
16 17 18 19 20 21 22 |
# File 'lib/games_paradise/gui/gosu/battle_city/fort.rb', line 16 def initialize @fort_alive = ::Gosu::Image.load_tiles("media/fort.png", 60, 60) @fort_destroyed = ::Gosu::Image.new("media/fort_explosion.png") @x = 370 @y = 640 @living = true end |
Instance Attribute Details
#living ⇒ Object
Returns the value of attribute living.
11 12 13 |
# File 'lib/games_paradise/gui/gosu/battle_city/fort.rb', line 11 def living @living end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
9 10 11 |
# File 'lib/games_paradise/gui/gosu/battle_city/fort.rb', line 9 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
10 11 12 |
# File 'lib/games_paradise/gui/gosu/battle_city/fort.rb', line 10 def y @y end |
Instance Method Details
#draw ⇒ Object
#
draw
#
27 28 29 30 31 32 33 34 |
# File 'lib/games_paradise/gui/gosu/battle_city/fort.rb', line 27 def draw if @living img = @fort_alive[::Gosu.milliseconds / 80 % @fort_alive.size] img.draw(@x, @y, 0) else @fort_destroyed.draw(360, 630, 1) end end |