Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Flash Overhead RPG Tutorial - Part 5 - Health bar/system

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,184
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 17, 2009

SOURCE FILE AND HD VIDEO WILL BE AT...
http://adobeflashtutorials.tk/


In this tutorial I will show you how to make your character have a health bar and how to make you lose health when you hit an enemy.

--------ACTIONSCRIPT--------

On the healthbars actionscript layer

++++++++++++++++
onEnterFrame = function(){
gotoAndStop(_root.hpvar);
}
++++++++++++++++

On the enemy

++++++++++++++++
onClipEvent (load) {
_root.score = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.toon.toonattack.toonrange)) {
this.gotoAndPlay(2);
_root.score += 1;
}
if (this.hitTest(_root.toon._x, _root.toon._y, true)) {
_root.hpvar -= 1;
}
}
++++++++++++++++

And on the toon

++++++++++++++++
onClipEvent(load){
_root.current_wep = 1
_root.hpvar = 100
}
++++++++++++++++

Source [will work on this soon]

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • can u make a tutorial of health bar in AS3 ??? i really cant do it on AS3...

  • @Henrik091 fucking noob troll. at least troll hard and don't use asterisks. asterisks are retard. And it's more useful in the world to know how to make a Flash game than being verbally agressive in the internet.

  • @ttaxlu hitTest does that, i guess.

  • Great tutorial, thanks!

  • Here the centerpoints need to meet for the hp_bar to get down. how do you do so that it only needs to touch????????

    answer plz

  • ??????

  • fucking troll...

  • ok his a nerd and your retarded so whats worst being retarded....

  • fu*king nerd

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more