Mini-Grounds
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[as2] Basic RPG Movement

2 posters

Go down

Do you like this tutorial?

[as2] Basic RPG Movement Vote_lcap100%[as2] Basic RPG Movement Vote_rcap 100% 
[ 1 ]
[as2] Basic RPG Movement Vote_lcap0%[as2] Basic RPG Movement Vote_rcap 0% 
[ 0 ]
 
Total Votes : 1
 
 

[as2] Basic RPG Movement Empty [as2] Basic RPG Movement

Post  Exzeta 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
Exzeta
Exzeta
Admin

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

https://minigrounds.forumotion.net

Back to top Go down

[as2] Basic RPG Movement Empty Re: [as2] Basic RPG Movement

Post  avatarbobo Sun Jan 10, 2010 1:27 pm

usefull, thanks Very Happy

avatarbobo
Admin

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

Back to top Go down

Back to top


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