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

#1 2012-07-18 23:26:23

The_Scratch
Scratcher
Registered: 2012-04-19
Posts: 100+

Natural gravity

So, Im making this game and I have gravity HALF figured out. I figured out how to get him to fall down after jumping, but what if he isn't touching any ground? I want him to fall, but if I make some codes I've already tried, it disables jumping! Please help!


Little known fact. You are acting cray cray.
http://24.media.tumblr.com/tumblr_mc0udwsMCj1r3l41yo1_400.gif

Offline

 

#2 2012-07-18 23:28:31

Appletini
New Scratcher
Registered: 2012-07-18
Posts: 23

Re: Natural gravity

This should help.  wink

Offline

 

#3 2012-07-18 23:37:29

The_Scratch
Scratcher
Registered: 2012-04-19
Posts: 100+

Re: Natural gravity

I tried it, but an arrow key had to be clicked for it to activate and whenever it touched my ground, it would bounce up then sink down, bounce up, sink down!


Little known fact. You are acting cray cray.
http://24.media.tumblr.com/tumblr_mc0udwsMCj1r3l41yo1_400.gif

Offline

 

#4 2012-07-19 05:04:17

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Natural gravity

Found this as a Report - I think it's probably a post

The_Scratch wrote:

I tried it and he kind of... bounced up and down when touching the ground. Here, I'll upload what I have so far (minus the new scripts you gave me) and tell me what scripts you think I should use okay?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#5 2012-07-19 10:50:18

The_Scratch
Scratcher
Registered: 2012-04-19
Posts: 100+

Re: Natural gravity

@paddle2see yeah your right I clicked report thinking it said reply, because I dont use this forum, im used to a different forum where the reply is where the report is.


Little known fact. You are acting cray cray.
http://24.media.tumblr.com/tumblr_mc0udwsMCj1r3l41yo1_400.gif

Offline

 

#6 2012-07-19 10:57:54

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Natural gravity

So the problem is that the player is bouncing? This is usually because 1 script is telling the player to fall with gravity and another telling the player to stand on the ground, giving a bouncing effect. You need to disable gravity whilst the player is in contact with the ground, or if you're aiming for an ultra-realistic effect then add an extra normal contact force (ncf) from the ground on the player equal to mass x acceleration due to gravity, so weight = ncf and resultant force = 0, thus the player doesn't bounce and remains still under balanced forces. When the player jumps, the ncf is removed and gravity will slow the player and bring them back to ground.


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#7 2012-07-19 11:31:34

The_Scratch
Scratcher
Registered: 2012-04-19
Posts: 100+

Re: Natural gravity

@Prestige heres my test test project you can download then tell me what scripts to fix/add/delete http://scratch.mit.edu/projects/TheScratchTest/2684378


Little known fact. You are acting cray cray.
http://24.media.tumblr.com/tumblr_mc0udwsMCj1r3l41yo1_400.gif

Offline

 

#8 2012-07-20 14:22:55

iNKGaming
New Scratcher
Registered: 2012-07-18
Posts: 18

Re: Natural gravity

Something to point out, too, is that something can  appear to "bounce" on the ground in the regular view, but when uploaded, or in full-screen, the character stops bouncing. I'm not entirely sure what stop this from happening, but it makes elimination of the bouncing effect and precise stopping far easier.

- iNK

Offline

 

#9 2012-07-20 14:38:07

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Natural gravity

iNKGaming wrote:

Something to point out, too, is that something can  appear to "bounce" on the ground in the regular view, but when uploaded, or in full-screen, the character stops bouncing. I'm not entirely sure what stop this from happening, but it makes elimination of the bouncing effect and precise stopping far easier.

- iNK

This is because the online players and Presentation Mode only update at the ends of loops or at waits in forever loops.  smile


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#10 2012-07-20 17:11:08

The_Scratch
Scratcher
Registered: 2012-04-19
Posts: 100+

Re: Natural gravity

Ok so are you gonna talk about bouncing or help me? I dont mean to get angry but I think this might be my best game yet!

when gf clicked
help me!!!


Little known fact. You are acting cray cray.
http://24.media.tumblr.com/tumblr_mc0udwsMCj1r3l41yo1_400.gif

Offline

 

#11 2012-07-21 06:02:45

Javster
Scratcher
Registered: 2011-10-09
Posts: 23

Re: Natural gravity

Paddle2See wrote:

Found this as a Report - I think it's probably a post

The_Scratch wrote:

I tried it and he kind of... bounced up and down when touching the ground. Here, I'll upload what I have so far (minus the new scripts you gave me) and tell me what scripts you think I should use okay?

LOL!!!


Knowledge is knowing the tomato is a fruit. Wisdom is not putting it in a fruit salad.

Offline

 

#12 2012-07-21 06:10:11

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Offline

 

#13 2012-07-26 11:39:09

The_Scratch
Scratcher
Registered: 2012-04-19
Posts: 100+

Re: Natural gravity

This doesn't benefit me in any way berberberber, does it fall when you are above a gap?


Little known fact. You are acting cray cray.
http://24.media.tumblr.com/tumblr_mc0udwsMCj1r3l41yo1_400.gif

Offline

 

#14 2012-07-26 16:22:27

Take2
Scratcher
Registered: 2012-07-25
Posts: 29

Re: Natural gravity

The_Scratch wrote:

This doesn't benefit me in any way berberberber, does it fall when you are above a gap?

Yes, it does. When you jump up, you fall.  wink

Offline

 

#15 2012-07-26 17:47:18

The_Scratch
Scratcher
Registered: 2012-04-19
Posts: 100+

Re: Natural gravity

@Take2, I already know how to do that!!!!! I need to know how to get it to fall when theres a gap!


Little known fact. You are acting cray cray.
http://24.media.tumblr.com/tumblr_mc0udwsMCj1r3l41yo1_400.gif

Offline

 

#16 2012-07-30 20:26:13

shrey15
Scratcher
Registered: 2011-06-18
Posts: 13

Re: Natural gravity

I found a project online that shows a script that creates gravity so that a sprite falls when it is not touching the ground. This should make the sprite fall through the gap. Here is the link:
http://scratch.mit.edu/projects/kizel623/286336

Hope this helps.

Last edited by shrey15 (2012-07-30 20:26:33)

Offline

 

#17 2012-07-30 20:42:47

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: Natural gravity

You can use this engine http://scratch.mit.edu/projects/zubblewu/2703276


........................................................................................................................................................................................................................................

Offline

 

#18 2012-07-30 20:47:04

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Natural gravity

If you have a sensor, create a variable called down. Then, make it so that when the sensor no longer detects the ground beneath your player, it sets down to 1, if else, it sets down to 0. Then, in your character, if down = 1, use your gravity scripts until down = 0.

Hope that this is what your looking for!


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer