[GAME STATE]
..squareOne... = gameType
..../...\.....
...A.....B.... = gameMode
.....\./......
......|.......
...../.\......
.Plus...Minus. = gameOperation
.....\./......
......|.......
....1,2,3..... = gameDifficulty
Character : tractor
Theme : farm
Concept : Player associates 'blocks carried by the tractor' and 'floor spaces to be filled by them'
Represent fractions as : blocks/rectangles
Game modes can be :
A : Player can select # of 'floor blocks' (hole in the ground)
Selects size of hole to be made in the ground (to fill with the blocks in front of the truck)
B : Player can select # of 'stacked blocks' (in front of the truck)
Selects number of blocks in front of the truck (to fill the hole on the ground)
Operations can be :
Plus : addition of fractions
Represented by : tractor going to the right (floor positions 0..8)
Minus : subtraction of fractions
Represented by: tractor going to the left (floor positions 8..0)
- Source:
Methods
(static) clickSquare()
Function called by self.onInputDown() when player clicks on a valid rectangle.
- Source:
(static) create()
Main code
- Source:
(static) createFloorBlocks()
Create floor blocks for the level in create()
- Source:
(static) createStckBlocks() → {boolean}
Create stacked blocks for the level in create()
- Source:
Returns:
- Type
- boolean
(static) onInputDown(mouseEvent)
Called by mouse click event
Parameters:
Name | Type | Description |
---|---|---|
mouseEvent |
object | contains the mouse click coordinates |
- Source:
(static) onInputOver(mouseEvent)
Called by mouse move event
Parameters:
Name | Type | Description |
---|---|---|
mouseEvent |
object | contains the mouse move coordinates |
- Source:
(static) outSquare()
Function called by self.onInputOver() when cursos is out of a valid rectangle
- Source:
(static) overSquare(cur)
Function called by self.onInputOver() when cursor is over a valid rectangle
Parameters:
Name | Type | Description |
---|---|---|
cur |
object | rectangle the cursor is over |
- Source:
(static) postScore()
Saves players data after level ends - to be sent to database
Attention: the 'line_' prefix data table must be compatible to data table fields (MySQL server)
Attention: the 'line_' prefix data table must be compatible to data table fields (MySQL server)
- Source:
- See:
-
- /php/save.php
(static) update()
Game loop
- Source:
(static) viewHelp()
Display correct answer
- Source: