View Full Version : stop game
fried
February 28th, 2003, 12:59 AM
I have posted this question befor but was asked to be more specific, so here goes.I have made a little cricket game wher the fielder has to catch the ball.There are three different game speeds,slow, medium and fast. I keep score using a dynamic text box and use the code _root.total = _root.total+1.When the scor reaches 15 I need the game to go to the next speed level.How will I do this?
lostinbeta
February 28th, 2003, 01:11 AM
total = 0
function addScore() {
total++;
if (total>= 15){
//change speed code goes here
}
}
Add that to a keyframe in the main timeline, then instead of doing _root.total = _root.total+1 just do _root.addScore() it will run the function as shown above. What that function does is takes the variable total, and increments it by 1 (equvilent of _root.total = _root.total+1). Then it checks if total is greater or equal to 15, and if it is, it does whatever you tell it to do in there.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.