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

#1 2011-09-05 08:03:50

geckowill
Scratcher
Registered: 2011-09-05
Posts: 44

jumping

when my charactor jumps when you press up,goes left if you press left and right ifyou press right. if you press left or right when hes jumping, he stops half way through the jump and goes down fully, making him go under the line witch is the ground. heres the script for the movment:

When Left arrow/right arrow is pressed
switch to costume 2/1
point in direction -90/90
move ten steps

when up arrow is pressed
switch to costume 3
point in direction 0
move 40 steps
wait 0.5 seconds
move 40 steps
wait 0.5 seconds
switch to costume 4
point in direction 180
move 40 steps
wait 0.5 seconds
move 40 steps

Its a really good script ecept for the problem above. Plz Help  smile

Offline

 

#2 2011-09-05 08:34:47

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: jumping

Ah, yes - the point in direction blocks in those two scripts interfere with each other when you run them at the same time. Instead of using two blocks - point in direction and move x steps for your movement, you should try using the block change x/y by _. Your script will look something like this (very simplified, you can add the switch to costume and other stuff, of course):
[blocks]<when[ right/left ]key pressed>
<change x by( 10/-10

<when[ up ]key pressed>
<change y by( 40
<wait( 0.5 )secsc>
<change y by( -40 [/blocks]


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#3 2011-09-05 09:02:19

geckowill
Scratcher
Registered: 2011-09-05
Posts: 44

Re: jumping

good but when i press up it just goes left and right not up and down  sad

Offline

 

#4 2011-09-05 09:10:23

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: jumping

geckowill wrote:

good but when i press up it just goes left and right not up and down  sad

Are you sure you didn't use a change x by _ block instead of a change y by _ block?


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#5 2011-09-05 09:27:12

geckowill
Scratcher
Registered: 2011-09-05
Posts: 44

Re: jumping

oh yay thanks
bye the way i need help with his fire ball. heres the game so try it and help me correct it

Offline

 

#6 2011-09-05 09:30:22

geckowill
Scratcher
Registered: 2011-09-05
Posts: 44

Re: jumping

http://scratch.mit.edu/projects/geckowill/2013663

Offline

 

Board footer