Collision with enemy

For questions about using Classic.

Post » Mon Feb 09, 2009 10:34 pm

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 ? :)
almost there
B
6
S
2
G
5
Posts: 47
Reputation: 2,024

Post » Mon Feb 09, 2009 10:42 pm

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.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Mon Feb 09, 2009 10:45 pm

thx for the quick answer i will try that : )
almost there
B
6
S
2
G
5
Posts: 47
Reputation: 2,024

Post » Mon Feb 09, 2009 11:52 pm

nope still isn't working : )

http://www.speedyshare.com/941235359.html here is a swf file with the problem :)
almost there
B
6
S
2
G
5
Posts: 47
Reputation: 2,024

Post » Tue Feb 10, 2009 12:26 am

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. :)
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Tue Feb 10, 2009 12:40 am

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
almost there
B
6
S
2
G
5
Posts: 47
Reputation: 2,024


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests