Module: logic/logic

Methods


<static> initLogic(p_game_loop, p_models [, p_config])

Parameters:
Name Type Argument Description
p_game_loop GameLoop the game loop
p_models Object the models of the game
Properties
Name Type Description
startButton ModelCircle the startButton
ball ModelCircle the ball
paddles Array.<ModelPaddle> the two paddles
scores Array.<ModelScore> the two scores
info ModelText a text field to display info
p_config Object <optional>
the configuration of the game logic
Properties
Name Type Argument Default Description
winScore number <optional>
10 the score of the winner
Source:

<async, inner> ballLoss(p_player)

Parameters:
Name Type Description
p_player string the position of the player who lost the ball: 'left' or 'right'
Source:

<async, inner> startGame()

Starts the game. Should be called by a controller of a start button or the like.
Source: