Simple sprite control with the keyboard

Category: Other - Tools & Utilities

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. Date: 21 March, 2012


Simple Sprite - Keyboard Control - Flash Components - Simple - Sprite - Keyboard

Homepage: http://www.flashvalley.com/

Developer: flashvalley.com

License: Freeware

Operating System: All

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

This Python/Pygame script demonstrates how to move an image using keyboard input.

developer Developer: codesampler.com
license License: Freeware
operating systems Operating System: All


Build amazing 3D rotation menu with a few easy steps.

developer Developer: digicrafts.com.hk
license License: Freeware
operating systems Operating System: All


Web based Mp3 And Video Player for your website.

developer Developer: gchats.com
license License: Freeware
operating systems Operating System: ASP 3.0 , Windows IIS


This Flash and ColdFusion application allows a user to fill out a small form and have the contents emailed to a certain address.

developer Developer: flashcfm.com
license License: Freeware
operating systems Operating System: Win NT, Unix


This is a simple app combining a Flash form along with CF''s embedded form validation.

developer Developer: flashcfm.com
license License: Freeware
operating systems Operating System: Win NT, Unix


The Extend Tweening Engine is an Action Script animation engine that can be used to ease the work of creating and managing animations for just about anything: filters, colors, positions and sizes, etc.

developer Developer: extend studio
license License: Freeware
operating systems Operating System: Windows 2000,XP,2003,Vista,Mac OS X


Animated MovieClip with additive color blending.

developer Developer: alphanimal.at
license License: Freeware
operating systems Operating System: All


It is an useful tool in Flash animations, effects and transitions.

developer Developer: greensock.com
license License: Freeware
operating systems Operating System: All


Detecting motion in webcam images.

developer Developer: alphanimal.at
license License: Freeware
operating systems Operating System: All