Collision might be not working properly

0 favourites
  • 7 posts
  • Collision might be not working properly, or I'm missing something.

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


    Edit: If you prefer, I uploaded the game here:

    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 tutorial.

    Here are the screenshot of my animations and my events.


    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?

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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.

  • 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

  • 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.

    I don't know what I'm missing, you guys are helping me a lot. I hope I can get this solution soon. Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)