dash
Problem it solves
Your player presses a dash button and you want a burst of horizontal speed followed by a cooldown pause before next use.
What this block does
Adds velocity to the sprite along the X-axis and pauses execution for the cooldown duration.
The block
Block ID: retro_dash_cooldown
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | Player | The sprite performing the dash. |
| speed | number | 100 | Additional horizontal velocity to add. |
| cooldown | number | 500 | Cooldown pause time in milliseconds. |
Example
let hero = sprites.create(img`.`, SpriteKind.Player) Retro.dashCooldown(hero, 100, 400)
Add the extension
Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.