|
1. Create a person or object and convert it to a movie clip
You can draw whatever you want: a circle, stick figure, square... etc. Just select it, right-click convert to movie clip.
2. Click on the movie clip to edit the actions of your movieclip
The following actionscript should be added to your movieclip.
onClipEvent(load){ speed = 7; jspeed = 0; jumping = false; startY = this._y; } onClipEvent(enterFrame){ if(jumping){ this._y += jspeed; jspeed++; if(this._y > startY){ this._y = startY; jumping=false; } }else if(Key.isDown(Key.SPACE)){ jumping = true; jspeed=-10; } if(Key.isDown(Key.RIGHT)) this._x += speed; if(Key.isDown(Key.LEFT)) this._x -= speed; }
3. Test out your movie
This is just to show you how to move left right and jump, you can improvise other stuff :).
|