Learning MITAI and trying to translate text block references to the actual Blocks

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:

  1. Create Variables**

lastTapTime (number, initial value = 0)
doubleTapThreshold (number, e.g., 400 milliseconds)

  1. Canvas.Touched Event Logic**
    When the Canvas is touched:

  2. Get the current time in milliseconds (Clock1.Now).

  3. Compare it with lastTapTime.

  4. If the difference is less than doubleTapThreshold, trigger your Double Tap Action.

  5. Update lastTapTime to 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.

4 posts were merged into an existing topic: Help, how do I use Canvas to count Double-Touch, blocks look right but not working?