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

#1 2010-11-24 20:55:12

gregorius0100
Scratcher
Registered: 2010-11-21
Posts: 1

how do you make gravity?

i downloaded a character frum someone else that had gravity but it looked complicated so how do you make it?

Offline

 

#2 2010-11-24 20:59:26

ScratchGirl100
New Scratcher
Registered: 2010-08-17
Posts: 25

Re: how do you make gravity?

http://wiki.scratch.mit.edu/wiki/Simulating_Gravity

Try here.  smile

I apologize, as a New Scratcher I can't post clickable links  tongue


http://i55.tinypic.com/s4c9z9.gif

Offline

 

#3 2010-11-25 07:59:41

PlutoIsHades
Scratcher
Registered: 2010-10-18
Posts: 1000+

Re: how do you make gravity?

See if you can get the gravity marble.  Idk, there might be gravity scripts in there.  Idk.  =P


Minecraft, Redwall, and Cyberchase fan, and PROUD.

Offline

 

#4 2010-11-25 09:38:43

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

Re: how do you make gravity?


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#5 2010-11-27 16:49:42

Robot_Maniac
Scratcher
Registered: 2010-11-22
Posts: 56

Re: how do you make gravity?

Hm... this sounds so complicated.


Math Trick of the Week: Choose any three digit number that's one digit is at least 2 less that the tens digit and the tens digit at least 2 less than the hundreds. Then, reverse the digits and subtract. Then, reverse the digits in the answer and add. You should get 1089.

Offline

 

#6 2011-01-02 20:23:14

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: how do you make gravity?

I made this a while back to explain a ball bouncing off of walls.  Look at the y-velocity part for the gravity.

Summary: When the ball isn't touching the ground, a variable called "y-velocity" changes by -0.1.  If the ball is touching the ground, y-velocity is set to a positive number (the bouncing part).  The balls Y-position is forever changing by y-velocity.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#7 2011-01-02 20:59:48

GirWaffles64
Scratcher
Registered: 2009-08-09
Posts: 1000+

Re: how do you make gravity?

ScratchGirl100 wrote:

http://wiki.scratch.mit.edu/wiki/Simulating_Gravity

Try here.  smile

I apologize, as a New Scratcher I can't post clickable links  tongue

Are you sure? Doing this doesn't work?

Code:

[url]http://wiki.scratch.mit.edu/wiki/Simulating_Gravity[/url]

hey kiddoes i'm back

Offline

 

#8 2011-01-03 02:04:05

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: how do you make gravity?

first you need to know how to simulate velocity:
vars: xvelocity(xv) yvelocity(yv)

always change x position by xv and y position by yv

then just apply a constant force in whatever direction you want

for down just change yv by -1 in a forever loop

IF you wan to get fancy and do friction just set xv to xv*0.98 (or by a lower decimal for more friction) & just do the same for yv          wink

Last edited by 14God (2011-01-03 02:06:44)


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#9 2011-01-05 18:17:35

anion
Scratcher
Registered: 2009-09-26
Posts: 32

Re: how do you make gravity?

<when green flag clicked><forever if><<  <not><touching color[green              ><change y by(5>


http://mushroomsock.dragonadopters.com/dragonanimated_751621.gif

Offline

 

Board footer