Bug with pause behaviour. Please help

steve86steve86 Member Posts: 806
edited November -1 in Working with GS (Mac)
Hello

I tried to implement the new pause feature but I seem to have one bug I cant quite figure out.

The thing is I have a scene with an actor and that actor moves with an offset when you touch any part of the screen that is not inside the actor. That way you can drag it without touching the actor itself.

But the thing is when I pause the game and I get the resume game or go to main menu buttons on top of the scene that was being played. when I press on either of the buttons (resume, main menu) the actor automatically moves to the position of the buttons without the obvious offset its just places itself at the position of the resume button.

Obviously this is bad for my game and I cant make the game first resume then if you touch and drag outside the actor it will start to move.. it just goes automatically to the position of the buttons in the pause screen.

So I wanted to ask if anybody had a similar problem or if you have any idea what is going on and how to solve it.

Thank you very mucho

Steve

Comments

  • ChaserChaser Member Posts: 1,453
    Give that offset a global attribute and set it to 0 when game is in play and when you hit pause it changes to 1 or resume changes it to 0. If I understood you correctly!
    Also make sure your pause button is on the top layer
  • steve86steve86 Member Posts: 806
    Thank you for your reply chaser

    I tried that and no luck. I made a global attribute that the move can only move when the attribute is 1. and when the pause button is pressed it will chance that attribute to 0 and it will not chance to 1 until the game has been restored. However I still have the same problem. I think the level restarts somehow or something like that when it tries to resume and moves the actor to a certain position.

    Any other ideas?
  • mithraweptmithrawept Member, PRO Posts: 167
    I had something similar, un-pausing would cause a click in game. This was because I'd used a mouse click event. I changed to a touch event and it worked just fine. Might be worth a try.
  • steve86steve86 Member Posts: 806
    I tried both suggestions by tshirtbooth and mith.. and no luck I placed timers, flags, tried both the change and constrain attributes and still no luck .. also made sure I have touch events and no mouse clicks

    Any other ideas? im going crazy.

    THANKS A LOT
  • DrGlickertDrGlickert Member Posts: 1,135
    I had a similar problem with my shooter game. This may help or it may make it worse;

    In my game wherever the player touches the screen the shot fires to that point. So, what I did was in the RULE; 1) when touch is pressed AND 2) When game.touches.touch1.Y > 100.

    That way, anything below the Y of 100 the player can touch but the shot won't fire. I'd imagine if your pause button is in the top right corner then you could do like touches.Y < 310 AND touches.X < 470 (In landscape mode).

    Where is your pause button? Does this sound like it'll help you?
  • steve86steve86 Member Posts: 806
    Thank you for your Response Glickert

    unfortunately my pause its right in the middle of the screen. the pause screen comes up and when the user press resume the pause screen vanish and the game continues but the actor moves :( ..

    I guess I could try to just place a little pause corner button like you suggested but I paid a designer to make me my pause scene.. and he did a great job so I really want to use it...

    worst comes to worst I don't use the new pause feature and use the workaround method like I did before the update. But I mess the entire "code" to use the new pause system and changing it all back would be a hassle..

    thanks a lot for your help thou..
  • mithraweptmithrawept Member, PRO Posts: 167
    I think I've managed to replicate your problem, steve. On your pause screen, try adding in an invisible actor, the size of the screen, behind your buttons. Hopefully, that'll work!
Sign In or Register to comment.