i downloaded a character frum someone else that had gravity but it looked complicated so how do you make it?
Offline
http://wiki.scratch.mit.edu/wiki/Simulating_Gravity
Try here.
I apologize, as a New Scratcher I can't post clickable links
Offline
See if you can get the gravity marble. Idk, there might be gravity scripts in there. Idk. =P
Offline
Hm... this sounds so complicated.
Offline
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.
Offline
ScratchGirl100 wrote:
http://wiki.scratch.mit.edu/wiki/Simulating_Gravity
Try here.![]()
I apologize, as a New Scratcher I can't post clickable links![]()
Are you sure? Doing this doesn't work?
[url]http://wiki.scratch.mit.edu/wiki/Simulating_Gravity[/url]
Offline
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
Last edited by 14God (2011-01-03 02:06:44)
Offline