Player going trough solid objects

  • I created my first game in construct 2 but I am having some serious problems at the moment...

    the capx is here dropbox.com/s/maystovkesrtldl/asdf.capx

    My first problem is that sometimes my player seems to teleport from 1 end to the other of the obstacles and this makes the game pretty annoying...

    The other one is that when going outside the screen the objects do 2 things:either dissapear when they hit the end of the screen either go smooth until you can't see them.

    Hope you guys can help me :)

  • Bugasebi

    To fix the destruction of blocks outside the layout, use the built in behavior for that. For the blocks, assign the "DestroyOutsideLayout" behavior.

  • Bugasebi

    When you apply that behavior to the blocks, you'll see that they are still dissappearing too soon before they have completely exited the screen. Slow down the speed if you need to so you can clearly see the point at which they disappear. The program is using the "image point" to determine when the object has left the screen and the image points are set for the middle of the blocks.

    To fix this, change the "image point" from the current location which is the center of the block and change it to the far right edge.

  • Bugasebi

    Lastly, you'll notice that the blocks are not appearing cleanly from the right hand side. They aren't smoothly coming onto the screen.

    Fix this by changing the spawn point from x=630 to x=730. Since we changed the image points, the objects need to be pushed to an earlier starting point.

    But if you do this, they won't appear on the screen at all. Cause the layout is only 630 wide so they are destroyed instantly.

    Change the layout width to 730 minimum.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you,I forgot about the image origin and did not even thinked about the layout size :)

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