Can I display integers in another scene?


i working on game. in game there 4 levels , in each level can collect ammount of coins. possible make variable int counts ammount of coins have troughout game? example, have var int score = 0 , 5 coins in level 1, 3 in level 2, 6 in level 3 , 1 in level 4. in total score 15. can make work need 1 variable counts points gather , can display number in win screen?

 

var int score = 0;

 

function pickup() {

if(speler2.hittestobject(munt1)){

  munt1.x=1100;

  score ++;

}

  if(speler2.hittestobject(munt2)){

  munt2.x=1100;

  score ++;

}

  if(speler2.hittestobject(munt3)){

  munt3.x=1100;

  score ++;

}

  if(speler2.hittestobject(munt4)){

  munt4.x=1100;

  score ++;

}

  if(speler2.hittestobject(munt5)){

  munt5.x=1100;

  score ++;

}

}

 

this have far.

yes, normal way of maintaining score variable.  need declare though...

 

var score:int = 0;



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?