Discuss Scratch

Final_Script
Scratcher
11 posts

How to code your player to jump in a platform game

Ever wonder how jumping works in a platform game? Ever try to make your own but rage within 2 hours of your non-stop, not-working work??
If yes, and your code looks like this but never works-
when green flag clicked
forever
if <> then
<key [ up arrow] pressed?>
change y by (5)
change y by (-5)
end
end
Well it doesn't ever really look that good, and dose not work very well.
What i'm about to tell you is crazy…
I once couldn't code my platform because the jumping sucked, and I would never even finish it!
But the reality is-
JUMPING IS SO SIMPLE!
I almost cried when I found this out!!
Its as simple as this-
First create a speed y in variables, and you probably know how to set the speed,
Now use speed y like this:


when green flag clicked
forever
if <> then
<key [ up arrow] pressed?>
broadcast [ 1]
end

when I receive [ 1]
set [ speed y] to [11]

Simple, and works!
Now you can finish a platform and share it!
Just like the pros do! (just kidding) :P
Final_Script
Scratcher
11 posts

How to code your player to jump in a platform game

Final_Script wrote:

Ever wonder how jumping works in a platform game? Ever try to make your own but rage within 2 hours of your non-stop, not-working work??
If yes, and your code looks like this but never works-
when green flag clicked
forever
if <> then
<key [ up arrow] pressed?>
change y by (5)
change y by (-5)
end
end
Well it doesn't ever really look that good, and dose not work very well.
What i'm about to tell you is crazy…
I once couldn't code my platform because the jumping sucked, and I would never even finish it!
But the reality is-
JUMPING IS SO SIMPLE!
I almost cried when I found this out!!
Its as simple as this-
First create a speed y in variables, and you probably know how to set the speed,
Now use speed y like this:


when green flag clicked
forever
if <> then
<key [ up arrow] pressed?>
broadcast [ 1]
end

when I receive [ 1]
set [ speed y] to [11]

Simple, and works!
Now you can finish a platform and share it!
Just like the pros do! (just kidding) :P
[/quote]
Never give up!
-frostyiceprincess-
Scratcher
1000+ posts

How to code your player to jump in a platform game

There are a lot of tutorials out there like @griffpatch's tutorial account. He explains step by step how to do each part of a platforming game. But if you want, you can check out other tutorials. I just prefer his.

deck26
Scratcher
1000+ posts

How to code your player to jump in a platform game

The forum works best if those who need help post new topics asking for help and those who want to help just respond where they can help. Tutorials just get lost here and rarely looked at.

I would also suggest you use the sticky topic to practice your use of Scratchblocks - their use can be tricky at first.
Final_Script
Scratcher
11 posts

How to code your player to jump in a platform game

Okay
Final_Script
Scratcher
11 posts

How to code your player to jump in a platform game

I will do that the next one I make.

Powered by DjangoBB