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

#1 2010-02-19 16:41:40

sticky532
Scratcher
Registered: 2009-06-07
Posts: 11

How To...

does anyone know how to make gravity on scratch?

Thanks!

-Sticky532

Offline

 

#2 2010-02-19 16:50:17

Greenboi
Scratcher
Registered: 2010-01-30
Posts: 1000+

Re: How To...

What kind?

Velocity?

Offline

 

#3 2010-02-19 23:04:22

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Re: How To...

There's "gravity Cat" as one of the "Animal" sprites built-in to Scratch.

With Scratch open, just click to find a new sprite in a file, choose Animals, then go down right past the "grasshopper" to Gravity Cat.

It comes with two ready-made scripts for making Cat bounce high in the air, then lower, then lower....as gravity takes effect.

Maybe you could modify those scripts to meet your needs....  smile

Offline

 

#4 2010-02-19 23:56:32

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How To...

Here's a simple falling script with velocity - you can edit it to your needs. Here's the script:

http://img7.imageshack.us/img7/5121/50asimplefallingscriptw.png

It's simple. There are two steps: The variable increases, and then the sprite changes its Y by the variable amount.

Any questions?


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#5 2010-02-20 00:39:07

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: How To...

You could always import the gravity marble and look at its scripts.


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#6 2010-02-20 18:08:22

sticky532
Scratcher
Registered: 2009-06-07
Posts: 11

Re: How To...

Thanks Everyone!

If anyone has any other questions, put them here!

--Sticky532

Offline

 

#7 2010-02-21 10:52:22

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How To...

sticky532 wrote:

Thanks Everyone!

If anyone has any other questions, put them here!

--Sticky532

Oh in that case my TD game has 2 glitches that MUST be fixed before I go on. More details here: http://scratch.mit.edu/forums/viewtopic.php?id=31018


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#8 2010-02-21 11:11:07

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: How To...

Jonathanpb wrote:

Here's a simple falling script with velocity - you can edit it to your needs. Here's the script:

http://img7.imageshack.us/img7/5121/50a … criptw.png

It's simple. There are two steps: The variable increases, and then the sprite changes its Y by the variable amount.

Any questions?

I have a problem with your gravity script: this script will make the sprite accelerate faster and faster until it hits the ground. you need an if command in there to create a TERMINAL VELOCITY.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#9 2010-02-21 11:23:23

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How To...

sparks wrote:

Jonathanpb wrote:

Here's a simple falling script with velocity - you can edit it to your needs. Here's the script:

http://img7.imageshack.us/img7/5121/50a … criptw.png

It's simple. There are two steps: The variable increases, and then the sprite changes its Y by the variable amount.

Any questions?

I have a problem with your gravity script: this script will make the sprite accelerate faster and faster until it hits the ground. you need an if command in there to create a TERMINAL VELOCITY.

Not exactly easy to do with scratch, where you need sprites to check collisions (can't just check a coordinate)


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

Board footer