A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: how do u make a health bar

  1. #1
    Member
    Join Date
    Aug 2002
    Posts
    53
    how do u make a health bar for a game like this when the guy gets hit by a enemy http://www.angelfire.com/anime4/www....Happy_face.swf

  2. #2
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    check out edmack.com for a good tut on this in the simple as section

  3. #3
    .fla vont's Avatar
    Join Date
    Oct 2001
    Posts
    473
    I'll try to tell you how to make a health bar .. but not like the one in the site cuz i wasn't able to see it .. i got ( Not Allowed thing ) ..

    okay about the health bar :
    >> First make a new MC and draw a rectangle inside it but start your drawing from X= 0 or from this point + to what ever X number you want .. make it to X= 80.

    >> Then take your new MC to the main timeline and give it an instance name .. name it (health).

    >> use this code in your new MC (health) This code with hitTest action :

    if(this.hitTest(_root.somthing)==true){
    _root.health._xscale -= 10;// So if your Character hits the something MC , your MC health will decrease to 10;
    }

    >> And to stop the health from going after X= 0 .. try this code :

    if(this._root.health._xscale <= 0){
    _root.health._xscale = 0;
    _root.gameover.gotoAndStop(2);//if you want to add gameover to your game .
    }

    ****

    That's it .. Good luck and hope it works.
    [Edited by vont on 09-05-2002 at 07:01 PM]

  4. #4
    Member
    Join Date
    Aug 2002
    Posts
    53

    THNX SO MUCH

    Originally posted by vont
    I'll try to tell you how to make a health bar .. but not like the one in the site cuz i wasn't able to see it .. i got ( Not Allowed thing ) ..

    okay about the health bar :
    >> First make a new MC and draw a rectangle inside it but start your drawing from X= 0 or from this point + to what ever X number you want .. make it to X= 80.

    >> Then take your new MC to the main timeline and give it an instance name .. name it (health).

    >> use this code in your new MC (health) This code with hitTest action :

    if(this.hitTest(_root.somthing)==true){
    _root.health._xscale -= 10;// So if your Character hits the something MC , your MC health will decrease to 10;
    }

    >> And to stop the health from going after X= 0 .. try this code :

    if(this._root.health._xscale <= 0){
    _root.health._xscale = 0;
    _root.gameover.gotoAndStop(2);//if you want to add gameover to your game .
    }
    THNX SOO MUCH AND BY THE WAY DO U WANNA BE PART OF THE GAME AND MY WEBSITE
    ****

    That's it .. Good luck and hope it works.
    [Edited by vont on 09-05-2002 at 07:01 PM]

  5. #5
    .fla vont's Avatar
    Join Date
    Oct 2001
    Posts
    473

    you're welcome ..

    You're welcome porpous2 .. and about being part of the game and your website .. SURE i would love to .

  6. #6
    Member
    Join Date
    Aug 2002
    Posts
    53

    Re: you're welcome ..

    Originally posted by vont
    You're welcome porpous2 .. and about being part of the game and your website .. SURE i would love to .
    http://www.capflash.com is my website but i havent put my flash layout on it b/c i havent finished it yet soooo do u have aim its FREE its awsome get it

  7. #7
    .fla vont's Avatar
    Join Date
    Oct 2001
    Posts
    473
    okay .. let me think about it, Need to know how to contact you .. What's your email ?

  8. #8
    Member
    Join Date
    Aug 2002
    Posts
    53

    porpous2@aol.com

    Originally posted by vont
    okay .. let me think about it, Need to know how to contact you .. What's your email ?
    porpous2@aol.com get aim it soo quick and we can send flas and flash movies and stuff to each other

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center