Random Actor/gameover help
krewic gaming
Member, PRO Posts: 19
Hey Gamesalad community,
I am currently developing a game that requires an actor to be tapped before a timer of three seconds is reached. after the actor is selected one of 5 actors needs to be selected randomly. When you tap the random actor the score goes up and the timer gets reset but there is no indication that a new actor is selected.
Also, when I get a game over and set up a retry button to reset the scene the scene freezes up with the retry button stuck in one place, instead of disappearing like it is supposed to.
I would really appreciate some help with this as I would like to release this game within two weeks
thanks,
KREWIC GAMING
Comments
What is your question?
Can you post a screenshot of your rules for this? You'll need to upload the image to a file-sharing service and then post/embed the link here.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang thanks for replying! My game involves quickly tapping an actor before a timer runs out. The way I have tried to set that up is as following
If game over is false
If game.pickactor = (number assigned to the five actors)
if touch is pressed
do
change attribute game.time (the timer I am using) to 3
change attribute game.score to game.score +1
change attribute game.pickactor to random(1,5)
everything works accept that last part which controls which actor you need to tap next in order to score again. I am trying to figure out what exactly I am missing or if maybe I just typed it wrong.
Thanks,
KREWIC GAMING
One possible problem is that you are choosing a random value for game.pickactor and setting up rules to check for that value but if the same random value is chosen two times in a row, the rule won't trigger the second time. Rules in GameSalad only trigger when their condition changes from false to true. So the rule that says If game.pickactor=2, for example, will be false when the scene starts -- assuming game.pickactor=0, then true when game.pickactor becomes 2, but if game.pickactor is chosen to be 2 again the rule won't trigger because it was already true.
I have a demo that addresses this issue: http://forums.gamesalad.com/discussion/comment/513319/#Comment_513319.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang Wow I hadn't thought of that. But the way I have it set up when you tap whichever was selected it should automatically selects another one. Could it be that game.pickactor is only associating itself with one number?
You're saying that if game.pickactor is 2 and you tap on the actor representing 2, it will choose a random value from {1,3,4,5}?
You mean that it only has a single, unchanging value? It's possible. The only way to know for sure is to use a Display Text or Log Debugging Statement to watch the value of it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang Hey I really appreciate the help. I used set up a way to monitor game.pickactors progress and it changes to zero. I havent set up any rules for it to change to zero but I suppose I could try just changing one of the corrosponding numbers of game.pickactors to 0-4 to compensate. Another problem I ran into is that I set up the background to change game.gameover to true whenever tapped but if an actor that is supposed to be tapped to change the score is tapped the game ends anyway because the background is registering the tap as well. Any way around this one? thanks again.
There are a few threads related to ignoring overlapping actors when clicking. This seems to be the opposite of what you want but it might provide some insights:
http://forums.gamesalad.com/discussion/86882/pressed-and-two-overlapping-actor
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User