Class: GamesParadise::GUI::Memory::Game
- Inherits:
-
Gosu::Window
- Object
- Gosu::Window
- GamesParadise::GUI::Memory::Game
- Includes:
- Memory
- Defined in:
- lib/games_paradise/gui/gosu/memory/game.rb
Constant Summary collapse
- PROJECT_BASE_DIRECTORY =
#
PROJECT_BASE_DIRECTORY
#
::GamesParadise::PROJECT_BASE_DIRECTORY
Constants included from Memory
Memory::ARRAY_IMAGES_FOR_THE_MEMORY_GAME, Memory::FILE_BLACK_BACKGROUND, Memory::FILE_CAMEL_HEAD, Memory::FILE_CARD_RANDOM, Memory::FILE_DONKEY, Memory::FILE_FROG, Memory::FILE_LION, Memory::FILE_NEW_GAME, Memory::FILE_OCTOPUS, Memory::FILE_SAD_CRAB, Memory::FILE_SHEEP, Memory::FILE_SNAIL, Memory::FILE_SPERM_WHALE, Memory::FILE_UNICORN, Memory::GAME_MESSAGE_YOU_WON, Memory::IMAGES_DIRECTORY, Memory::SCREENHEIGHT, Memory::SCREENWIDTH, Memory::TITLE, Memory::USE_THIS_FONT_FAMILY
Class Method Summary collapse
-
.fonts ⇒ Object
# ==== Game.fonts ========================================================================= #.
Instance Method Summary collapse
-
#best_time=(i) ⇒ Object
# === best_time= ========================================================================= #.
-
#best_time? ⇒ Boolean
(also: #best_time)
# === best_time? ========================================================================= #.
-
#button_down(id) ⇒ Object
# === button_down ========================================================================= #.
-
#button_up(id) ⇒ Object
# === button_up ========================================================================= #.
-
#draw ⇒ Object
# === draw (draw tag) ========================================================================= #.
-
#images? ⇒ Boolean
(also: #images)
# === images? ========================================================================= #.
-
#initialize(run_already = true) ⇒ Game
constructor
# === initialize ========================================================================= #.
-
#load_images ⇒ Object
# === load_images.
-
#needs_cursor? ⇒ Boolean
# === needs_cursor? ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#run ⇒ Object
# === run ========================================================================= #.
-
#update ⇒ Object
# === update ========================================================================= #.
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) ⇒ Game
#
initialize
#
35 36 37 38 39 40 41 42 43 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 35 def initialize( run_already = true ) super(SCREENWIDTH, SCREENHEIGHT, {fullscreen: false}) set_title(TITLE) reset load_images run if run_already end |
Class Method Details
.fonts ⇒ Object
#
Game.fonts
#
90 91 92 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 90 def self.fonts GOSU_USE_THIS_FONT end |
Instance Method Details
#best_time=(i) ⇒ Object
#
best_time=
#
113 114 115 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 113 def best_time=(i) @best_time = i end |
#best_time? ⇒ Boolean Also known as: best_time
#
best_time?
#
120 121 122 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 120 def best_time? @best_time end |
#button_down(id) ⇒ Object
#
button_down
#
127 128 129 130 131 132 133 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 127 def (id) case id when Gosu::KbEscape # On escape-button. $w.close # Close the game-window. end ::GamesParadise::GUI::Memory.current_game.(id) end |
#button_up(id) ⇒ Object
#
button_up
#
76 77 78 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 76 def (id) ::GamesParadise::GUI::Memory.current_game.(id) end |
#draw ⇒ Object
#
draw (draw tag)
#
59 60 61 62 63 64 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 59 def draw GOSU_USE_THIS_FONT.draw_text('TIME', 380, 10, 1) GOSU_USE_THIS_FONT.draw_text('BEST', 380, 80, 1) GOSU_USE_THIS_FONT.draw_text(@best_time, 380, 100, 1) ::GamesParadise::GUI::Memory.current_game.draw end |
#images? ⇒ Boolean Also known as: images
#
images?
#
83 84 85 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 83 def images? ::GamesParadise::GUI::Memory.available_images? end |
#load_images ⇒ Object
#
load_images
This method will load up the available animals.
#
106 107 108 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 106 def load_images ::GamesParadise::GUI::Memory.load_images end |
#needs_cursor? ⇒ Boolean
#
needs_cursor?
#
97 98 99 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 97 def needs_cursor? true end |
#reset ⇒ Object
#
reset
#
48 49 50 51 52 53 54 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 48 def reset # ======================================================================= # # === @best_time # ======================================================================= # @best_time = 1000 ::GamesParadise::GUI::Memory.current_game = PlayGame.new end |
#run ⇒ Object
#
run
#
138 139 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 138 def run end |
#update ⇒ Object
#
update
#
69 70 71 |
# File 'lib/games_paradise/gui/gosu/memory/game.rb', line 69 def update ::GamesParadise::GUI::Memory.current_game.update end |