[GAME STATE]
.....circleOne.... = gameType
....../....\......
.....A......B..... = gameMode
.......\./........
........|.........
....../.|.\.......
.Plus.Minus.Mixed. = gameOperation
......\.|./.......
........|.........
....1,2,3,4,5..... = gameDifficulty
Character : kid/balloon
Theme : flying in a balloon
Concept : 'How much the kid has to walk to get to the balloon?'
Represent fractions as : circles/arcs
Game modes can be :
A : Player can place balloon position
Place balloon in position (so the kid can get to it)
B : Player can select # of circles
Selects number of circles (that represent distance kid needs to walk to get to the balloon)
Operations can be :
Plus : addition of fractions
Represented by : kid going to the right (floor positions 0..5)
Minus : subtraction of fractions
Represented by: kid going to the left (floor positions 5..0)
Mixed : Mix addition and subtraction of fractions in same
Represented by: kid going to the left (floor positions 0..5)
- Source:
Methods
(static) checkOverlap(spriteA, spriteB) → {boolean}
Checks if 2 images overlap
Parameters:
Name | Type | Description |
---|---|---|
spriteA |
object | image 1 |
spriteB |
object | image 2 |
- Source:
Returns:
true if there is overlap
- Type
- boolean
(static) clicked(cur)
(in gameMode 'B') Function called when player clicked over a valid circle
Parameters:
Name | Type | Description |
---|---|---|
cur |
number | object | clicked circle |
- 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) outCircle()
(in gameMode 'B') Function called when cursor is out of a valid circle
- Source:
(static) overCircle(cur)
(in gameMode 'B') Function called when cursor is over a valid circle
Parameters:
Name | Type | Description |
---|---|---|
cur |
object | circle 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/squareOne.js
(static) update()
Game loop
- Source:
(static) viewHelp()
Display correct answer
- Source: