Class: GamesAndRpgParadise::GUI::Foobar

Inherits:
Gosu::Window show all
Defined in:
lib/games_and_rpg_paradise/games/prototypes/gosu_prototype.rb

Overview

GamesAndRpgParadise::GUI::Foobar

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect
WIDTH =
#

WIDTH

#
1200
HEIGHT =
#

HEIGHT

#
480
TITLE =
#

TITLE

#
'GOSU Prototype'

Instance Method Summary collapse

Methods inherited from Gosu::Window

#gosu_button_down?, #image, #image10?, #image1?, #image2?, #image3?, #image4?, #image5?, #image6?, #image7?, #image8?, #image9?, #on_left_arrow_pressed?, #on_right_arrow_pressed?, #q_means_quit, #set_font, #set_title, #sqrt, #tab_key?, #write_this_text

Constructor Details

#initialize(run_already = true) ⇒ Foobar

#

initialize

#


38
39
40
41
42
43
44
45
# File 'lib/games_and_rpg_paradise/games/prototypes/gosu_prototype.rb', line 38

def initialize(
    run_already = true
  )
  super(WIDTH, HEIGHT)
  set_title(TITLE)
  reset
  run if run_already
end

Instance Method Details

#button_down(id = nil) ⇒ Object

#

button_down

#


65
66
67
68
69
70
71
# File 'lib/games_and_rpg_paradise/games/prototypes/gosu_prototype.rb', line 65

def button_down(id = nil)
  case id
  when Gosu::KbEscape,
       Gosu::KbQ
    close
  end
end

#resetObject

#

reset (reset tag)

#


50
51
52
53
54
55
56
57
58
59
60
# File 'lib/games_and_rpg_paradise/games/prototypes/gosu_prototype.rb', line 50

def reset
  # ======================================================================= #
  # === @song
  # ======================================================================= #
  @song = Gosu::Song.new('alert2.mp3')
  @song.play
  # ======================================================================= #
  # === @font
  # ======================================================================= #
  @font = set_font(:hack_30)
end

#runObject

#

run

#


76
77
78
# File 'lib/games_and_rpg_paradise/games/prototypes/gosu_prototype.rb', line 76

def run
  exit_on_q
end