Discuss Scratch
- The_Imaginarium
-
1000+ posts
Smooth walking
A boolean in a number input will return 1 if true, 0 if false.Use this:
Tip- use as few hat blocks as possible.
Can you explain how that works? What are the numbers of the arrow keys for the subtraction to work? Im not a keyboard engineer but im curious.
Its the bolean isnt it. Key presses is 1 not pressed is 0.
Last edited by The_Imaginarium (April 30, 2021 10:56:56)
- bluedragon8633
-
1000+ posts
Smooth walking
Yeah, if you're pressing the right key, you get 1. If you aren't, it's 0. If you are pressing the left key but not the right, it'll be (0-1), or -1. If neither key is pressed, it's (0-0), or no movement. You can also put a multiplication thing around it so that you move faster than just 1 pixel per frame. It's the same as this:Use this:
Tip- use as few hat blocks as possible.
Can you explain how that works? What are the numbers of the arrow keys for the subtraction to work? Im not a keyboard engineer but im curious.
Its the bolean isnt it. Key presses is 1 not pressed is 0.