5 Replies Latest reply on Aug 19, 2006 12:30 PM by kglad

    maze game

    nardove Level 1
      hi there

      i need to do a maze game using the mouse to drag and find the exit, the problem i have is the walls, dont know what to do whit them i got something wornking but when you got to a wall the object stops mving and thas fine but it looks like it sticks to te wall, any ideas

      i think the best thing to do is to restric the movement of the player to a invisible guide so when you press the object, just move on top of that guide but i have no idea how to do that!!!

      thanks
        • 1. Re: maze game
          kglad Adobe Community Professional & MVP
          while the dragged object is in contact with a wall you should check if a dragOut occurs. if it does, execute a stopDrag() and have your object rebound off the wall.
          • 2. Re: maze game
            nardove Level 1
            how can i show what i got?

            do you have 5 min to look at it?
            • 3. Re: maze game
              kglad Adobe Community Professional & MVP
              you can post your relevent code here, but try and limit the code to just the relevent portions.
              • 4. Re: maze game
                nardove Level 1
                function movePlayer(instance, checkInstance) {
                instance.onPress = function() {
                instance.onEnterFrame = function() {
                checkInstance._x = _root._xmouse;
                checkInstance._y = _root._ymouse;
                if (route.hitTest(checkInstance._x, checkInstance._y, true)) {
                instance._x += (checkInstance._x-instance._x)/5;
                instance._y += (checkInstance._y-instance._y)/5;
                } else {
                //delete instance.onEnterFrame;
                }
                };
                updateAfterEvent();
                };
                instance.onRelease = function() {
                delete instance.onEnterFrame;
                };
                }
                movePlayer(player, player_area);
                • 5. Re: maze game
                  kglad Adobe Community Professional & MVP
                  is your player stationary and you're moving the maze? if player is moving, where's the code to move player and what's player_area? what's route?