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

#1 2011-07-08 00:59:26

Intaha
New Scratcher
Registered: 2011-07-08
Posts: 1

How to make a sprite jump from one ledge to other and to fall under g?

I hav seen a dozen of u tube videos concerning the topic but nuthing is fitting in my project.... Appreciate the help...

Offline

 

#2 2011-07-08 01:11:53

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: How to make a sprite jump from one ledge to other and to fall under g?

Try something like this for gravity...
https://lh4.googleusercontent.com/-N97HfwVimLI/ThaRWdN4ebI/AAAAAAAADXg/qrxmYa43G30/g%252520sprite.gif
The <if touching color []> should be replaced by the colour of your platforms  wink

For jump something simple like
https://lh3.googleusercontent.com/-ii8w8TbSQRA/ThaSY4f531I/AAAAAAAADXk/jQhEQ27EY0U/jump.gif
should work. If you use the gravity script with this script your sprite should hopefully fall back to the ground after jumping  wink

Last edited by jji7skyline (2011-07-08 01:15:38)


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2011-07-08 10:55:08

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: How to make a sprite jump from one ledge to other and to fall under g?

Here's a simple project showing implementing gravity; Gravity Guy.

Offline

 

#4 2011-07-10 15:44:29

chipguy
Scratcher
Registered: 2009-09-09
Posts: 500+

Re: How to make a sprite jump from one ledge to other and to fall under g?

i learned it the hard way, but if you want to know, i'll tell you... you need a variable called gravity. you know variables, right? anyways, you make it so when flag clicked, forever: if touching color (ground) set gravity to zero, else change gravity by negative 0.2. at the end of the script, change y by gravity. this will make him fall faster the longer he is in the air, and stop when he hits ground.


http://scratch.mit.edu/static/projects/chipguy/2919121_sm.png by yours truly  big_smile

Offline

 

Board footer