[GAME STATE]
.squareTwo. = gameType
.../...\...
..A.....B.. = gameMode
....\./....
.....|.....
...Equals.. = gameOperation
.....|.....
.1,2,3,4,5. = gameDifficulty
Character : kid
Theme : (not themed)
Concept : player select equivalent dividends for fractions with different divisors
Represent fractions as : subdivided rectangles
Game modes can be :
A : equivalence of fractions
top has more subdivisions
B : equivalence of fractions
bottom has more subdivisions
Operations :
Equals : Player selects equivalent fractions of both blocks
- Source:
Methods
(static) clickSquare(curBlock)
Function called by self.onInputDown() when player clicked a valid rectangle.
Parameters:
Name | Type | Description |
---|---|---|
curBlock |
object | clicked rectangle : can be self.A.blocks[i] or self.B.blocks[i] |
- Source:
(static) create()
Main code
- Source:
(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(curSet)
Function called (by self.onInputOver() and self.overSquare()) when cursor is out of a valid rectangle.
Parameters:
Name | Type | Description |
---|---|---|
curSet |
object | set of rectangles : can be top (self.A) or bottom (self.B) |
- Source:
(static) overSquare(curBlock)
Function called by self.onInputOver() when cursor is over a valid rectangle.
Parameters:
Name | Type | Description |
---|---|---|
curBlock |
object | rectangle the cursor is over : can be self.A.blocks[i] or self.B.blocks[i] |
- 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: