Touch screen, pause game, how do you differentiate?
DrGlickert
Member Posts: 1,135
So i have a game where the player touches the screen to fire a shot. I also have a pause game button that the player touches to pause the game. How do I get it so that the player touches the pause button but WON'T fire a shot as well?
It wouldn't be a big deal but the shot's are calculated and points are awarded based on shots, etc etc. So i kind of have to have the shot NOT FIRE when the pause button is pressed...
It wouldn't be a big deal but the shot's are calculated and points are awarded based on shots, etc etc. So i kind of have to have the shot NOT FIRE when the pause button is pressed...
Comments
That should disable everything else in the game when you press the pause button and not trigger anything else
Then in the pause have when touch is pressed and inside change pause to true
that should trigger the pause first and disable the fire before it has a chance to fire
RULE #1
- mouse button down
(NESTED) Rule #2 - When ANY are true:
- Device.Touch1.Position.X is > 30
- Device.Touch1.Position.Y is < 290
DO FIRE BEHAVIOR
This example would be for a landscape screen and leaves the 30x30 section of pixels at the top left corner for pressing the pause button. Any press outside that corner would trigger the fire behavior. You'll need to modify this depending on the size of your pause button, which you can just calculate.
Dave