Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How would I go about making command inputs?
- sprands
- Scratcher
100+ posts
How would I go about making command inputs?
two types i'm talking about specifically:
forward + forward (double tap to do the input)
down + forward + punch (quarter-circle forward + punch / fireball motion)
forward + forward (double tap to do the input)
down + forward + punch (quarter-circle forward + punch / fireball motion)
16
i don't use this website
- sprands
- Scratcher
100+ posts
How would I go about making command inputs?
no, they aren't buttons on screen. i'm talking about keyboard inputs. You should to share the project.
What are those commands? buttons on screen?
16
i don't use this website
- JC20092009
- Scratcher
500+ posts
How would I go about making command inputs?
Here’s how to detect double-taps.
when this sprite clicked
set [SpriteClicked v] to [true]
broadcast [SecondTap v]
when I receive [SecondTap v]
broadcast [Command v]
- JC20092009
- Scratcher
500+ posts
How would I go about making command inputs?
Use the “if touching mouse-pointer” to detect the second tap. Hope this helps!
- Oumuamua
- Scratcher
1000+ posts
How would I go about making command inputs?
Double tap involves a time limit between keystrokes.
Since you have different key combinations i´d say that reset timer to measure time could be problematic.
I recommed you to create some variable e.g. for foward+foward one var, lets say “first foward” at first keystoke set to timer so you can check, when you press the key again, if timer minus “first foward” is less than 0.1 validates the double tap.
I hope you understand what i mean.
Since you have different key combinations i´d say that reset timer to measure time could be problematic.
I recommed you to create some variable e.g. for foward+foward one var, lets say “first foward” at first keystoke set to timer so you can check, when you press the key again, if timer minus “first foward” is less than 0.1 validates the double tap.
I hope you understand what i mean.
- Discussion Forums
- » Help with Scripts
- » How would I go about making command inputs?