Discuss Scratch

Heart333
Scratcher
79 posts

How do you make a sprite jump while turning?

So I decided to create a Geometry Dash type game on Scratch, but I have no idea what scripts to put to make the square jump and rotate! If you've ever played Geometry Dash before, then you know how when you touch the screen/press the spacebar the square jumps and rotates, then it falls back in the same position. When you press the spacebar again, it does the sequence all over again.

Any help would be greatly appreciated. Thank you!
qinkeer
Scratcher
27 posts

How do you make a sprite jump while turning?

Heart333 wrote:

So I decided to create a Geometry Dash type game on Scratch, but I have no idea what scripts to put to make the square jump and rotate! If you've ever played Geometry Dash before, then you know how when you touch the screen/press the spacebar the square jumps and rotates, then it falls back in the same position. When you press the spacebar again, it does the sequence all over again.

Any help would be greatly appreciated. Thank you!
In that case you should look inside this:

https://scratch.mit.edu/projects/68663896/
purplebook163
Scratcher
500+ posts

How do you make a sprite jump while turning?

Did you figure it out?
Heart333
Scratcher
79 posts

How do you make a sprite jump while turning?

qinkeer wrote:

Heart333 wrote:

So I decided to create a Geometry Dash type game on Scratch, but I have no idea what scripts to put to make the square jump and rotate! If you've ever played Geometry Dash before, then you know how when you touch the screen/press the spacebar the square jumps and rotates, then it falls back in the same position. When you press the spacebar again, it does the sequence all over again.

Any help would be greatly appreciated. Thank you!
In that case you should look inside this:

https://scratch.mit.edu/projects/68663896/

That's kinda what I wanted, except I wanted a jump that rotates a full 1/4 turn and that's it- it comes back down.
Play Geometry Dash and you'll see what I mean. Thanks for the tip though!

Last edited by Heart333 (June 27, 2015 02:45:31)

Heart333
Scratcher
79 posts

How do you make a sprite jump while turning?

purplebook163 wrote:

Did you figure it out?
Nope! Any suggestions would be greatly appreciated!
Superthunder5000
Scratcher
73 posts

How do you make a sprite jump while turning?

when green flag clicked
forever

if <key [Up v] pressed?> then
repeat (10)
change y by (Anything)
turn ccw (10) degrees

end


end


end

end
Is this what you mean by turning while jumping ???

Last edited by Superthunder5000 (June 27, 2015 02:55:36)

jtmit
Scratcher
60 posts

How do you make a sprite jump while turning?

You could try something like:

when [whatever] key pressed
set [jumping?] to [1]
repeat (10)
change y by (10)
end
set [jumping?] to (0)

and this:
when green flag clicked
forever
if <(jumping) = [1]> then
repeat (10)

turn cw (9) degrees
end

end

end


Maybe scratch should have an update with a block like:

turn () degrees while moving () steps

Last edited by jtmit (Nov. 26, 2015 00:47:57)

flora4
Scratcher
2 posts

How do you make a sprite jump while turning?

jtmit wrote:

You could try something like:

when [whatever] key pressed
set [jumping?] to [1]
repeat (10)
change y by (10)
end
set [jumping?] to (0)

and this:
when green flag clicked
forever
if <(jumping) = [1]> then
repeat (10)

turn cw (9) degrees
end

end

end


Maybe scratch should have an update with a block like:

turn () degrees while moving () steps
BKFighter
Scratcher
1000+ posts

How do you make a sprite jump while turning?

flora4 wrote:

jtmit wrote:

You could try something like:

when [whatever] key pressed
set [jumping?] to [1]
repeat (10)
change y by (10)
end
set [jumping?] to (0)

and this:
when green flag clicked
forever
if <(jumping) = [1]> then
repeat (10)

turn cw (9) degrees
end

end

end


Maybe scratch should have an update with a block like:

turn () degrees while moving () steps
Please don't necropost. This topic is a few months old and you didn't add anything relevant.
coollegoguy
Scratcher
20 posts

How do you make a sprite jump while turning?

Make your jumping program first, then find out how many frames exactly it takes to touch the ground after jumping. Then do the math, take 90 degrees and divide that by the number of frames it took. then add a block saying to turn that many degrees every frame.
Top_Slugga
Scratcher
8 posts

How do you make a sprite jump while turning?

if <I wonder how to do this> then
forever
Keep searching google until I find something that's kind of useful
end
end

Last edited by Top_Slugga (Jan. 6, 2021 16:25:15)

dark492
Scratcher
8 posts

How do you make a sprite jump while turning?

when green flag clicked
point towards [ v]
gozhaym
Scratcher
3 posts

How do you make a sprite jump while turning?

when green flag clicked
forever
if <key [ w] pressed> then
repeat (9)
point towards ((direction) + (10))
wait (.1) secs
end

yeah not so much smooth
But atleast i tryed
AND LITTLE BUG

Last edited by gozhaym (Oct. 3, 2021 07:41:48)

Cheese_Person100
New Scratcher
1 post

How do you make a sprite jump while turning?

It doesn't go back down so it doesn't count as a jump
Jaga78910
Scratcher
1 post

How do you make a sprite jump while turning?

I tried it all but nothing worked???
Ayaanepic65
Scratcher
1 post

How do you make a sprite jump while turning?

this is harrrrrrrdddd
MrKingofScratch
Scratcher
100+ posts

How do you make a sprite jump while turning?

You can check out a tutorial by @griffpatch here
lanzpogi1660
Scratcher
1 post

How do you make a sprite jump while turning?

gozhaym wrote:

when green flag clicked
forever
if <key [ w] pressed> then
repeat (9)
point towards ((direction) + (10))
wait (.1) secs
end

yeah not so much smooth
But atleast i tryed
AND LITTLE BUG

lanzpogi1660 wrote:

when green flag clicked
point in direction (90)
forever
point in direction (45)
repeat until <key [w] pressed>
point in direction ((direction) + (5))
this code is smooth you guys try it!

Powered by DjangoBB