The base game class
springroll.pbskids.Learning
app
[showTray=false]
app
springroll.Application
The application reference
[showTray=false]
Boolean
optional
Show the documentation at init or false (dev build only!)
_handleError
error
Handle errors
error
Error
The error to handle
[description]
_onCalled
api
Handler when an api is called
api
String
The name of the API method called
_specTrack
api
[extraArgs]
Generic method to track an event based on the spec, the arguments mirror the arguments in the event spec.
api
String
The name of the api
[extraArgs]
optional
multiple
The Additional arguments
_startFeedback
api
Basic method for starting a feedback or instruction
api
String
The event method to call
_startFeedback
api
description
identifier
mediaType
totalDuration
Basic method for starting a feedback or instruction
_track
api
[input]
[round]
Generic method to track an event based on the spec, the arguments mirror the arguments in the event spec.
addMap
eventDictionary
The map of API event name overrides
eventDictionary
Object
The collection of game-specific APIs, this is a map of the eventCode to the name of the API method
clickPlay
coordinates
When a user clicks or taps on the play button to start the game.
coordinates
Object
The coordinates object
x
Int
The x position clicked or tapped
y
Int
The y position clicked or tapped
stage_width
Int
The stage width
stage_height
Int
The stage height
endGame
[exitType]
Override for the end game event
[exitType]
String
optional
The exit type for certain games
gameTime
Get the amount of time since the start of the game
The time since the beginning of the game in milliseconds
pollTimer
alias
Check the current progress of a timer, this will not destory the timer
alias
String
The unique alias for this timer
The timer in milliseconds
removeTimer
alias
This will clean-up and discard the timer and it can't be used again.
alias
String
The unique alias for this timer
requires
api
Require that an api has been called
api
String
The names of the method or API call
If the api was called before
startCorrectFeedback
description
identifier
mediaType
total_duration
Start the correct feedback event
startIncorrectFeedback
description
identifier
mediaType
total_duration
Start the incorrect feedback
startInstruction
description
identifier
mediaType
total_duration
Start the system initiated instruction
startTimer
alias
Convenience function for measuring the duration which is common for many events. These timers respect the application being paused and should be use instead of implementing Date.now() or some other Date-based method.
alias
String
A unique alias for this timer
stopTimer
alias
Stop a timer and get the final duration to send with an event. This will clean-up and discard the timer and it can't be used again.
alias
String
The unique alias for this timer
The timer in milliseconds
called
An api method was called, this happens before any validation
api
String
The name of the api method called