ok i want to know if there is a simple way to make it when i attack the enemy that the
damage pops up over the enemies head for every attack that hits him. e.x. i shoot the enemy and another thing damages him
then both of the damages pop up over the enemies head but next to each other.
I think i could make sprites that show each damage. but that could get quite big because you can upgrade damage etc.
If the sprite way is my best choice just say so.
hit marker/scoring
Started by robinsblade, Apr 24 2012 05:53 PM
3 replies to this topic
#1
Posted 24 April 2012 - 05:53 PM
#2
Posted 24 April 2012 - 06:09 PM
Absolutely not, very rarely a sprite will be better than code if it goes about text.
You wanted to make it so that multiple damages would appear next to each other, but I think it would be better to make the damage go upstairs and vanish, this is also easier to do.
In that case you should create a new object that represents the damage and add in his draw event:
draw_set_font(aFont);
draw_set_color(c_black);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_text(x,y,damage);
and in his create event:
vspeed=-1;
and in his step event:
image_alpha-=.01;
if image_alpha<=0
instance_destroy(();
and then you should create this object with this code when the enemy takes damage:
var(temp)=damageTaken; // replace this
with instance_create(x,y,damage_counter) damage=string(temp);
You wanted to make it so that multiple damages would appear next to each other, but I think it would be better to make the damage go upstairs and vanish, this is also easier to do.
In that case you should create a new object that represents the damage and add in his draw event:
draw_set_font(aFont);
draw_set_color(c_black);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_text(x,y,damage);
and in his create event:
vspeed=-1;
and in his step event:
image_alpha-=.01;
if image_alpha<=0
instance_destroy(();
and then you should create this object with this code when the enemy takes damage:
var(temp)=damageTaken; // replace this
with instance_create(x,y,damage_counter) damage=string(temp);
#3
Posted 24 April 2012 - 09:45 PM
ill try this but first how will i get the numbers to show up above the enemy? and second could i put this code in the enemy?
#4
Posted 25 April 2012 - 02:35 AM
fix* i made it so that when the skill/attack collides with the enemy it creates the object and displays the hit points.(this will cause issues when multiple instances are in the game so plz if you know a better way then say so:P)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











