Hello there, I was trying to see if I can press the button twice and something would happen with a single button
I looked at the extension below:
It really helped me but I wonder if there is one for a sprite
I want my app to be able to double click a sprite and found no results of that
A double click is like a click, with an associated memory of when the last click happened on that Sprite, and some click logic to decide if it happened within the last n milliseconds (n is the twitch factor).
Set a global variable example click to 0. When you tap on the sprite it increases by 1. If the variable is equal to 2 your touch performs the action and the variable returns to 0.
Thank you
you need to consider the tap intervals, and if you are tapping same imageSprite.
Thanks for this working effort but I got it to work and then its not letting me double click look at my app
Sprite_Click.aia (9.7 KB)
What it should do is let you drag it around and if you click it twice then it takes you to the next screen. It should not count as clicking when you drag the sprite.
Your two timer scheme is too complicated for me.
The second clock always runs.
Bothe timers are super fast (3 ms, 1 ms).
You never update the global variable that those timers check with any sprite interactions.
Do you want me to make this code again
You don't need to please me.
It's your project.
However, in general there are lots of different ways to code solutions.
I stick to the simplest ones personally.
If you don't want to move the sprite, why do you have blocks that move the sprite?
I want the sprite to move.
I need it to be like to tell if the sprite is being dragged or not because I tried to click it and it thinks I am dragging it. It could be like telling them from each other
The drag event should be the only event to move the sprite, if that's how you want to move the sprites.
You can put logic in the dragged event to compare the distance between where the drag started and the current location on the Canvas, to distinguish between a shaky touch and an intentional drag. Decide on a minimum drag distance, perhaps a proportion of the canvas size.
Can you tell me a screenshot of what it should look like
from
It's called the Sprite Cannibalism solution.
Can I get a code like if the sprite is being held down for 3 seconds then do the next step