Discuss Scratch

bennono14
New Scratcher
3 posts

Brauche ein Gravity Script bitte

Ich brauche Hilfe ich will Gravity in scratch machen bin aber noch nicht so gut in programmieren hilft mir jemand bitte

Last edited by bennono14 (Oct. 9, 2025 13:04:14)

Tunibal_Scratcher
Scratcher
1000+ posts

Brauche ein Gravity Script bitte

Schau hier in das Player-Skript, ist bisschen schwierig. https://scratch.mit.edu/projects/1116025865/
meercat213
Scratcher
54 posts

Brauche ein Gravity Script bitte

Hallo bennono14!

Am einfachsten ist das mit einer y-Geschindigkeits Variabel zu lösen. Das Script würde dann etwa so aussehen:

when green flag clicked
set [y-speed v] to [0]
forever
if <<touching [ground v] ?> and <key [space v] pressed?>> then
set [y-speed v] to [15]
end
change [y-speed v] by (-0.85)
change y by (y-speed)
if <touching [ground v] ?> then
set [y-speed v] to ((-1) * (y-speed))
change y by (y-speed)
set [y-speed v] to [0]
end
end

Dieses Script habe ich bei meinem Projekt ɪᴏᴏ% ᴘᴇɴ DODGE! verwendet.

Ich hoffe, ich konnte helfen

Powered by DjangoBB