Discuss Scratch

Shrek_em
Scratcher
34 posts

Zero gravity toggle whenever a sprite touches a different sprite

Hello fellow scratchers!
I'm considering making a platformer but as soon as the character touches a piece of ground, it loses gravity and starts drifting with the force from the player applied to it to make it drift in a direction. Basically, I need a code that will make a sprite have zero gravity and drift in the direction that the player sprite landed. Any ideas?
_________________________________________________________________________________________________________________________
-Shrek_em
Really bad coder :P

27xz
Scratcher
65 posts

Zero gravity toggle whenever a sprite touches a different sprite

You could have a variable which controls gravity which is inverted when the player touches the ground (from 5 to -5 or something), in addition to making the current gravity, which is something you should already track using platformer scripts, multiplied by -1 to invert it. If you don't know how to do platformer scripts, there are many tutorials out there, griffpatch and otherwise, and I would recommend looking at some of those to get something which works for you.
Wolf_Link21
Scratcher
100+ posts

Zero gravity toggle whenever a sprite touches a different sprite

foreverifnottouching no gravity sprit?thensetgravityto0elsesetgravityto5movement
Shrek_em
Scratcher
34 posts

Zero gravity toggle whenever a sprite touches a different sprite

27xz wrote:

You could have a variable which controls gravity which is inverted when the player touches the ground (from 5 to -5 or something), in addition to making the current gravity, which is something you should already track using platformer scripts, multiplied by -1 to invert it. If you don't know how to do platformer scripts, there are many tutorials out there, griffpatch and otherwise, and I would recommend looking at some of those to get something which works for you.
sorry I should define that the platform the player touches loses gravity
Alinkeon
Scratcher
7 posts

Zero gravity toggle whenever a sprite touches a different sprite

whenclickedeatyou

Powered by DjangoBB