actor destroy when punched

Talk about making games.

actor destroy when punched

Postby Hen » Wed Aug 25, 2004 10:59 pm

hi there im relatively new to this though i have been through all the tutorials. I have made an actor (jon) destroy another actor (player) on collision. but i would like player to destroy jon if player is punching.

I do not know too much about visual basic code ar anything like it but i came up with this

if ("player") .animindex = ("punch")
then Destroyactor("jon")

please could anyone help?
Hen
 
Posts: 3
Joined: Sun Aug 22, 2004 7:50 pm
Score: 0 Give a positive score

Postby jazz_e_bob » Thu Aug 26, 2004 6:33 am

Your logic is fine. Here's how to do it the GE way. :wink:

This function needs to be placed at the point where player collides with jon.

So:

On Player Event Collision (anyside of jon)

if ( player.animindex == 2 ) // punch animation
DestroyActor("Collide Actor"); // destroy jon

jazz

:)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Hen » Fri Aug 27, 2004 9:02 am

it doesn't seem to work,

jon just destroys player even if he punches, have i typed it in the wrong action?

should i make it a conditional action?
Hen
 
Posts: 3
Joined: Sun Aug 22, 2004 7:50 pm
Score: 0 Give a positive score

Postby hobgoblin » Sun Aug 29, 2004 3:15 am

why don't u just creat and actor jon_punching

then when you push the key, destroy jon, create jon_punching, animation fininsh, destroy jon_punching and create jon

then the bad guy will be destroyed when he colides with jon_punnching not jon
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron