Page 1 of 1

Collision with enemy

PostPosted: Mon Feb 09, 2009 10:34 pm
by pikus
Hi , it's probably easy to do but i stucked on this , i just wanted to recognise the direction my player is standing in front of an enemy so the enemy punches him in the opposite direction when they are both colliding , but it is somehow not working maybe cause of there are multiple enemy copies on the field

I've made something like that but its probably wrong i should put loop there or something



and here is the condition for bouncing off the enemy



Its only working for one side of the enemy dunno why

could anyone help me with that ? :)

Re: Collision with enemy

PostPosted: Mon Feb 09, 2009 10:42 pm
by linkman2004
You need to get rid of the "For each Sprite 3" loop. Everything should work fine once you do that. Although your events are rather confusing, so I can't be completely sure.

Also, you don't need to use TimeDelta on the "Every X milliseconds" conditions. It already works on a timer, so TimeDelta isn't needed.

Re: Collision with enemy

PostPosted: Mon Feb 09, 2009 10:45 pm
by pikus
thx for the quick answer i will try that : )

Re: Collision with enemy

PostPosted: Mon Feb 09, 2009 11:52 pm
by pikus
nope still isn't working : )

http://www.speedyshare.com/941235359.html here is a swf file with the problem :)

Re: Collision with enemy

PostPosted: Tue Feb 10, 2009 12:26 am
by linkman2004
I honestly don't know what the problem is, but I did whip up a CAP showing a similar way to do it that works. Here it is. I hope that helps. :)

Re: Collision with enemy

PostPosted: Tue Feb 10, 2009 12:40 am
by pikus
i somehow figured out what was wrong there -> the positioning , but i've done like it was in your cap nd it works fine now : ))) thx a lot :-D