Class: GamesAndRpgParadise::GardenHero::Star

Inherits:
Object
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/star.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(window, x, y) ⇒ Star

initialize



14
15
16
17
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/star.rb', line 14

def initialize(window, x, y)
  @window, @x, @y = window, x, y
  @img = Gosu::Image.new window, "images/player/star.png", true
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



19
20
21
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/star.rb', line 19

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



19
20
21
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/star.rb', line 19

def y
  @y
end

Instance Method Details

#drawObject

draw



22
23
24
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/star.rb', line 22

def draw
  @img.draw(@x, @y, 1)
end