class RubyMan::MenuGhost
Ghost
object for decorating main menu
Public Instance Methods
created()
click to toggle source
# File lib/ruby_man/GameObjects/menu.rb, line 26 def created set_pos(-6, 8) @speed = 3 @image_speed = 3 set_chase end
grid_step()
click to toggle source
# File lib/ruby_man/GameObjects/menu.rb, line 43 def grid_step if @direction == Direction.right set_run if @grid_x >= 29 else set_chase if @grid_x <= -6 end end
set_chase()
click to toggle source
# File lib/ruby_man/GameObjects/menu.rb, line 33 def set_chase @direction = Direction.right self.sprite = Sprite['ghost_right'] end
set_run()
click to toggle source
# File lib/ruby_man/GameObjects/menu.rb, line 38 def set_run @direction = Direction.left self.sprite = Sprite['ghost_scared'] end