PawnLibs/wowcore/SELF_ID
Summary
An ID of the module on which application copy is running.
Synopsis
PawnLibs/wowcore/GAME_SAVE_SIZE
Summary
Maximum allowed size of an application save data in cells.
Synopsis
PawnLibs/wowcore/MAX_PACKET_SIZE
Summary
Maximum size of an application packet.
Synopsis
PawnLibs/wowcore/MAX_PACKET_TYPES
Summary
Maximum number of an application packet types.
Synopsis
PawnLibs/wowcore/MODULES_MAX
Summary
How many modules there are in the assembled cube.
Synopsis
PawnLibs/wowcore/SCREENS_MAX
Summary
How many screens there are on the each cube module.
Synopsis
PawnLibs/wowcore/SENSITIVITY_MENU_CHANGE_SCRIPT
Summary
How many shakes required to trigger an application quit. Shake is a continuous significant motion which direction has been changed since the previous recent significant motion.
Synopsis
PawnLibs/wowcore/APP_VERSION
Summary
Array with named fields describing application version.
Synopsis
Description
Fields:
- major - increment when application significantly changed
- minor - increment when new feature added
- patch - increment when bugfix shipped
See also
- getAppVersion()
PawnLibs/wowcore/ON_Init
Summary
Initialization handler.
Synopsis
Description
Public function with such signature will be called before the application loop starts. Useful for a globals initializations, e.g. generating level, baking backgrounds, etc. Additionaly save data is provided.
Inputs
- id - an id of the save data
- size - size of the save data in cells
- pkt[] - array with the save data
See also
- GAME_SAVE_SIZE
- loadState()
PawnLibs/wowcore/ON_Load
Summary
Asynchronous application save data handler.
Synopsis
Description
Public function with such signature will be called to handle an application save data. It is an asynchronous event so access to flash memory will not affect an application performance.
Inputs
- id - an id of the save data
- size - size of the save data in cells
- pkt[] - array with the save data
See also
- GAME_SAVE_SIZE
- loadState()
- saveState()
PawnLibs/wowcore/ON_Packet
Summary
Network packet handler.
Synopsis
Description
Public function with such signature will be called to handle a received application packet from an another module in the cube network.
Inputs
- type - an application packet type
- size - size of the received packet
- pkt[] - array with a message data
See also
- broadcastPacket()
PawnLibs/wowcore/ON_PhysicsTick
Summary
Uniformly delayed loop handler.
Synopsis
Description
Public function with such signature will be called approximately each 30 milliseconds. However time interval between calls can be larger because the application is single threaded and complex rendering or calculation can delay events processing. Useful for calculations requiring a time delta, e.g. sprite movement at a constant speed.
PawnLibs/wowcore/ON_Quit
Summary
Application quit handler.
Synopsis
Description
Public function with such signature will be called to handle an application quit event when user did triple shake. Application can shutdown gracefully, e.g. save state on the flash memory. Application has 1000ms to run handler and will be termintated after that period. No more handlers will be called.
See also
- saveState()
PawnLibs/wowcore/ON_Tick
Summary
Main application loop handler.
Synopsis
Description
Public function with such signature will be called on each iteration of an application loop. Main application logic should be placed here. Frequency of calls are not constant and depends on the configured framerate, calculations and rendering complexities.
See also
- ON_PhysicsTick()
- ON_Render()
PawnLibs/wowcore/broadcastPacket
Summary
Broadcast a packet over the cube network.
Synopsis
Description
TBD: routing, filtering. Packet delivery is not guaranteed. Packet types equal or greater than MAX_PACKET_TYPES are discarded. Packet sizes greater than MAX_PACKET_SIZE are discarded.
Inputs
- type - arbitrary packet type
- data[] - packet data to broadcast
- size - size of the packet data in cells
See also
- ON_Packet()
- MAX_PACKET_TYPES
- MAX_PACKET_SIZE
PawnLibs/wowcore/getAppVersion
Summary
Get application version.
Synopsis
Description
WOWCube applications follow semantic versioning scheme (see https://semver.org). This interface allows to get version parts stored in the cube application descriptor.
Outputs
- version - structure describing application version
See also
- APP_VERSION
PawnLibs/wowcore/getTime
Summary
Get time in milliseconds since the module start.
Synopsis
Return value
Time in milliseconds since the module start.
PawnLibs/wowcore/getUserName
Summary
Get the name of a user who is logined on the cube.
Synopsis
Description
Get the user name configured in the WOWCube mobile application to save results for.
Inputs
- size - size of string to keep a user name
Outputs
- userName - string to keep a user name
See also
- USER_NAME_LENGTH
PawnLibs/wowcore/loadState
Summary
Request to load an application save data from the flash.
Synopsis
Description
Trigger state load event. It is asynchronous so access to flash memory will not affect an application performance.
See also
- ON_Load()
- saveState()
PawnLibs/wowcore/quit
Summary
Quit from the application.
Synopsis
See also
- SENSITIVITY_MENU_CHANGE_SCRIPT
- ON_Shake()
PawnLibs/wowcore/random
Summary
Generate random number in half-open range.
Synopsis
Description
Random number generator is initialized before each application start. Seed for initialization is generated by TRNG (True Random Number Generator).
Inputs
- min - minimal value of range to generate random number
- max - maximum value of range to generate random number
Return value
Pseudo random value from requested range.
PawnLibs/wowcore/saveState
Summary
Request to save an application data
Synopsis
Description
Save user settings and/or progress on the flash to restore next time. Each save data has an incremental ID.
Inputs
- data [] - data to save
- size - size of data in cells to save
Return value
True if save was successful.
See also
- GAME_SAVE_SIZE
- ON_Load()
- loadState()
PawnLibs/wowcore/toggleDebugInfo
Summary
Toggle overlay with debug information. TBD - move to GFX
Synopsis
Description
Debug information includes: TBD - current information is obsolete
PawnLibs/wowcore/parseByte
Summary
Get arbitrary byte value from array.
Synopsis
Description
Pawn works with cells which has a size of 4 bytes. Native interfaces handling generic data like network messages have size limits for that data. If application does not need to work with a large numbers, several values can be packed into a single cell. This function provides interface to extract such values from array.
Inputs
- arr - array to read byte from
- n - number of byte to read
Return value
Requested byte value.
See also
- broadcastMessage()
- saveState()
- ON_Load()
- ON_Packet()