Lose game when not touching actor
Santivin
Member Posts: 25
Hi, I'm making a really simple game in which you have to touch blocks and your finger will always be placed on the screen.
When you are touching one of the blocks, the game just keeps on. But when you are NOT touching a block, I need it to lose it.
So, to sum up, I need to detect if you have stopped touching a block. Or if a new one has been pressed, otherwise, you lose the game.
Thanks for your help, and sorry if my english is not too good.
Comments
When mouse button is up
.....Change scene
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
It may be stating the obvious, but also worth noting:
Be sure to have it only trigger after the mouse button has been registered as down. Could be something as simple as adding a self attribute, e.g. self.pressed, that gets triggered when the button is pressed, and adding that as a condition to the button up rule.
Or something like that. Otherwise the second rule will trigger the moment the scene starts.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Good point, @Armelline. Mouse is up only triggers after a mouse is down has occurred so if it was on the very first scene, my method would actually work but it's not too practical since if you had a scene before it with, say, a "Start" button and you click/tap it, then in the next scene the mouse is up will be registered immediately.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
In my testing just now, mouse down was not required for mouse up to trigger.
I put an actor on the only scene in the project, added a mouse up rule and put a display text inside it. The display text triggered immediately with no interaction. Adding the extra rule as described above made it respond as expected.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Hmm... if I add an actor with When Mouse is Up... Display Text, it doesn't display until I've clicked and released the mouse button. But regardless, your method is better!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
See my edit That's really weird
There must be a difference somewhere in what we did
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thanks a lot!
Hey! Everything went fine, when I touch and release an actor it does what it has to do. However, if i place my finger outside the actor called "Bubble", nothing happens. I need the game to go to the next scene if that happens (game over), unless if a new actor is being pressed (the same type of actor as the one named before, another bubble)
anybody?