Class: GamesAndRpgParadise::GardenHero::Apple

Inherits:
Object
  • Object
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

Constructor Details

#initialize(window, x, y) ⇒ Apple

#

initialize

#


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

#xObject (readonly)

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

#drawObject

#

draw

#


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

#

y?

#

Returns:

  • (Boolean)


32
33
34
# File 'lib/games_and_rpg_paradise/gui/gosu/garden_hero/core/level/apple.rb', line 32

def y?
  @y
end