Skip to first unread message
Assigned to scottfr...@gmail.com by taifu...@gmail.com

J_Ram

unread,
Sep 14, 2014, 1:23:55 PM9/14/14
to mitappinv...@googlegroups.com


So i'm trying to build a maze game. I want to know how could i get solid walls (Block1) so when I drag the ball (player) it doesn't over lap and just go through it. I have tried using a different method, as you may see in the picture that I added. It works but the player still over laps and only moves to the x and y (the starting place) when I am no longer dragging the ball. Would someone please just tell me how to add solid walls. I would really appreciate it


Message has been deleted

Scott Ferguson

unread,
Sep 15, 2014, 4:31:37 PM9/15/14
to mitappinv...@googlegroups.com
It really depends on the relative position of Block1 to Player_ as to what your blocks should do when they collide.
Suppose Player_ is to the left of Block1 when they collide.
Then you would want to allow Player_ to move up and down or left but not right -- so you would not allow Player_.X to move right, but everything else would be OK.
Suppose Player_ is to the right of Block1.
Then you don't allow it to move left.
If Block1 can be above or below Player_ when they collide, then movement in Y will be restricted.
So check for those possibilities if necessary.
You also need to check if Player_ is NoLongerCollidingWith Block1.
If that is the case you can check that in your events or procedures to allow movement again in the direction that was previously restricted.
That is how I would approach the problem, but I have not personally tried dragging a Sprite in a maze.
---
sf

Reply all
Reply to author
Forward
0 new messages