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

#1 2012-06-29 13:10:56

DoowNimajneb
New Scratcher
Registered: 2012-06-27
Posts: 65

Gravity, HELP!

Please can someone post me some simple scripts to create gravity so that it will move smoothly and not jittery. (if impossible to be simple, don't mind too much if theres a lot of blocks or scripts as long as I can understand it or you explain it to me).

Offline

 

#2 2012-06-29 13:27:05

wolfdude999
Scratcher
Registered: 2012-01-07
Posts: 1000+

Re: Gravity, HELP!

One thing that you can do is make a script in a forever loop saying that if your character is not touching the color of the ground, then you can change the y position by a number (I recommend -3).  If you want an example then you can look at my project Mirror Remade.


http://i48.tinypic.com/15yxmp4.png

Offline

 

#3 2012-06-29 17:25:05

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

Re: Gravity, HELP!

If you look up how to do color sensing and velocity, it will help a whole lot.


Hai.

Offline

 

#4 2012-06-30 02:26:53

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Gravity, HELP!

when gf clicked
forever 
if <not <touching color [#000000]?>>
change y by [-10]
This is a script for smooth gravity, if you are not touching black you will fall by -10 on the Y axis

Last edited by daniel_j (2012-06-30 02:27:12)


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#5 2012-06-30 03:16:40

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

Re: Gravity, HELP!

daniel_j wrote:

when gf clicked
forever 
if <not <touching color [#000000]?>>
change y by [-10]
This is a script for smooth gravity, if you are not touching black you will fall by -10 on the Y axis

Problem is if the ground is smaller than 10px? Or what if the OP wanted a jump script as well?


Hai.

Offline

 

#6 2012-06-30 03:21:53

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Gravity, HELP!

fg123 wrote:

daniel_j wrote:

when gf clicked
forever 
if <not <touching color [#000000]?>>
change y by [-10]
This is a script for smooth gravity, if you are not touching black you will fall by -10 on the Y axis

Problem is if the ground is smaller than 10px? Or what if the OP wanted a jump script as well?

Good point, I guess it could be transformed into the script xD


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

Board footer