The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 5:40 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 3 posts ] 
[Request] Deduction HP Display 
Author Message
User avatar

Joined: Tue May 26, 2009 7:40 am
Posts: 6
Reposted because I didn't read this forum's rules. Not the entire MG Gaming Forum rules, just the Flash Tutorials Forum rules.

Well, I don't know if anyone here has seen my own RPG-ish series, but anyway.

I already learned how to play and use two characters in the battle. I've tried to make some numbers appear on top of the attacked which is the same as the subtracted life points. Example, when the enemy attacks and hits, the attack reduces 23 HP, then I want that number to appear above the attacked so it would show how much damage is taken.

So, does anyone know how to do this?

_________________
Image
Image


Thu May 28, 2009 10:51 pm
YIM
User avatar

Joined: Mon Aug 11, 2008 1:09 pm
Posts: 166
Location: England lol
Gender: Male
Currently Playing: Minecraft
-Make a movie clip with a dynamic text box inside. Call the textboxes instance name 'hp_txt'.

-Make the movie clip do a motion tween from 1 to 15 frames and make the text box rise as it does in most RPG's.

-On the last frame add this code:

Code:
unloadMovie(this);


-In the library give the movie clip a linkage name of 'hp_display'. Make sure there are no instances of the movie clip on stage.

-Use this function. Then whenever you take HP off, call this code (were assuming 'playerNum' is the number of the character receiving damage and that the movie clips for each character are called player1, player2 etc...):

Code:
function hpDisplay(playerNum) {
  _root.attachMovie("hp_display", "hp_display" + playerNum, _root.getNextHighestDepth());
  _root["hp_display" + playerNum]._x = _root["player" + playerNum]._x
  _root["hp_display" + playerNum]._y = _root["player" + playerNum]._y
}

//To call the function use this
hpDisplay(1);


Fri May 29, 2009 7:35 am
WWW
User avatar

Joined: Tue May 26, 2009 7:40 am
Posts: 6
Cool thanks. Sorry for the very late reply.

_________________
Image
Image


Sun Jun 21, 2009 2:04 pm
YIM
Display posts from previous:  Sort by  
 [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.