How to flip gravity?
Basically, I want the actor to accelerate up or down every time i press the space bar.(VVVVVV style).
I've tried it by making an attribute called 'self gravity' and setting it up like this:
When space is pressed when self gravity is true, accelerate upwards at 700.
When space is pressed when self gravity is false,accelerate downwards at 700.
But when i press space nothing happens or it only flips gravity once.
Any help?
I've tried it by making an attribute called 'self gravity' and setting it up like this:
When space is pressed when self gravity is true, accelerate upwards at 700.
When space is pressed when self gravity is false,accelerate downwards at 700.
But when i press space nothing happens or it only flips gravity once.
Any help?
Comments
self.gravityCoefficient = 1
accelerate 90 (scene) acceleration 700*self.gravityCoefficient
rule spacebar down
change attribute self.gravityCoefficient = gravityCoefficient * -1