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

#1 2012-06-29 13:12:42

horseluver4596
New Scratcher
Registered: 2012-06-14
Posts: 7

Platform game: jumping with gravity

Hi,

I wondered if anyone could help me. For my school work we have to design and create a game. I chose a platform game with different levels. I have got everything leading up to the first level sorted. But, I can't any way for my character to jump with a gravity pull (it goes back down) onto the platforms. This is really bugging me so plleeasseee can you help me because I am desperate.

From,
horseluver4596  smile

Offline

 

#2 2012-06-29 13:26:04

wolfdude999
Scratcher
Registered: 2012-01-07
Posts: 1000+

Re: Platform game: jumping with gravity

One thing that you can do is make a script in a forever loop saying that if your character is not touching the color of the ground, then you can change the y position by a number (I recommend -3).  If you want an example then you can look at my project Mirror Remade.


http://i48.tinypic.com/15yxmp4.png

Offline

 

#3 2012-06-30 02:07:57

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Platform game: jumping with gravity

Here is a script that could help

when gf clicked
forever 
if <not <touching color [#000000]?>>
change y by [-10]
change black to the color of your platforms, and if you jump or fall it will change y by -10

Last edited by daniel_j (2012-06-30 02:23:29)


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#4 2012-06-30 06:08:29

ROSMan
Scratcher
Registered: 2011-04-29
Posts: 1000+

Re: Platform game: jumping with gravity

just to make sure you got the jump right, here:

when gf clicked
forever
 if <key [up arrow v] pressed?>
  repeat (any number)
   change y by (any number)
  end
  wait until <touching color [black]?>
 end
end
 

Last edited by ROSMan (2012-06-30 06:12:36)


GENERATION 33: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment

Offline

 

#5 2012-06-30 08:11:08

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Platform game: jumping with gravity

ROSMan wrote:

just to make sure you got the jump right, here:

when gf clicked
forever
 if <key [up arrow v] pressed?>
  repeat (any number)
   change y by (any number)
  end
  wait until <touching color [#000000]?>
 end
end
 

I added the color for you  big_smile

Last edited by daniel_j (2012-06-30 08:11:26)


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

Board footer