First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: IT is my name.
For this you need to know how to make Movie Clips, mess around the properties of text (change it to static, dynamic, and input) In this tutorial you will be makin a character, health, money, enemies, and talking to people. THE FLOOR: Okay draw your floor or terrain or whatever you want to call it. After you are done drawing the floor turn it into a movie clip. Go to the properties table of the ground and give it an instance name of "terrain". without quotations. _______________________________________Character: Draw your character. Now convert it to a movie clip. Press "OK". Now go to the properties and give it an instance name of "man" without the quotations. Now double click on the character to edit it. On the first frame's actions put the action


on the next few frames of the movie clip edit the character walking in place. Now double click on anywhere besides the character. Now the put these codes on your character.

onClipEvent (load) { gravity = 0.2; yspeed = 0; xspeed = 1; jumping = 0; } onClipEvent (enterFrame) { if (_root.go) { if (Key.isDown(Key.LEFT)) { if (!_root.terrain.hitTest(_x-_width/2, _y+_height/4, true)) { _x -= xspeed; } } if (Key.isDown(Key.RIGHT)) { if (!_root.terrain.hitTest(_x+_width/2, _y+_height/4, true)) { _x += xspeed; } } if ((Key.isDown(Key.UP)) and (!jumping)) { yspeed = -5; jumping = 1; } yspeed += gravity; while (_root.terrain.hitTest(_x, _y+_height/2, true)) { _y--; yspeed = 0; jumping = 0; } if ((!_root.terrain.hitTest(_x, _y+_height/2+1, true)) or (yspeed<0)) { _y += yspeed; } else { yspeed = 0; jumping = 0; } } } onClipEvent (load) { scale = _xscale; } onClipEvent (enterFrame) { if (key.isdown(key.right)) { this._x += 10; _xscale = scale; play(); } if (key.isdown(key.left)) { this._x -= 10; _xscale = -scale; play(); } }

health system: Make a red rectangle. On the properties table have the width at 100. That is important. Select the red rectangle. turn it into a movie clip and now put the name as "hpBar" BUT!!!!!!!! where it says registration put it to the middle left. IMPORTANTTTT!!!!!! Now add this code to the health bar.

onClipEvent (enterFrame) { this._xscale = _root.hp; if (_root.hp<=0) { _root.hp = 0; if (_root.hp<=100) { _root.hp = 100; } } }

ENEMIES: Draw your enemy and make it a movie clip. name it "enemy1" also put the registration point as the middle one. Now double click on the movie clip and animate him moving or whatever you want.What the code does is that when the character hits the man the health bar goes down. Also when you are close to the enemy if you press SHIFT key, the enemy dies. Add this code to the enemy. onClipEvent (enterFrame) { if (_root.man.hitTest(this)) { _root.hp--; } } onClipEvent (enterFrame) { distance = 55; ux = _root.man._x; uy = _root.man._y; hx = this._x; hy = this._y; if (Math.sqrt((ux-hx)*(ux-hx)+(uy-hy)*(uy-hx))onClipEvent (enterFrame) { if (_root.man.hitTest(this)) { _root.score += 10; unloadMovie(this); } } Talking to people: Draw the person you want talking to him. Make it a movie clip. Put these actions in the person

onClipEvent (enterFrame) { distance = 55; ux = _root.man._x; uy = _root.man._y; hx = this._x; hy = this._y; if (Math.sqrt((ux-hx)*(ux-hx)+(uy-hy)*(uy-hx))_____________________Where it says PUT WhATEVER YOU WANT IN HERE! well... go to expert mode and look for that scripting. and well just put whatever you want there.

» Level Basic

Added: 2008-02-27
Rating: 2.96 Votes: 49
» Author
Make sure you read all of the instructions.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.