Counting coins
$CoinsFound = 0;function Coin::onCollision(%this, %obj, %col, %vec, %len) {
%obj.delete();
$CoinsFound++;
if (Coins.getCount() <= 0) {
commandToClient(%col.client, 'ShowVictory');
}
}function clientCmdShowVictory()
{
MessageBoxOK("You Win!",
"Congratulation you found" SPC $CoinsFound SPC "coins!",
"disconnect();" );
}Last updated