Defining and awarding achievements

Thought I’d share this little framework for in-game achievements. The code is here:

And a video:

Basically you define each achievement in the TrophyCabinet:init() method. The achievements (or TrophyCabinet) can be rendered as an overlay over any other screen in your game (e.g: menus and post-win screens). Each achievement has a name, description, colour and display position assigned. Hopefully the code is self-explanatory enough but I know code is harder to read than write so any questions just ask.