How do I avoid getting stuck on corners of walls.

0 favourites
  • 6 posts
  • I had a similar issue awhile back, but I was getting stuck on walls. Now the disk is sliding down the walls just fine, but it's getting stuck on the corners of the walls.

    I don't get it. I tip the phone to the right, the disk goes to the right, but if it hits the corner of a wall it gets stuck and I have to tip the phone in a different direction and then right again to get it unstuck.

    I want it to work like it does in real life. If I had a disk on a board and tipped it to the right, it would slide into a corner of a wall, it may stop, but it would slide off to the side and keep sliding.

    I expect it to slow down (though I wish it wouldn't), maybe bounce off to the side, but it gets stuck.

    Like I said I can get it unstuck by tipping the phone in a different direction and then back to the right to get it moving again, but that's not going to work for the game.

    How do I get it to slide off the corner and keep going in the right direction and not get stuck?

    Video Example:


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can try adding more points to collision polygons on the wall corners, to make them more rounded. And also to the player sprite to make it more circle shaped (ignore the warning about too many points).

    If this doesn't help, I would suggest switching to Physics. Set collision shape="Circle" for the player sprite and apply force in the direction you want it to move. It should go through corners much smoother.

  • dop2000

    Thank you for the reply.

    Well, I added a bunch of collision points to no avail then attempted to use physics - also a no go. So I decided to add the bullet behavior and bounce the darn things off the walls and make it part of the game lol I can't beat'm so I'm going to join them.

  • Try this:

    It works much better in my tests.

    I would also suggest improving controls, making them analogue. Instead of "simulate control" action, use "Set vector" actions, applying more speed if the phone is tilted more.

    Physics also should work quite well, check out this demo I made some time ago:

  • dop2000

    Thank you - Offset! Have to learn that.

    Also, another cool demo. Seriously Dude, you need to let me build a site for these.

  • I finally did it! Posted all my example projects in one place:

    I would prefer to continue hosting the files on my Dropbox, this way I will be able to update them.

    If you still want to create demos for some of these projects - this would be cool! I will add your links to the post.

    Not all projects are worth making demos of course, you can pick the ones you like.

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