Hi everbody,
I made this racegame, but I have a question about the ActionScript used in it. On the main timeline, i have one frame in which the actual game is. In that frame, I have a movieclip (the car I’m driving). The ActionScript is like this :
[AS]onClipEvent(enterFrame){
if (Key.isDown(Key.UP)){speed += somethingicantremember}
if (Key.isDown(Key.DOWN)){speed -= somethingicantremember}
if(Key.isDown(Key.LEFT)){this._rotation += 15}
if(Key.isDown(Key.RIGHT)){this._rotation -= 15}
[/AS]
Then it calculates the position and angle of the movieclip (the car)
Now this calculating sequence keeps refreshing because it has to keep moving, that’s quite obvious.
I’ve added some power-ups to the track ( more fun than plain driving ). One of those power-ups is a boost. Now how can I increase the speed of the car temporarily as an effect of the boost ? It always keeps refreshing and so always resetting the speed to something lower.
I have these healthbars too. I’d want them to change color from green over yellow to red, accordingly to the amount of life you have left. Know what I mean ? It’s like this …
[COLOR=limegreen]------------[/COLOR]
[COLOR=YELLOW]--------[/COLOR]
[COLOR=RED]----[/COLOR]
The structure of these healthbars is like this: On layer 1, i have the bar itself, a movieclip, whose _x position decreases everytime you hit something with your car. Above that layer i have another one, a mask, so the bar would not just move but become less long. All this is contained in a another movieclip.
So can anyone help me with this ? Thx …