Class: GamePlay::MiningGame
- Inherits:
-
BaseCleanUpdate::FrameBalanced
- Object
- Base
- BaseCleanUpdate
- BaseCleanUpdate::FrameBalanced
- GamePlay::MiningGame
- Includes:
- UI::MiningGame
- Defined in:
- docs/4_Systems_801_Mining_Game.rb
Overview
Class that describes the functionment of the scene
Constant Summary collapse
- DATA =
Constant that stock the Database of the Mining Game
GameData::MiningGame::DATA_ITEM
- DEFAULT_MUSIC =
The base music of the scene
'audio/bgm/mining_game'- NB_X_TILES =
The number of tiles per lines in the table
16- NB_Y_TILES =
The number of tiles per columns in the table
13- INITIAL_CURSOR_COORDINATES =
The initial coordinates of the cursor used when in keyboard mode
[NB_X_TILES / 2, NB_Y_TILES / 2]
- FIRST_TIME_TEXT =
IDs of the text displayed when playing for the first time
[[9005, 6], [9005, 7], [9005, 8], [9005, 10], [9005, 11], [9005, 12]]
- FIRST_TIME_TEXT_ALTERNATIVE =
IDs of the text displayed when playing for the first time (dynamite mode)
[9005, 9]
- TOOLS =
List of the usable tools
%i[pickaxe mace dynamite]
- SE_PATH =
Pathname of the SE folder
'audio/se/mining_game'- AIU_KEY2METHOD =
List of method called by automatic_input_update when pressing on a key
{A: :action_a, X: :action_x, LEFT: :action_left, RIGHT: :action_right, UP: :action_up, DOWN: :action_down}
- PING_TEXT =
ID of the ping text
[9005, 4]
- LOSE_TEXT =
ID of the text for the lose scenario
[9005, 13]
- WIN_TEXT =
ID of the text for the win scenario
[9005, 14]
- ITEM_WON_TEXT =
ID of the text used to tell what items were excavated
[9005, 15]
Constants inherited from Base
Base::DEFAULT_TRANSITION, Base::DEFAULT_TRANSITION_PARAMETER
Constants included from Input
Input::ALIAS_KEYS, Input::AXIS_MAPPING, Input::AXIS_SENSITIVITY, Input::DEAD_ZONE, Input::Keyboard, Input::Keys, Input::NON_TRIGGER_ZONE, Input::REPEAT_COOLDOWN, Input::REPEAT_SPACE
Constants included from DisplayMessage
DisplayMessage::MESSAGE_ERROR, DisplayMessage::MESSAGE_PROCESS_ERROR
Instance Attribute Summary collapse
Attributes inherited from Base
#__last_scene, #__result_process, #clock, #running, #viewport
Attributes included from DisplayMessage
Instance Method Summary collapse
-
#check_reveal_of_items(item) ⇒ Boolean
Check if a diggable item has been revealed.
-
#check_win_lose_condition
Check if the game is won or lost, and if none of the two then return.
-
#end_of_game
Method that end the game and exit the scene.
-
#first_time_text
Method that play the text displayed for the first time the player plays.
-
#initialize(param = nil, music_filename = DEFAULT_MUSIC, grid_handler: nil) ⇒ MiningGame
constructor
Initialize the UI.
-
#launch_loose_message
Show the message starting lost.
-
#launch_ping_text
Method that execute the ping sound and might trigger the texts displayed the first time the player plays.
-
#lose
Method that play the lose condition.
-
#ping_text
Method that play the ping text.
-
#update_inputs ⇒ Boolean
Check if a keyboard key is pressed, else check for the win/lose condition.
-
#win
Method that play the win condition.
Methods inherited from BaseCleanUpdate::FrameBalanced
Methods included from Graphics::FPSBalancer::Marker
Methods inherited from BaseCleanUpdate
Methods inherited from Base
#add_disposable, #call_scene, #dispose, #find_parent, #main, #return_to_scene, #snap_to_bitmap, #update, #visible, #visible=
Methods included from Input
clear, close_virtual_keyboard, dir4, dir8, get_text, joy_axis_position, load_touch_screen, open_virtual_keyboard, press?, register_events, released?, repeat?, swap_states, trigger?
Methods included from DisplayMessage
#can_display_message_be_called?, #close_message_window, #display_message, #display_message_and_wait, #message_class, #message_processing?, #message_visible, #message_visible=
Constructor Details
#initialize(item_count, music_filename = DEFAULT_MUSIC) ⇒ MiningGame #initialize(wanted_item_db_symbols, music_filename = DEFAULT_MUSIC) ⇒ MiningGame
Initialize the UI
760 761 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 760 def initialize(param = nil, music_filename = DEFAULT_MUSIC, grid_handler: nil) end |
Instance Attribute Details
#arr_items_won ⇒ Array<PFM::MiningGame::Diggable>
750 751 752 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 750 def arr_items_won @arr_items_won end |
#tiles_stack ⇒ UI::MiningGame::Tiles_Stack
748 749 750 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 748 def tiles_stack @tiles_stack end |
Instance Method Details
#check_reveal_of_items(item) ⇒ Boolean
Check if a diggable item has been revealed
914 915 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 914 def check_reveal_of_items(item) end |
#check_win_lose_condition
Check if the game is won or lost, and if none of the two then return
928 929 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 928 def check_win_lose_condition end |
#end_of_game
Method that end the game and exit the scene
946 947 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 946 def end_of_game end |
#first_time_text
Method that play the text displayed for the first time the player plays
920 921 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 920 def first_time_text end |
#launch_loose_message
Show the message starting lost
936 937 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 936 def end |
#launch_ping_text
Method that execute the ping sound and might trigger the texts displayed the first time the player plays
917 918 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 917 def launch_ping_text end |
#lose
Method that play the lose condition
933 934 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 933 def lose end |
#ping_text
Method that play the ping text
925 926 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 925 def ping_text end |
#update_inputs ⇒ Boolean
Check if a keyboard key is pressed, else check for the win/lose condition
872 873 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 872 def update_inputs end |
#win
Method that play the win condition
941 942 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 941 def win end |