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

#1 2012-11-25 11:59:17

bryan31314
Scratcher
Registered: 2012-06-28
Posts: 1

How to make an object jump

I want to make a game of platforms and I do not know how to make an object jump, with gravity

Offline

 

#2 2012-11-25 12:04:05

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

Re: How to make an object jump

Here's a wiki article on jumping if you want to look.  wink

Anyway, I hope that this helps!


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

Offline

 

#3 2012-11-25 12:06:48

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: How to make an object jump

bryan31314 wrote:

I want to make a game of platforms and I do not know how to make an object jump, with gravity

hi bryan31314, Questions with Scratch is not about Help with Scratch- there is a forum for that. Questions with Scratch is about

Post general questions about Scratch or the Scratch website here.

Help with Scripts is

Need help with your Scratch project? Ask here!

But- here is a link to the page of the Scratch Wiki with the answers (i do not know which type of jumping you want with gravity so here are them all) http://wiki.scratch.mit.edu/wiki/Jumping/

I will report this to be moved to Help with Scripts

EDIT- Outposted  sad

Last edited by Willpower (2012-11-25 12:07:49)


http://i49.tinypic.com/e84kdj.png

Offline

 

#4 2012-11-27 20:26:56

scratchyrocks
Scratcher
Registered: 2012-09-29
Posts: 19

Re: How to make an object jump

us this script:

when gf clicked
forever 
 if <touching [ ground  v]>
set [vertical velocity v] to (0)
 else
change [vertical velocity v] by (-3.0)
change y by (vertical velocity)
 end
end
when [space v] key pressed
repeat until  <not <touching [ground v]>>
change y by [5]
end
set [vertical velocity v] to (7)

Offline

 

#5 2012-11-27 20:36:33

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

Re: How to make an object jump

scratchyrocks wrote:

us this script:

when gf clicked
forever 
 if <touching [ ground  v]?>
set [vertical velocity v] to (0)
 else
change [vertical velocity v] by (-3.0)
end
change y by (vertical velocity)
when [space v] key pressed
repeat until  <not <touching [ground v]?>>
change y by [5]
end
set [vertical velocity v] to (7)

Fixed and I moved a block to make the script work.

Last edited by ErnieParke (2013-04-18 15:22:30)


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

Offline

 

#6 2013-04-18 09:04:17

lutherwenxu
Scratcher
Registered: 2012-12-12
Posts: 8

Re: How to make an object jump

when [space v] key pressed
set [gravity v] to (15)
change y by (10)
repeat until < touching [Sprite 2(Ground) v] ?>
change [gravity v] by (-1)
change y by (gravity)
end
say [Maybe this will works...] for (2) secs
think [Hmm... Don't write the say and this script!] for (2) secs
say [I want to be in the credit] for (2) secs
say [Time for some music...] for (2) secs
forever
play sound [victory v] until done
end

Last edited by lutherwenxu (2013-04-18 09:07:33)

Offline

 

Board footer