Enemy hit detection not working properly

Get help using Construct 2

Post » Sat Sep 15, 2012 10:52 pm

I have been scratching my head trying to figure out why i cannot get the detection to work properly with this particular enemy. Its a slime that has platform movement, all it does is walk back and forth.

here's the problem:

Whenever you properly jump on him sometimes, you get hit anyways when really you are supposed to have killed it.

These are the guys causing the problem:


Here's my crappy coding. I'm sure there's a lot better way but I'm still learning. But this is what i have set up for his collision



Here's also a link to a build of Super Ubi Land that I created just to get help on this issue. It's only one level unlocked and it has a couple of the enemies that I am talking about. play around and you'll notice how annoying those slime things are because of the bad set up for collision.

Game Build

Can someone please help?
Thanks in advance!
Image
B
61
S
16
G
7
Posts: 505
Reputation: 12,079

Post » Sun Sep 16, 2012 2:49 am

Stomping works for me ! ( Chrome )
Note : Nice progress !!
B
36
S
16
G
16
Posts: 2,223
Reputation: 16,646

Post » Sun Sep 16, 2012 3:35 am

It was working for me as well, maybe a slight problem if you hit the monster on the side before hitting the ground.

Alternatives to Y < Y though could be using a marker to check for overlaps. Imagine you have a marker at his feet, this marker doesnt touch enemies when hit side on but when you jump on them the event would be :

Player on collision with Enemy
Marker is overlapping enemy           -> do what you want. GenkiGenga2012-09-16 03:36:50
ImageImage
B
89
S
18
G
6
Posts: 1,049
Reputation: 11,165

Post » Sun Sep 16, 2012 3:41 am

It works for me too most of the time. Though sometimes it doesn't connect properly. It happened with one of the goggled birds too, so it's maybe not contained to only the blobs. Maybe try adding "PLAYBOX is falling" to the collision event?

I noticed something else too. If you press down repeatedly when entering the door the character might get stuck when the level starts.

Also, I'm guessing the Mario sounds are only placeholders? :P
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Sun Sep 16, 2012 3:50 am

It worked for me too... BTW nice graphics and gameplay
Image
B
53
S
13
G
6
Posts: 271
Reputation: 11,963

Post » Sun Sep 16, 2012 7:19 pm

Thanks guys!
Hm... it's strange though because I get a lot of deaths due to the detection not feeling 'correct.' I will continue to play around with the code.

@GenkiGenga how would I set up markers and things like that from what you were suggesting? Would I use the pin function?
Image
B
61
S
16
G
7
Posts: 505
Reputation: 12,079

Post » Sun Sep 16, 2012 7:45 pm

You can use the pin behaviour, but just setting the XY position every tick would do the same thing.inkBot2012-09-16 19:46:03
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Mon Sep 17, 2012 3:25 am

Yeah pin/setting X-Y would be fine.

I like using image points though. If Ubi is always attached to a platformer object - then create a new image point (on your platformer object) and call it "Stomp"

Then you can use:

Every tick -> Marker, set position to another object : Platformer object AND image point : "Stomp".
ImageImage
B
89
S
18
G
6
Posts: 1,049
Reputation: 11,165

Post » Mon Sep 17, 2012 4:49 am

ahh, I see. Ok thanks for the tip. I will give it a go and see how that works :D
Image
B
61
S
16
G
7
Posts: 505
Reputation: 12,079

Post » Mon Sep 17, 2012 7:05 am

No worries, keep up the good work ;)
ImageImage
B
89
S
18
G
6
Posts: 1,049
Reputation: 11,165

Next

Return to How do I....?

Who is online

Users browsing this forum: javi1230, lamar, ninepixels and 8 guests