Class: GamesAndRpgParadise::BattleCity::Fort
- Inherits:
-
Object
- Object
- GamesAndRpgParadise::BattleCity::Fort
- Defined in:
- lib/games_and_rpg_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
#
18 19 20 21 22 23 24 |
# File 'lib/games_and_rpg_paradise/gui/gosu/battle_city/fort.rb', line 18 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.
13 14 15 |
# File 'lib/games_and_rpg_paradise/gui/gosu/battle_city/fort.rb', line 13 def living @living end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
11 12 13 |
# File 'lib/games_and_rpg_paradise/gui/gosu/battle_city/fort.rb', line 11 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
12 13 14 |
# File 'lib/games_and_rpg_paradise/gui/gosu/battle_city/fort.rb', line 12 def y @y end |
Instance Method Details
#draw ⇒ Object
#
draw
#
29 30 31 32 33 34 35 36 |
# File 'lib/games_and_rpg_paradise/gui/gosu/battle_city/fort.rb', line 29 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 |