if a button is not pressed issue
Bowhill Games
Member Posts: 191
Is there a.way of saying if a button isnt press for one sec then change camera position?
Currently I.have two buttons and 2 button attributes every second I set these to no and if a player touches one I set it to.yes,
A rule checks every second if.the correct button is pressed based on what is on screen if not then the camera position changes
a rule says every second if both button attributes equal no then change camera position, but it seems to change sometimes before the second is over
Basically the player needs.to.click atleast one button every second
(site currently under construction)
Comments
The problem is that you are using a timer to set the attribute to "no" every second but the player won't necessarily click/tap at exactly one second intervals. For example, let's say the player clicks at game.Time=5 and then again at game.Time=5.8. If you have an Every 1 second timer, it will reset the value at game.Time=1, 2, 3, 4, 5, 6, 7, etc. So for the player, the experience would be of clicking at 5.8 and then having the camera reset 0.2 seconds later at game.Time=6.
Instead, you need to make a REAL attribute called game.clickTime and when the player clicks you need to change game.clickTime to game.Time. When you're checking to see if a second has passed, check to see if game.Time-game.clickTime≥1. Then change the camera. You'll also want to have a change attribute behavior at the top of your rule list (but not in a rule) to change game.clickTime to game.Time so that the rule only fires when a second has passed without the player clicking. This is just for the initial setup of the scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User