Hi! Helltank here. This is how to generate artificial gravity, extremely useful and familiar to old timers, but strange and new for new scratchers:
Gravity Script:
When Flag Pressed
Forever
If Sprite touching <colour of floor>
Change Y/X(depends on project) by <amount>
Else Change Y/X by <amount>
Note: This script is NOT perfect. If the Sprite is big enough, you can notice it "vibrating" up and down. This is due to it falling into the floor but being pushed up again immediately.
Offline
Bump! And coolstuff, do you think I should have put it in New Scratch Members instead?
Offline
<when green flag clicked>
<forever><if><key[ up arrow]pressed?>
<set{ Gravity }to( 10
<change y by( 10
<end>
<repeat until>
<touching[ edge
<change{ Gravity}by( -0.5
<change y by( <{ Gravity
<end><end>
Offline
I just turned the script into a project but it won't let me upload
Offline
Dazachi wrote:
And once you get better at using this script, you will be able to modify it and fit to your needs.
That's the joy of programming, isn't it? just about everything can be modified to suit your needs.
This is especially so with Scratch because of its unique interface... The Scratch team are geniuses!
[/marvelling]
Offline
The "vibrating" problem is really annoying, but I have a convoluted solution:
when flag clicked: set [on ground?] to "false" forever: if < on ground? = "true" > { if <not <touching [ground]?>> { set [on ground?] to "false" } }else{ change [y velocity] by 1 change y by (y velocity) if <touching [ground]?> { set [on ground?] to "true" repeat until <not <touching [ground]?>> { change y by -1 } } }
I feel like this should solve the problem, but it's been a while
Offline
I did not understand you, fullmoon. Remember that I'm turning 11 this December...
Offline