Discuss Scratch

karlee202
Scratcher
4 posts

How do I make a character jump for a platformer game

Can somebody tell me how to make a character jump in a platform game?
levtey
Scratcher
100+ posts

How do I make a character jump for a platformer game

when green flag clicked
forever

if <key [up arrow or space v] pressed?> then

repeat [number]

change y by [number]
end

end
end
You should also have a separate script that says
when green flag clicked
forever

if <not <touching [ground v]?>> then

change y by [same number as jump]
end
end

Last edited by levtey (May 10, 2014 19:53:55)

Happyman10123
Scratcher
3 posts

How do I make a character jump for a platformer game

that doesnt work
ADHDPotato
New Scratcher
37 posts

How do I make a character jump for a platformer game

Mind sharing a screenshot? That would make it easier to help. If you don't want to, then look how I did it in my coding for my platform game. Just look at the scripts under sprite 2.

http://scratch.mit.edu/projects/23287648/#editor
RandomPerson1789
Scratcher
100+ posts

How do I make a character jump for a platformer game

when green flag clicked
forever

set [Y v] to [0]
if <key [Up Arrow v] pressed?> then
repeat (20)
change [Y v] by (0.3)
change y by (y)

end

end
end
Hope this helped!

Last edited by RandomPerson1789 (June 7, 2014 00:17:20)

lalash
Scratcher
25 posts

How do I make a character jump for a platformer game

Maybe this?



when green flag clicked
forever

if <not <touching color [platform color]?>> then
change y by (-3)
end
end

Or what ever - number you want.
SeeFourGoBoom
Scratcher
46 posts

How do I make a character jump for a platformer game

If i hold up it keeps going up how do i stop this
rocketclock123
Scratcher
100+ posts

How do I make a character jump for a platformer game

when green flag clicked
forever

if <key [up arrow v] pressed?> then

repeat (10)

change y by (1)
end
repeat (10)

change y by (-1)
end

end

end
Hope this helps!
geo_399
New Scratcher
1 post

How do I make a character jump for a platformer game

mnmb
SeeFourGoBoom
Scratcher
46 posts

How do I make a character jump for a platformer game

nope
MAGICALParr0t
Scratcher
1 post

How do I make a character jump for a platformer game

dosent go down
ipaddude
Scratcher
100+ posts

How do I make a character jump for a platformer game

RandomPerson1789 wrote:

when green flag clicked
forever

set [Y v] to [0]
if <key [Up Arrow v] pressed?> then
repeat (20)
change [y v] by (0.3)
change y by (y)

end

end
end
Hope this helped!

This should be more accurate.

when green flag clicked
forever

set [y v] to [0]
if <key [Up Arrow v] pressed?> then
set [y v] to [10 --depending on how high you want to jump.]
end
if <(onGround) = [false]> then
change [y v] by [-2 --depends on gravity]
end
change x by (x)
change y by (y)
end

aNonExistentEntity wrote:

this is not a real quote.

Last edited by ipaddude (April 8, 2019 20:23:14)

Kraken_Games
Scratcher
100+ posts

How do I make a character jump for a platformer game

MAGICALParr0t wrote:

dosent go down

ipaddude wrote:

RandomPerson1789 wrote:

when green flag clicked
forever

set [Y v] to [0]
if <key [Up Arrow v] pressed?> then
repeat (20)
change [y v] by (0.3)
change y by (y)

end

end
end
Hope this helped!

This should be more accurate.

when green flag clicked
forever

set [y v] to [0]
if <key [Up Arrow v] pressed?> then
set [y v] to [10 --depending on how high you want to jump.]
end
if <(onGround) = [false]> then
change [y v] by [-2 --depends on gravity]
end
change x by (x)
change y by (y)
end

aNonExistentEntity wrote:

this is not a real quote.

Don't necropost - This topic is very old!
Alnimer1
Scratcher
1 post

How do I make a character jump for a platformer game

tell me idk pls
panda-wat
Scratcher
100+ posts

How do I make a character jump for a platformer game

Please don't post in old topics, it bumps them to the top and moves unanswered posts down.

Powered by DjangoBB