Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help for my jumping script
- Spiritual1377
-
Scratcher
11 posts
I need help for my jumping script
So i wanna make Scratch Cat jump smoothly and then fall back on the ground. I've managed to do that, however, the real problem is the slopes: Scratch Cat just keeps; "nocliping“ or going ”under the slope" and i just want to make him go up the slope if you understand what i mean.


Last edited by Spiritual1377 (Sept. 17, 2023 19:54:33)
- GunesKing
-
Scratcher
100+ posts
I need help for my jumping script
Okay! My help may be a bit complicated, but please follow my instructions.
Planets have a gravitational force. It maps like a quadratic function. So basically, when something jumps, it goes up, gradually the speed it goes up decreases, then falls back down.
What YOU need to do is:
1) Create a new variable called: g
2)
Planets have a gravitational force. It maps like a quadratic function. So basically, when something jumps, it goes up, gradually the speed it goes up decreases, then falls back down.
What YOU need to do is:
1) Create a new variable called: g
2)
when green flag clickedThe cat will be a bit bouncy, but it should work. If it doesn't, please notify me, and I will send you the link of the sample test project of the code.
forever
if <touching [Ground v] ?> then
set [ g v] to [3]
else
change [g v] by [-0.4]
end
if <<key [ up v] pressed?> and <(g) < [0.4]>> then
set [ g v] to [7]
end
end
- Discussion Forums
- » Help with Scripts
-
» I need help for my jumping script

