LittleJS Medal System
- Achievement/trophy system for games
- Medal class with name, description, icon, and unlock tracking
- Automatic saving to local storage
- Visual display queue with slide-in notifications
- Newgrounds API integration for online achievements
- Debug mode to unlock/reset medals during development
- Source
Classes
Members
(static, constant) medals :Object
List of all medals
Type:
- Object
- Source
Methods
(static) medalsForEach(callback)
Calls a function for each medal
Parameters:
| Name | Type | Description |
|---|---|---|
callback | MedalCallbackFunction |
- Source
(static) medalsInit(saveName)
Initialize medals with a save name used for storage
- Call this after creating all medals
- Checks if medals are unlocked
Parameters:
| Name | Type | Description |
|---|---|---|
saveName | string |
- Source
Type Definitions
MedalCallbackFunction(medal)
Parameters:
| Name | Type | Description |
|---|---|---|
medal | Medal |
- Source