Quote:
Originally Posted by orange gold
On Frame 1: (This isn't hit test by the way)
ActionScript Code:
PlayerScore = 0; //variable for number set.
score.text = PlayerScore; //set the score text equal to the number (variable) of the current score (in this case the player starts at 0)
racoon_mc.onPress = function() { //When the click the racoon. (spelled raccoon* by the way)
PlayerScore ++; // add 1 to the score.
score.text = PlayerScore; //set the score text equal to the number (variable) of the current score
}// end the (when click) function
|
yeah, this is pretty much what I would suggest...
though you may want a function to make the raccoons go back down when you hit them, as well:
If you already have a way that they go back down, simply call that function (or gotoAndPlay that frame) within the onPress function, after the score increment
e.g.
ActionScript Code:
racoon_mc.onPress = function()
{
PlayerScore ++;
score.text = PlayerScore;
racoon_mc.gotoAndPlay("hide");
}
or...
ActionScript Code:
racoon_mc.onPress = function()
{
PlayerScore ++;
score.text = PlayerScore;
hideRaccoon();
}