|
Post by Ashley Hall on May 26, 2005 20:20:37 GMT 10
Just make a new MovieClip and copy and paste this action script into the actionscript box.
onClipEvent(load){ speed = 10; //This is where you declare the speed of the car (pixels/frame) //The best speed for this sort of thing is about 20-40 fps } onClipEvent(enterFrame){ if (Key.isDown(Key.LEFT)){ this._x -= speed; this._rotation = -90; } if (Key.isDown(Key.RIGHT)){ this._x += speed; this._rotation = 90; } if (Key.isDown(Key.UP)){ this._y -= speed; this._rotation = 0; } if (Key.isDown(Key.DOWN)){ this._y += speed; this._rotation = 180; } if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP)){ this._rotation = -45; } if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN)){ this._rotation = -135; } if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)){ this._rotation = 135; } if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP)){ this._rotation = 45; } }
|
|