Posted By
|
Message
|
Liam D
Registered 06/05/2004
Points 2
|
9th May, 2004 at 15:59:03 -
Hi in my game i have copied one object so htere is two of them..is there a way to stop them both dying if only 1 is hit?
Need Help?, Call in the cleric!
|
Willy C
Registered 14/02/2004
Points 1524
|
9th May, 2004 at 16:08:45 -
Im not sure what code you used to manage that, but basicly all you need is to make a code like this: Collision with "bullet" and "enemy"(or something) = destroy "enemy".
Or if you want to give your enemy individual health points, do like this:
-Start of level= set value a to 5
-collision with "bullet" and enemy" = substract 1 from value a
-Value A less or equal to 0 = destroy enemy
the first event explains how much health the individual enemy has (in this example "5"), the rest pretty much explains itself.
http://www.robocaptain.com
|
Cybermaze
Registered 03/04/2003
Points 853
|
9th May, 2004 at 16:10:15 -
Yes. Its so simple as its allready working that way. Its all a matter of "focus". And collision is one way of defining focus. So, if you make an event with "player" collides with "enemy" action "destroy enemy" only the enemy that actually collides with the player will be destroyed as focus is only on that particular enemy, no matter how many clones or instances you have of the object "enemy".
If you knew, I would have to kill you...
|
Liam D
Registered 06/05/2004
Points 2
|
10th May, 2004 at 10:52:00 -
I know exactly what im doing.
Its just mmf playing up.
Ive told it so when bullet collides with enemy > destroy enemy...but both die!
Need Help?, Call in the cleric!
|
Mr Icekirby
Registered 18/12/2003
Points 846
|
10th May, 2004 at 17:22:59 -
well you can always try reinstalling mmf, it might make a differnce
Mr Icekirby says so!
OBEY ME!
|
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
|
11th May, 2004 at 03:36:58 -
Are they the only events in the game? Because it could be caused by a conflict in code. You may want to see if you have any other destroy code anywhere else that may be effecting it.
Try starting a new application, create two objects (player + enemy). Make the player have bouncyball movement.
always - player.dir = "look in the direction of enemy"
Player collides with enemy - Destroy enemy
Then copy the enemy and see what happens.
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
|
Echisketch(PS)
Registered 20/03/2004
Points 852
|
11th May, 2004 at 11:47:29 -
well.... Are you sure that the enemy isn't the same object as you? You little man.
"Everytime you use Kazaa, a metallica band member dies a little."
Quote Jonathon Smeby.
|
|
|