This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-09-02 08:05:49

DarkForce1998
Scratcher
Registered: 2009-12-05
Posts: 500+

Velocity and sliding...

When it comes to velocity i just use the friction marble scripts and edit it abit. but I don't know how to reduce the length it takes for the sprite to stop.
Can anyone help?


http://i55.tinypic.com/2qw381g.png

Offline

 

#2 2010-09-02 08:10:13

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Velocity and sliding...

With the marble, I'm pretty sure it uses this method of slowing

forever
set (xvelocity) to ((xvelocity) x (.95)

or something along those lines.  In order to change the length, all you need to do is change the .95 to a slightly smaller number, until the amount of friction suits you.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2010-09-02 11:50:48

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Velocity and sliding...

Yes. The friction is controled:

[set (xvelocity) to ((xvelocity)*(.95))]

Yeah.


Hai.

Offline

 

#4 2010-09-02 12:30:23

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Velocity and sliding...

[set (xVel) to ((xVel)*(.95))]

Change the .95 to .9 at greatest (or .99, .999, etc.) and at least, it should be .1 ( or .11, .111, .1111, etc.)


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#5 2010-09-02 13:44:05

DarkForce1998
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: Velocity and sliding...

Thanks guys


http://i55.tinypic.com/2qw381g.png

Offline

 

Board footer