Class: GamePlay::Casino::SlotMachine

Inherits:
BaseCleanUpdate::FrameBalanced show all
Includes:
UI::Casino
Defined in:
scripts/01450 Systems/09000 Games/00001 Slot Machines/00003 GamePlay/00003 Casino__SlotMachine.rb

Constant Summary collapse

PAYOUT_VALUES =

PAYOUT associated to each values

{
  1 => 3, # v2
  2 => 300, # v3
  6 => 300, # v7
  3 => 12, # v4
  4 => 6, # v5
}
ACTIONS =

Actions for the mouse

%i[action_b action_b action_b action_b]

Constants inherited from BaseCleanUpdate

BaseCleanUpdate::AIU_KEY2METHOD

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

Attributes inherited from Base

#__last_scene, #__result_process, #running, #viewport

Attributes included from DisplayMessage

#message_window

Instance Method Summary collapse

Methods inherited from BaseCleanUpdate::FrameBalanced

#update

Methods included from Graphics::FPSBalancer::Marker

#frame_balanced?

Methods inherited from BaseCleanUpdate

#automatic_input_update, #update

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(speed) ⇒ SlotMachine

Create a new SlotMachine Scene

Parameters:

  • speed (Integer)

    speed of the machine



17
18
19
20
21
22
# File 'scripts/01450 Systems/09000 Games/00001 Slot Machines/00003 GamePlay/00003 Casino__SlotMachine.rb', line 17

def initialize(speed)
  super()
  @speed = speed
  @update_input_method = :update_input_pay
  @payout = 1
end

Instance Method Details

#player_coinInteger

Amount of coin the player has

Returns:



36
37
38
# File 'scripts/01450 Systems/09000 Games/00001 Slot Machines/00003 GamePlay/00003 Casino__SlotMachine.rb', line 36

def player_coin
  $game_variables[Yuki::Var::CoinCase]
end

#player_coin=(coins)

Set the number of coin the player has

Parameters:



42
43
44
# File 'scripts/01450 Systems/09000 Games/00001 Slot Machines/00003 GamePlay/00003 Casino__SlotMachine.rb', line 42

def player_coin=(coins)
  $game_variables[Yuki::Var::CoinCase] = coins
end

#update_graphics



28
29
30
31
32
# File 'scripts/01450 Systems/09000 Games/00001 Slot Machines/00003 GamePlay/00003 Casino__SlotMachine.rb', line 28

def update_graphics
  @bands.each(&:update)
  @credit_display.update
  @payout_display.update
end

#update_inputs



24
25
26
# File 'scripts/01450 Systems/09000 Games/00001 Slot Machines/00003 GamePlay/00003 Casino__SlotMachine.rb', line 24

def update_inputs
  return send(@update_input_method)
end