Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make a character jump and duck
- EndMakesMC
- Scratcher
11 posts
How to make a character jump and duck
when [LEFTARROW] key pressed
move (10) steps
[scratchblocks]
when [RIGHTARROW] key pressed
[/scratchblocks]
move (-10) steps
when [SPACE] key pressed
change y by (10)
when [DOWNARROW] key pressed
change y by (-10)
Scratch is awesome, and so are you!
Leave me a message on my profile to talk to me.
Talk to me here! http://scratch.mit.edu/users/EndMakesMC/
- LoudOrange2001
- Scratcher
48 posts
How to make a character jump and duck
That is definately not how you do it.
LoudOrange
- scratchhacker3000
- Scratcher
500+ posts
How to make a character jump and duck
What if you pressed space repeatedly? The character would go flying into the air. This teaches you how to make awesome games using professional gravity and collision detection. Try it out.when [LEFTARROW] key pressedmove (10) steps
[scratchblocks]
when [RIGHTARROW] key pressed
[/scratchblocks]move (-10) stepswhen [SPACE] key pressedchange y by (10)when [DOWNARROW] key pressedchange y by (-10)
Want to know if you're a great scratcher? Take this test!
1. Are you kind?
If yes, you're a great scratcher!
- EndMakesMC
- Scratcher
11 posts
How to make a character jump and duck
I meant:
when [SPACE] key pressed
change y by (10)
wait (0.3) secs
change y by (-10)
Scratch is awesome, and so are you!
Leave me a message on my profile to talk to me.
Talk to me here! http://scratch.mit.edu/users/EndMakesMC/
- dakoto
- Scratcher
47 posts
How to make a character jump and duck
when [Space v] key pressed
if <inAirplayer = 0> then
set [yVelocity v] to [5]
set [inAirplayer v] to [1]end
and…
when green flag clicked
forever
if <inAirplayer = 1> then
change [yVelocity] by (-.5)
change y by (yVelocity)
if <touching color [#f0f]?> then
set [inAirplayer v] to [0]
end
end
end
The touching color pink thing is when your character touches the ground or whatever color you want it to be.
Last edited by dakoto (June 18, 2014 17:56:56)
- Team_BlockED
- Scratcher
1 post
How to make a character jump and duck
when [Space v] key pressedif <inAirplayer = 0> then
set [yVelocity v] to [5]set [inAirplayer v] to [1]end
and…when green flag clickedforever
if <inAirplayer = 1> then
change [yVelocity] by (-.5)
change y by (yVelocity)
if <touching color [#f0f]?> then
set [inAirplayer v] to [0]
end
end
end
The touching color pink thing is when your character touches the ground or whatever color you want it to be.
lel i know that the color thing is what makes it goto a place if touching a color. lel haha.
- Discussion Forums
- » Help with Scripts
- » How to make a character jump and duck