Multiple scores in game

Started by Icey, Sat 30/10/2010 02:19:52

Previous topic - Next topic

Icey

Is it possible to have more then one scores because I want to have one that is for a currency system and 1 for main score and one for EXP.


Icey


monkey0506

If you're storing experience..are you working on an RPG? If so, will other characters have experience? If so, you might consider using a dynamic array instead of just having a slew of individual variables:

Code: ags
int RPG_Experience[];

function game_start() {
  RPG_Experience = new int[Game.CharacterCount];
}

// ..set character's experience..
RPG_Experience[player.ID] += 25;

// ..get character's experience..
lblExp.Text = String.Format("EXP: %d", RPG_Experience[player.ID]);

Icey

Oh, this should work. the game will only have one player to fight with though.

monkey0506

Well in that case use the score for the score and just create one variable instead of an array.

SMF spam blocked by CleanTalk