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

#1 2008-05-21 07:31:06

Freestylin_Monkey
Scratcher
Registered: 2008-03-24
Posts: 100+

For Bubble 07, jump script

go ahead and use blocks to write script


I am Lord of Lords, I am King of Kings, I AM MASTERS OF ALL MASTERS!!!
-But I am a servant of my mother

Offline

 

#2 2008-05-31 15:25:09

bubble-07
Scratcher
Registered: 2008-03-25
Posts: 17

Re: For Bubble 07, jump script

Here's the jump script. (Sorry for taking so long; I was traveling without a computer) (I don't even own a portable one  sad  )
[blocks]
<when green flag clicked>
<forever>
<if><touching[ floor]
<set{ v}to( 0
<if><key[space]pressed?>
<set{ v}to( 15
<end>
<else>
<change{ v}by(-1
<change y by( v
<end>
[/blocks]
Note that V is the y velocity, and that you can change the jump amount by changing what V gets set to in the "key space pressed". This also adds gravity. Put it into your character sprite. Hope this helps! (And hope I'm not too late)

Offline

 

#3 2008-05-31 16:23:09

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: For Bubble 07, jump script

That script looks flawed. The change y by V should be outside of the else block.

Also, it doesn't seem like your gave your forever block an end piece.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#4 2008-06-02 10:45:03

Freestylin_Monkey
Scratcher
Registered: 2008-03-24
Posts: 100+

Re: For Bubble 07, jump script

no rush bubble o7, and archmage, does the forever loop need one?  hmm

Last edited by Freestylin_Monkey (2008-06-02 10:45:31)


I am Lord of Lords, I am King of Kings, I AM MASTERS OF ALL MASTERS!!!
-But I am a servant of my mother

Offline

 

Board footer