How to make actor disappear when lifes = 0

Talk about making games.

How to make actor disappear when lifes = 0

Postby Ehman » Fri May 04, 2018 11:34 pm

How can I make an actor disappear when life =0
Please help me! :oops:
User avatar
Ehman
 
Posts: 186
Joined: Wed Apr 18, 2018 7:56 pm
Location: MonsteRealm
Score: 1 Give a positive score

Re: How to make actor disappear when lifes = 0

Postby MrJolteon » Sat May 05, 2018 7:37 pm

In a draw actor script:
Code: Select all
if(life==0)
{
    DestroyActor("Event Actor");
}
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: How to make actor disappear when lifes = 0

Postby Ehman » Sun May 06, 2018 10:32 am

Thanks mr. Jolt. :|
User avatar
Ehman
 
Posts: 186
Joined: Wed Apr 18, 2018 7:56 pm
Location: MonsteRealm
Score: 1 Give a positive score

Re: How to make actor disappear when lifes = 0

Postby tdmxross » Tue May 08, 2018 2:59 pm

So we need to use == instead just using = ?
for example, if we want to trigger an event when the value of 'Angle' reaches 90, then we should do this-

if (angle==90)
{
DestroyActor("Event Actor");
}

is this how it works?
i didn't knew about this
GE is better than every single game engine
User avatar
tdmxross
 
Posts: 48
Joined: Sun Dec 24, 2017 7:12 pm
Location: Maharashtra, India
Score: 4 Give a positive score

Re: How to make actor disappear when lifes = 0

Postby juansimat » Tue May 08, 2018 3:09 pm

= is an assignment operator (assigns the value of the right side to the left side).
== is a comparison operator (checks if both sides are the same).

You can read more about operators here.
̿̿¯̿̿¯̿̿'̿̿̿̿̿̿̿'̿̿'̿̿̿̿̿'̿̿̿)͇̿̿)̿̿̿̿ '̿̿̿̿̿̿\̵͇̿̿\з=(๏̯͡๏)=ε
User avatar
juansimat
 
Posts: 152
Joined: Sat Dec 19, 2009 8:23 am
Score: 27 Give a positive score

Re: How to make actor disappear when lifes = 0

Postby tdmxross » Wed May 09, 2018 4:33 am

juansimat wrote:= is an assignment operator (assigns the value of the right side to the left side).
== is a comparison operator (checks if both sides are the same).

You can read more about operators here.

Thank you so much!! :D
1+ score for helping me out :wink:
GE is better than every single game engine
User avatar
tdmxross
 
Posts: 48
Joined: Sun Dec 24, 2017 7:12 pm
Location: Maharashtra, India
Score: 4 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: Google Adsense [Bot] and 1 guest

cron