Discuss Scratch

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)

16
i don't use this website
Oumuamua
Scratcher
1000+ posts

How would I go about making command inputs?

You should to share the project.
What are those commands? buttons on screen?


sprands
Scratcher
100+ posts

How would I go about making command inputs?

Oumuamua wrote:

You should to share the project.
What are those commands? buttons on screen?
no, they aren't buttons on screen. i'm talking about keyboard inputs.

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.


Powered by DjangoBB