Class: GamesAndRpgParadise::GardenHero::Apple
- Inherits:
-
Object
- Object
- GamesAndRpgParadise::GardenHero::Apple
show all
- Defined in:
- lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/apple.rb
Overview
GamesAndRpgParadise::GardenHero::Apple
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#draw ⇒ Object
# === draw ========================================================================= #.
-
#initialize(window, x, y) ⇒ Apple
constructor
# === initialize ========================================================================= #.
-
#y? ⇒ Boolean
(also: #y)
# === y? ========================================================================= #.
Constructor Details
#initialize(window, x, y) ⇒ Apple
18
19
20
21
22
23
24
25
|
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/apple.rb', line 18
def initialize(
window,
x,
y
)
@window, @x, @y = window, x, y
@img = Gosu::Image.new(window, 'images/player/apple.png', true)
end
|
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
27
28
29
|
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/apple.rb', line 27
def x
@x
end
|
Instance Method Details
#draw ⇒ Object
39
40
41
|
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/apple.rb', line 39
def draw
@img.draw(@x, @y, 1)
end
|
#y? ⇒ Boolean
Also known as:
y
32
33
34
|
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/apple.rb', line 32
def y?
@y
end
|