Search tutorials
Step1: Make your object.
Step2: Turn it into a movieclip.
Step3: Right click on it > Actions.
Step4: Copy and paste following code.
onClipEvent (load) {
speed = 5;
}
(This determines the allround speed)
Step5: Change the digit 5 to the speed you want.
Step6: Click on the } sign.
Step7: Copy and paste following code.
onClipEvent (enterFrame) {
if (key.isdown(key.LEFT)) {
_x-= speed;
}
if (key.isdown(key.RIGHT)) {
_x+= speed;
}
if (key.isdown(key.DOWN)) {
_y+= speed;
}
if (key.isdown(key.UP)) {
_y-= speed;
}
}
(This determines the position of itself relative to the speed varible)
Step8: Control > Test MovieWell done! You have just made an object which can go in 8 different directions! Now you can simply ssign that to any object you wish!
| » Level Basic |
|
Added: 2003-04-11 Rating: 7 Votes: 123 |
| » Author |
| What about my details? |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!