I'm making a maze game but I'm having a bit of trouble. When you hit the walls you are sent to a different frame where it tells you that you have lost, here is the code for that:
if (Wall.hitTest(Player._x, Player._y, true)) { gotoAndStop(2); }
That works fine, it's just the restart button I can't get working, I click on it and nothing happens, here is the code:
Well, since I am only familiar with Object Oriented Programming, I'm not sure if using the this keyword inside of a function inside of root will refer to root or the player.
Try changing this to Player_mc and see if it makes any difference.
Or perhaps try this: //Check If It Touches The Wall if (Wall_mc.hitTest(Player_mc._x, Player_mc._y, true)) { Player_mc._x = 0 //Or wherever the player starts out. Player_mc._y = 0 //Or wherever the player starts out gotoAndStop(2); }
So that is saying it isn't paused, what code do I put to make it paused and how do I make it become paused if I say.. push the "P" button on the keyboard?
if(Pause == false) { All the code for moving and etc }
@Maaron: Well, you could either make the Menu on a new keyframe and disable all the movement buttons and stop the timer(if there is one)...or you could have the menu, invisible during game play, on a different layer and disable everything movement and timer... Just two ways I quickly thought of...there's probably other ways...but it should work
@Ricador: lol...yea...once you make something cool, you'll get somewhat obsessed with it :P