First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing! | Flash Jobs
Search tutorials
Author: Cloud_909 | Website: http://www.freewebs.com/cloud_909
Should we get started? Now relax and read this clearly. I will explain everything you need to know... Ok open Flash 2004! make the first frame a name of "setup" and add this actionscript to it: HP = 750; enemyHP = 500; This will tell it to add your hp and the enemie's hp to a number. Now make another frame and put this frame as "You". Ok! Now make a "attack" button. Now put a enemy on one side and you on the other. Above your character make a static text that reads "HP:" now put a dynamic text just right on the right side. Do the same for the other side for the enemy. Now the dynamic texts, put the enemy one a variety "var:" put that as "enemyHP" now yours is "HP" now make the attack button this actionscript: gotoAndPlay("attack") This will go to "attack" frame. now go make another frame and put it: "attack" name. now from that frame make a animation of your character attacking. when your done make the last frame actionscript: gotoAndStop("You"); Now go to the frame where your character "hit" the enemy. Put this in THAT frame. _root.enemyHP = _root.enemyHP-random(70); Now it will pick a number between 0-70 as the damage. Now put this into the frame where you can press the attack button: stop(); Now make it like that for the enemy attacking. so if its _root.enemyHP = _root.enemyHP-random(70); just switch it to this on the enemy attacking u: _root.HP = _root.HP-random(80); Now make 2 frames in the end and put that as the winning frame. and the loosing. So put this into the "You" frame. if (_root.HP==0) { gotoAndStop("lose"); } } if (_root.enemyHP==0) { gotoAndStop("win"); } } Now name one frame the "win" frame and the "lose" frame now put something in both of them and now your done! just put this into the lose and win frame: stop(); test it and love it!
» Level Advanced

Added: 2005-01-18
Rating: 4.95 Votes: 83
(10 being the highest)
» Author
Hello it is my pleasure to help other people MASTER flash MX, 5, 6, and Pro 2004! Its my mission to get you making advanced stuff!
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

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

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.