Collision might be not working properly

Get help using Construct 2

Post » Mon Apr 01, 2013 4:31 pm

Collision might be not working properly, or I'm missing something.

I uploaded an video so you can understand better my problem.

---> http://www.youtube.com/watch?v=FFkD7alx1xc

Edit: If you prefer, I uploaded the game here: http://www.almeidamarcell.com/indiegames/cesupa-game/index.html

On this video I 'played' the game twice because so you can see what I'm saying. The collision with the edgeMarkers are kind buggy. This time I think I did everything correctly and I'm following the https://www.scirra.com/tutorials/253/how-to-make-a-platform-game/page-6 tutorial.

Here are the screenshot of my animations and my events.

---> http://i.imgur.com/XabhXBy.png

You can also see I created an JumpMarker, because I wanted to make my enemy jump. But if i use two different collisions the first one(edgeMarker) doesn't work.

Anyway, my main problem is on the video. Where the enemy(in black) sometimes colide well with the blue block and sometimes don't. This is an Constructor 2 bug or I'm missing something?almeidamarcell2013-04-01 16:59:29
B
16
S
4
G
4
Posts: 56
Reputation: 2,942

Post » Mon Apr 01, 2013 7:08 pm

I would say most likely it is because you are not using a dedicated collision sprite pinned to the enemy. If you look at the collision polygon it is most likely changing shape in each frame of your animation. Your animation also seems very jittery. Similar to the platformer tutorials you should use a transparent sprite for collisions so the shape does not change during animation frames.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Tue Apr 02, 2013 3:09 am

What you mean by dedicated collision sprite pinned to the enemy? I don't see anything about collision pinned to the enemy on this tutorial. About the collision polygon, where do you see changing shape in each frame of the animation? Just to make sure I also put the frame speed at 0 and the bug still.

I was using those blue blocks with transparency, but I made them visible just to see better what is going on. Here is also the .capx file, maybe you can help me out better.


https://www.dropbox.com/s/ghqu5a0fr1iao56/platatform-gam.capx
B
16
S
4
G
4
Posts: 56
Reputation: 2,942

Post » Tue Apr 02, 2013 3:57 am

you need a pin in your player sprite, the pin behavior. and you need to do this in your event sheet.
event: on start of layout.
action:-player pin pin to playerbox.
       -player set position to player box
B
17
S
2
G
2
Posts: 82
Reputation: 1,712

Post » Tue Apr 02, 2013 4:03 am

lol you fixed that issue, well i think that you need to do the same thing to your enemy sprites also you need to use for each enemy because you need to handle them individualy and use a container for them that will help you if you want to give them variables like hp and others.
B
17
S
2
G
2
Posts: 82
Reputation: 1,712

Post » Tue Apr 02, 2013 4:09 am

i checked your capx and you need this.
event: system for each enemy ice
sub event: enemy ice on collition with edge marker
           ..... action right
           ..... action left

also you need to edit the sprite enemy ice the origin points are in weird places that is why the animation isn right
B
17
S
2
G
2
Posts: 82
Reputation: 1,712

Post » Tue Apr 02, 2013 12:50 pm

How I create different events for the same sprite? I don't know how to do that otherwise than creating an different sprite, like 'EnemyIce2'. Is there other way?

You said I should create a playerBox to my enemy, right? I tried. But something went wrong, now I'm controlling the enemybox, my player and the enemy still the same.

Here is .capx file updated.

https://www.dropbox.com/s/i7srbdfw7nl4e5j/platatform-gam-new.capx

I don't know what I'm missing, you guys are helping me a lot. I hope I can get this solution soon. Thanks!
B
16
S
4
G
4
Posts: 56
Reputation: 2,942


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests