Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Games

Categories Beat 'em up. Part 1
Author: monkey boy

 
Page 1
1

HTML Document Structure

Player animation

the first thing you need to do is create a movie clip. Inside the movie clip draw your player1. Remember to draw every part in different layers. Once you have done that insert another layer and call it actions. in this layer you need to place an invisable button. then in the actions for frame 1 of the actions layer enter this code stop();

Player animation(cont)

Now create a key frame in frame 2 of every layer. using motion tweens create your players first attack e.g kick,punch,whatever. At the final frame of the actions layer enter this code gotoAndStop(1); Do this for three other attacks, with the same code at the end. If you want you can do two more animations one for croching and another for jumping.

Player controls

at the moment if you placed this movie clip on the main timeline and tested the movie nothing would happen. well it's time to change that. to do this create a button and insert a keyframe on the frame called hit. in this keyframe draw whatever the hell you want because no one will se it. once you have done that place it in the actions layer of your player movieclip. and enter this code on (keyPress "") { gotoAndPlay("Jump"); } on (keyPress "") { gotoAndPlay("Crouch"); } on (keyPress "6") { gotoAndPlay("Right kick"); } on (keyPress "2") { gotoAndPlay("Left kick"); } on (keyPress "4") { gotoAndPlay("Left punch"); } note: you may have to change this code a bit to get it to work depending on the length of each attack. You may have also noticed that there isn't any code for a Right punch. now all that needs to be done is movement.

Player movement

the last part and easiest to do all you need to do is place an instance of the player movie clip on the main timeline and enter this code onClipEvent (load) { moveSpeed = 5; } onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { _x -= moveSpeed; } if (Key.isDown(Key.RIGHT)) { _x += moveSpeed; } } And thats it. If you want you can add a second player by duplicationg the origional movie clip flip the whole thing horrizontaly and change the buttons. the next tutorial will cover hitTest and damage metres

1

» Level Intermediate

Added: : 2005-01-20
Rating: 4.47 Votes: 15
Hits: 440
» Author
Some brit
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments