Drawing with finger - how to avoid going through walls?

ancchancch Member, PRO Posts: 103
edited November -1 in Working with GS (Mac)
I can move my actor around with my finger with the constrain attribute command (self.position = touches.x and y). I also programmed actor to collide with a wall.

The actor stops correctly at the wall if my finger movement is slow. But if my finger movement is fast ie I swipe the actor across the wall, the actor goes right through the wall.

How can I prevent the actor from being swiped past a wall?

Comments

  • RattleheadRattlehead Member Posts: 485
    I'm having the same problem with one of my projects which in turn is preventing me from completing it...

    I have a boolean called DragAndDrop (which you can see in a ton of samples here) and I set it to false on overlapping these boundaries but it doesn't seem to catch it if you swipe over it too quickly.

    Some thoughts came to mind today though that I might try tonight:

    1) All of my 'walls' are basically the borders of the screen to prevent actors from going out of bounds. I am going to try making them extremely wide/deep to see if that prevents them from passing through.

    2) On overlap, see if I can force actor to go in the reverse direction of the swipe so it drops right outside my boundary. Again it could be when the collision is determined that causes me grief.

    But try those and see what happens.

    Good luck!
  • UPUP Member Posts: 70
    Haven't found a solution to the same problem myself either...
    But it's been bother me quite a bit, kinda discouraging to continue my project!!

    Making the walls thicker didn't work for me though...
    (but maybe I didn't make them thick enough, I didn't go crazy on them)

    Since it seems a problem for others as well I do feel more triggered to give it another go...
    Let's see...
  • RattleheadRattlehead Member Posts: 485
    Yeah, ain't it great when you know you aren't suffering alone? :)

    I'll try and give my ideas a go in the next day or so and if something works, I'll be sure to post it.
  • CrazybreadmanCrazybreadman Member Posts: 674
    ditto... I scrapped a project a while back for the same reason. Haven't messed w/ it lately, but I hope there's a reliable solution out there though.
Sign In or Register to comment.