Medals

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

Classes

Medal

Members

(static, constant) medals :Object

List of all medals

Type:
  • Object

Methods

(static) medalsForEach(callback)

Calls a function for each medal

Parameters:
NameTypeDescription
callbackMedalCallbackFunction

(static) medalsInit(saveName)

Initialize medals with a save name used for storage

  • Call this after creating all medals
  • Checks if medals are unlocked
Parameters:
NameTypeDescription
saveNamestring

Type Definitions

MedalCallbackFunction(medal)

Parameters:
NameTypeDescription
medalMedal