collide.ACT->HP = 0 <--not work.

Non-platform specific questions.

collide.ACT->HP = 0 <--not work.

Postby equinox » Wed Feb 27, 2008 7:32 pm

I am trying but I don't succeed in understanding.

Someone can help me,please?

actors = getAllActorsInCollision("Event Actor", &n);
if(actors){
for(i = 0; i < n; i++){
if(strcmp(actors[i].name, "PUNTO") == 0){// ZERO SE STRINGHE uguali
// PUNTO.HP = 0;// PUNTO is dead.
//ACT->HP = 0;// PUNTO is dead.
collide.ACT->HP = 0;// PUNTO is dead. <--- not work.
//DestroyActor(actors[i].clonename);
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: collide.ACT->HP = 0 <--not work.

Postby Game A Gogo » Wed Feb 27, 2008 7:44 pm

what are you trying to do?
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: collide.ACT->HP = 0 <--not work.

Postby equinox » Thu Feb 28, 2008 9:21 am

when (actor Hero) it collides with (PUNTO actor),

Hero removes 10 points from PUNTO.HP.

This in script to DRAW HERO. But I don't succeed.

You can help me,please?
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: collide.ACT->HP = 0 <--not work.

Postby Game A Gogo » Thu Feb 28, 2008 1:03 pm

on collision event in Hero with Punto, do this script:
Code: Select all
Punto.HP-=10;
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: collide.ACT->HP = 0 <--not work.

Postby equinox » Thu Feb 28, 2008 6:01 pm

Tnk fore reply...but yuor code not work.
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: collide.ACT->HP = 0 <--not work.

Postby edh » Thu Feb 28, 2008 6:37 pm

Are you trying to remove HP from Punto until Punto is < 0 and then destroy Punto?

Are you looking for something like this?

Code: Select all
if ( actor in collision is Punto ) {
Punto.HP-=10;
if (Punto.HP <= 0) {
DestroyActor(Punto);
}
}
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: collide.ACT->HP = 0 <--not work.

Postby equinox » Thu Feb 28, 2008 7:49 pm

exactly this I desired to do.
But I don't succeed in doing it alone, even if I have read and reread 1000 times the file doc and seen the tutorials. :o((((
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: collide.ACT->HP = 0 <--not work.

Postby Game A Gogo » Thu Feb 28, 2008 7:49 pm

you need to do this in the Collision event, not draw actor
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron