Class: GamesAndRpgParadise::BattleCity::Fort

Inherits:
Object
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/gui/gosu/battle_city/fort.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFort

#

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

#livingObject

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

#xObject (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

#yObject (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

#drawObject

#

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