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, #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
dir4, dir8, get_text, joy_axis_position, 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
758 759 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 758 def initialize(param = nil, music_filename = DEFAULT_MUSIC, grid_handler: nil) end |
Instance Attribute Details
#arr_items_won ⇒ Array<PFM::MiningGame::Diggable>
748 749 750 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 748 def arr_items_won @arr_items_won end |
#tiles_stack ⇒ UI::MiningGame::Tiles_Stack
746 747 748 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 746 def tiles_stack @tiles_stack end |
Instance Method Details
#check_reveal_of_items(item) ⇒ Boolean
Check if a diggable item has been revealed
912 913 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 912 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
926 927 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 926 def check_win_lose_condition end |
#end_of_game
Method that end the game and exit the scene
944 945 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 944 def end_of_game end |
#first_time_text
Method that play the text displayed for the first time the player plays
918 919 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 918 def first_time_text end |
#launch_loose_message
Show the message starting lost
934 935 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 934 def end |
#launch_ping_text
Method that execute the ping sound and might trigger the texts displayed the first time the player plays
915 916 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 915 def launch_ping_text end |
#lose
Method that play the lose condition
931 932 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 931 def lose end |
#ping_text
Method that play the ping text
923 924 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 923 def ping_text end |
#update_inputs ⇒ Boolean
Check if a keyboard key is pressed, else check for the win/lose condition
870 871 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 870 def update_inputs end |
#win
Method that play the win condition
939 940 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 939 def win end |