I'm trying to understand a text description of Blocks. The text references for Time are not clearly translating to the actual Blocks for me, still learning.
For example:
- Create Variables**
lastTapTime (number, initial value = 0)
doubleTapThreshold (number, e.g., 400 milliseconds)
-
Canvas.Touched Event Logic**
When the Canvas is touched: -
Get the current time in milliseconds (
Clock1.Now). -
Compare it with
lastTapTime. -
If the difference is less than
doubleTapThreshold, trigger your Double Tap Action. -
Update
lastTapTimeto the current time.
Example Blocks (Pseudocode)
Copy code
when Canvas1.Touched(x, y, touchedSprite): // <-- Understood
currentTime ← Clock1.Now // <-- Which blocks
if (currentTime - lastTapTime) < doubleTapThreshold: <-- Understood
// Double tap detected
call DoSomething()
lastTapTime ← currentTime <-- Not understood
Any illustrated help appreciated.