Tak żeby były jasne polecenia :>
Physically accurate jumping
A more realistic effect for jumping commonly used in games is the following, using a variable to control the vertical speed of a sprite (simulating gravity) is this:
when green flag clicked
set [y speed v] to [0]
forever
change y by (y speed)
when green flag clicked
forever
if <<key [up arrow v] pressed?> and <(y speed) = [0]>> //typical jumping key
set [y speed v] to (9.9)
repeat until <touching color [#000000]?> //the color of the platforms
change [y speed v] by (-0.5)
end
set [y speed v] to (0)
end
Offline