00:00
00:00
Newgrounds Background Image Theme

twmimic001 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Newgrounds Wiki: Adding Medals to Your Game

Medals are badges of honor that users can unlock by accomplishing tasks in your game, similar to Xbox LIVE Achievements or PSN Trophies. Medals are stored to a user's Newgrounds profile and displayed on their userpage. They are a great way to up the replay value of the game!

Check out some games with medals for ideas on how to use medals in your own game!

Creating medals

To create medals for your game, go to the API Settings page for your game in the Project System and click on Medals. You can create up to 500 points worth of medals for each game.

Unlocking medals

Use the API.unlockMedal function to unlock a medal:
import com.newgrounds.*;

API.unlockMedal("Your Medal Name");
This code will unlock a medal for the current player. If the player is logged-in on Newgrounds, the medal will be unlocked and visible on their profile. If the user is not logged-in or playing on another site, the medal is unlocked locally and stored on their computer.

Medal popups

You can use the Medal Popup component if you'd like a visual notification when a medal is unlocked. The Medal Popup component will appear and show a message whenever a medal is unlocked. The Medal Popup must be on the stage when the medal is unlocked.