[as2] Basic RPG Movement

View previous topic View next topic Go down

Do you like this tutorial?

100% 100% 
[ 1 ]
0% 0% 
[ 0 ]
 
Total Votes : 1

[as2] Basic RPG Movement

Post  Exzeta on Sat Jan 09, 2010 3:35 pm

Hello ASers , if you want to make a flash game RPG you must know the basic movement.

Step one: Draw your character,Just draw a circle or square since it is a test.
Step two: Select your character and convert into Movie Clip(F8>movie clip)
Step three: Write (or copy) the following code,it is explained so take your time to read it.
Code:
Code:
onClipEvent(load){
speed=10;//sets a variable named speed,It can be changed to whatever //number you want
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){//If the "UP" key is Pressed down
this._y-=speed;//Sustracts the speed variable to the current y Position
}
if(Key.isDown(Key.DOWN)){//If the "DOWN" key is pressed down.
this._y+=speed;//Adds the speed variable to the current Y position
}
if(Key.isDown(Key.RIGHT)){//If the "RIGHT" key is pressed down.
this._x+=speed;//Adds the speed variable to the current X position
}
if(Key.isDown(Key.LEFT)){//If the "LEFT" key is pressed Down.
this._x-=speed;//Sustracts the speed variable to the current X position
}
}

Step 4: Try your movie,you should have something like This
avatar
Exzeta
Admin

Posts : 34
Join date : 2010-01-08
Location : Guatemala

View user profile http://minigrounds.forumotion.net

Back to top Go down

Re: [as2] Basic RPG Movement

Post  avatarbobo on Sun Jan 10, 2010 1:27 pm

usefull, thanks Very Happy

avatarbobo
Admin

Posts : 33
Join date : 2010-01-08
Age : 26
Location : Guatemala

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum