Ultimate Gear War
Join the alien war, prepare your gear and protect your base at all cost!
4.17 / 5.00 16,115 Viewsimport com.newgrounds.API;
import com.newgrounds.Medal;
var medals:Array = API.getMedals();
This call returns an array containing Medal instances for every medal in your game.import com.newgrounds.API;
import com.newgrounds.Medal;
// get the array of medals
var medals:Array = API.getMedals();
// set the initial medal score
var score:uint = 0;
// read the array
for (var i:uint = 0; i < medals.length; i++) {
var name:String = medals[i].name;
var value:uint = medals[i].value;
if (medals[i].unlocked) {
trace(name+" is unlocked and worth "+value+" points");
score += value;
} else {
trace(name+" is not unlocked");
}
}
// trace our total medal score for this game
trace("You have earned "+score+" medal points in this game!");import com.newgrounds.API;
import com.newgrounds.Medal;
// get the array of medals
var medals:Array = API.getMedals();
// set the initial medal score
var score:Number = 0;
// read the array
for (var i:Number = 0; i < medals.length; i++) {
var name:String = medals[i].name;
var value:Number = medals[i].value;
if (medals[i].unlocked) {
trace(name+" is unlocked and worth "+value+" points");
score += value;
} else {
trace(name+" is not unlocked");
}
}
// trace our total medal score for this game
trace("You have earned "+score+" medal points in this game!");