Discuss Scratch

Hinderwoods
Scratcher
45 posts

How do you create "smooth" movement in Scratch?

I'm talking about movement that looks natural and not robotic.
jamy_hensley
Scratcher
100+ posts

How do you create "smooth" movement in Scratch?

You need more costumes.
Prscr
Scratcher
100+ posts

How do you create "smooth" movement in Scratch?

Hinderwoods wrote:

I'm talking about movement that looks natural and not robotic.
Use this block:

ScratchSomebodyIDKthisIsReallyPrscrLOL wrote:

glide1secstox:0y:0

Last edited by Prscr (April 4, 2016 03:41:09)

zp100
Scratcher
100+ posts

How do you create "smooth" movement in Scratch?

What do you mean? Moving across the Stage? You can use this block:
glide1secstox:0y:0
or this script:
setrotationstyledon't rotatepointtowardsspriterepeatuntiltouchingsprite?move3stepssetrotationstyleall around
to accomplish smooth gliding.

Or, do you mean walking movements? If you're using these blocks:
whenright arrowkeypressedmove5steps
whenleft arrowkeypressedmove-5steps
then it can look pretty weird. To fix this, use this script:
whenclickedforeverifkeyright arrowpressed?thenmove4stepsifkeyleft arrowpressed?thenmove-4steps

Hope this help!
gtoal
Scratcher
1000+ posts

How do you create "smooth" movement in Scratch?

Hinderwoods wrote:

I'm talking about movement that looks natural and not robotic.

When you start moving, don't jump straight to the target speed - start at 0 and ramp the speed up.

When you stop, decelerate rather than stopping dead. You might even want to overshoot a tiny bit and bounce back to the final position (for example the second hand of a watch might do this)

It's all about modelling expectations and usually that comes from modelling the physics involved since people are familiar with how real objects move.

If you're following a path, don't turn corners sharply - fit some sort of spline to your path and follow the spline with constant linear velocity.

Keep the derivative of the speed smooth.

G

Hinderwoods
Scratcher
45 posts

How do you create "smooth" movement in Scratch?

gtoal wrote:

Hinderwoods wrote:

I'm talking about movement that looks natural and not robotic.

When you start moving, don't jump straight to the target speed - start at 0 and ramp the speed up.

When you stop, decelerate rather than stopping dead. You might even want to overshoot a tiny bit and bounce back to the final position (for example the second hand of a watch might do this)

It's all about modelling expectations and usually that comes from modelling the physics involved since people are familiar with how real objects move.

If you're following a path, don't turn corners sharply - fit some sort of spline to your path and follow the spline with constant linear velocity.

Keep the derivative of the speed smooth.

G

Thank you
nickwasp
Scratcher
100+ posts

How do you create "smooth" movement in Scratch?

if you want a sort of momentum effect you can use this
whenclickedforeverifkeyrightpressed?thenchangeXvby1ifkeyleftpressed?thenchangeXvby-1setXvtoXv*0.8//anynumberlessthen1willwork
Hinderwoods
Scratcher
45 posts

How do you create "smooth" movement in Scratch?

nickwasp wrote:

if you want a sort of momentum effect you can use this
whenclickedforeverifkeyrightpressed?thenchangeXvby1ifkeyleftpressed?thenchangeXvby-1setXvtoXv*0.8//anynumberlessthen1willwork
Ok
zp100
Scratcher
100+ posts

How do you create "smooth" movement in Scratch?

Oh! That kind of movement. Check out this tutorial for realistic jumping and acceleration, along with everything else for character movement.
raineoden
Scratcher
78 posts

How do you create "smooth" movement in Scratch?

Are you talking about platforming? cuz then you can do it by the post above me by @Hinderwoods!
whenclickedforeverimagineprogramshareend
Hinderwoods
Scratcher
45 posts

How do you create "smooth" movement in Scratch?

zp100 wrote:

Oh! That kind of movement. Check out this tutorial for realistic jumping and acceleration, along with everything else for character movement.
Thank you!
Vinny_0
Scratcher
12 posts

How do you create "smooth" movement in Scratch?

Try

whenclicked
foreverifkey Dpressed?thenrepeatuntilnotkey Dpressed?changexby5

Last edited by Vinny_0 (April 6, 2016 00:18:38)

Hinderwoods
Scratcher
45 posts

How do you create "smooth" movement in Scratch?

Vinny_0 wrote:

Try

whenclicked
foreverifkey Dpressed?thenrepeatuntilnotkey Dpressed?changexby5
This isn't smooth, but thanks for the help anyway.
ethanbros
Scratcher
41 posts

How do you create "smooth" movement in Scratch?

Hinderwoods wrote:

I'm talking about movement that looks natural and not robotic.
If you want a sliding sprite that goes slower as it gets closer to a point, try this:
defineslidetox:xy:ywithdivisionofdividerepeatuntilroundxposition=xandroundyposition=ychangexbyx-xposition/dividechangeybyy-yposition/dividegotox:xy:y
If you want to make it simply glide to a position at a constant speed, just use this block.
glide1secstox:0y:0
If you want to make, let's say, controls for a top-down game, use this:
whenclickedforever. . .ifkeyup arrowpressed?changeyby5ifkeydown arrowpressed?changeyby-5ifkeyleft arrowpressed?changexby-5ifkeyright arrowpressed?changexby5. . .
That's all I can tell you.
MCSniper
Scratcher
2 posts

How do you create "smooth" movement in Scratch?




use these frames for talking when smooth

Last edited by MCSniper (Aug. 21, 2016 23:37:47)

JavierR100
Scratcher
500+ posts

How do you create "smooth" movement in Scratch?

Smooth moving? Where?
Heres is, only with 3 operators blocks (on each command block inputs).
whenclickedforevergotox:mousex/2+xposition/2y:mousey/2+yposition/2elsesayHope this works!
Harakou
Scratcher
1000+ posts

How do you create "smooth" movement in Scratch?

MCSniper wrote:




use these frames for talking when smooth
Please make sure that your posts are on topic.

Closing this thread since it's quite old.

Powered by DjangoBB