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

#1 2012-10-07 00:11:45

Rsrilaya
Scratcher
Registered: 2012-09-22
Posts: 12

Jumping Script......

http://scratch.mit.edu/projects/Rsrilaya/2806502

In the above game, I have a problem with the jumping.
The sprite actually does flying rather than jumping when up arrow pressed.
PLEASE HELP ME......

Offline

 

#2 2012-10-07 09:53:39

gfchll
Scratcher
Registered: 2012-04-21
Posts: 100+

Re: Jumping Script......

when [up arrow v] key presed
repeat (10)//or any number
change y by (1)
end
repeat (10)//same # as before
change y by (-1)
end


HELLO EVERYBODY!

Offline

 

#3 2012-10-08 01:30:20

iamGenesis
New Scratcher
Registered: 2012-10-07
Posts: 7

Re: Jumping Script......

Do this:

forever
if <[(up arrow) key pressed] and [touching (ground)>
change y by (4)

Offline

 

#4 2012-10-08 08:38:18

StarscreamClone
Scratcher
Registered: 2012-05-19
Posts: 1000+

Re: Jumping Script......

gfchll wrote:

when key [up arrow v] pressed
repeat (10)//or any number
change y by (1)
end
repeat (10)//same # as before
change y by (-1)
end

Ditto.  This is how I have the jump feature in my games.

Last edited by StarscreamClone (2012-10-08 08:38:55)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i1154.photobucket.com/albums/p522/lizzyhipo/Angelica101-1-1-1.jpg&amp;link2=http://i46.tinypic.com/2elqwdy.png&amp;link3=http://i1273.photobucket.com/albums/y404/Hulydooly/decepticon.jpg&amp;link4=http://i44.tinypic.com/34rvb07.png

Offline

 

#5 2012-10-08 11:12:48

iamGenesis
New Scratcher
Registered: 2012-10-07
Posts: 7

Re: Jumping Script......

you need something to check whether your character is touching the ground or not. If they are touching the ground and they press the 'jump' button, they jump. But if they are not touching the ground, they will slowly fall to the ground.

Offline

 

Board footer