Publisher review:Simple sprite control with the keyboard - If you want to create a game will probably reach the point where you need to animate a little sprite on the screen If you want to create a game will probably reach the point where you need to animate a little sprite on the screen, the following tutorial is very simple, I will show you how you can control a sprite using the arrow keys. I will show you 2 different methods to do it. The sprite will be able to move in 8 directions and will flip horizontally according to the direction.
Both movies below have a frame rate of 30fps, the second movie seems to run faster because we use the setInterval method with updateAfterEvent to smoothen the animation. The first Movie use onEnterFrame and although it is a bit slower it is less cpu intensive. If you want to speed up the animation for the first movie you will have to raise the frame rate, this is not necessary when you use setInterval with updateAfterEvent, if we had a 1fps movie it will be exactly as fast, it is just dependant on the interval value you define in the method.
Simple sprite control with the keyboard is a Flash script for Financial Modeling and Analysis scripts design by flashvalley.com.
It runs on following operating system: Windows / Linux / Mac OS.
Operating system:Windows / Linux / Mac OS