[as2] Basic RPG Movement
2 posters
Mini-Grounds :: Tuts :: Flash Tuts
Page 1 of 1
Do you like this tutorial?
[as2] Basic RPG Movement
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:
Step 4: Try your movie,you should have something like This
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
Re: [as2] Basic RPG Movement
usefull, thanks
avatarbobo- Admin
- Posts : 33
Join date : 2010-01-08
Age : 33
Location : Guatemala
Mini-Grounds :: Tuts :: Flash Tuts
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum