boss hp

Talk about making games.

Re: boss hp

Postby xr2alex99 » Mon Jun 16, 2008 12:04 pm

Ty and uh
also do you know how to create an (text actor) that will show how much hp the actor has left (Enemies)
i had it kind of set up but i scrapped it after a few hours of 100% failure i had it show the max hp though it didnt change though. And my Freeze spell needs help to make the after freeze actually freeze the actor for a set # of time
Basically: if the actor touches the after freeze it will be unable to do anything at all for a amount of time (timer)
(\___/) My bunny :twisted:
(=' . '=) is a king of :twisted:
(")___(") awesome :twisted:
User avatar
xr2alex99
 
Posts: 22
Joined: Sat Sep 01, 2007 7:48 am
Score: 0 Give a positive score

Re: boss hp

Postby DST » Mon Jun 16, 2008 12:20 pm

In Draw Actor>
textNumber=player1.hp;

Now lets make it a complete variable counter, like this:

1. take your text actor and clone it as many times as you need for whatever you want a meter of.

2. In its draw actor, put this:

switch(cloneindex){
case 0:
textNumber=player1.hp;
break;
case 1:
textNumber=any variable you wish;
break;
case 2:
same thing
break;
}

now you make as many meters as you want, and access them all from one single script.


As for freezing, its easier with player1 than it is with enemies.

Player1>collision>afterfreeze
directional_velocity=0;
EventDisable("Event Actor", EVENTKEYDOWN);
CreateTimer("Event Actor", "freezetimer", ms); //where ms is the length of the timer, in ms.

Then on player1>freezetimer
EventEnable("Event Actor", EVENTKEYDOWN);

For an enemy, you'll have to disable whatever make the enemy do stuff.
If its on a path, you have to ChangePath("Event Actor", "none", BOTH_AXIS);
if its running on timers, you have to use DestroyTimer("timername");
if it has velocity, direction_velocity=0;

Also, if its a sidescrolling game with gravity, you'll have to disable gravity temporarily too.

usually, in my draw actor, i have yvelocity+=gravity;

Then i set gravity to 1, and i can set it to 0 any time i need.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest