Discuss Scratch

hypergird
Scratcher
3 posts

how do i make a jump button for my game

help pls
ThatMoobloom
Scratcher
23 posts

how do i make a jump button for my game

Hello ThatMoobloom here, your project lacks quite some important information, i'd recommend visiting this post on the forum to help.how to better format your topic! aside from the lack of information i have made this solution
Mobile buttons

to create mobile buttons you need to use variables. this is a section in the create tab of scratch with types of blocks where you can fill in a number. you can use these for all sorts of things like mobile buttons.
there are many ways of making these but this is one of the most easy scripts.

here is a project using this script (click to view)

by creating two variables and using these on the block shown below:
go to x: () y: (0)
you can set the x and y to the value (input) of the variables.
when green flag clicked
forever
go to x: ((x)) y: ((y))
end
if you change the input of the variable you will change the position of your sprite.

if you add a script to change the variable by pressing a button you have a moving sprite.

I also found this youtube tutorial for another script. (click to view)


im very sorry if this is not the answer you've been looking for. if it isn't what you've been looking for try describing your problem in greater detail.

i have also noticed that your new to scratch. if you havent already you can check out the forums new scratcher and questions about scratch

Last edited by ThatMoobloom (Aug. 18, 2022 14:41:59)

Muyaolu123
Scratcher
100+ posts

how do i make a jump button for my game

Have you tried this yet?

when green flag clicked
forever
if <mouse down?> then
whatever code you need to make the sprite jump

end
end

This code makes it so that whenever you tap the screen; the sprite jumps, kinda like super Mario.

Or, you could try this if you already made the button:

when green flag clicked
forever
if <<mouse down?> and <touching [mouse pointer v] ?>> then
whatever code you need to make the sprite jump

end
end

Powered by DjangoBB