Drag & Drop
Hi, I'm a Gamesalad noob, and I have a scene, and there is a bar on the top and a ball on it. How can I:
1. Disable the gravity before I press a "Drop" button.
2. Be able to drag it where I want and then press the drop button, and the gravity would be on again.
A bit like Amazing Alex but there would be gravity and stuff...
Hope you got my point
Thank you.
1. Disable the gravity before I press a "Drop" button.
2. Be able to drag it where I want and then press the drop button, and the gravity would be on again.
A bit like Amazing Alex but there would be gravity and stuff...
Hope you got my point
Thank you.
Comments
Hi @Taneli00
First to say, you can't disable Gravity at run time (or enable it, for that matter). So in this case, maybe you could use velocity (although there are other options...)
So something along the lines of the following:
in your Drop button:
Rule: When touch is pressed
Nested in above rule: when scene.toggle is false
Change Attribute scene.toggle to true
Otherwise
Change Attribute scene.toggle to false
--
Now in the rules of your ball:
Rule: When scene.toggle is true
Change Atribute self.Motion.Linear Velocity.Y to -180
Otherwise
Change Atribute self.Motion.Linear Velocity.Y to 0
--
Rule: When touch is pressed and scene.toggle is false
Constrain Attribute self.Position.X to game.Touches.Touch 1.X
Constrain Attribute self.Position.Y to game.Touches.Touch 1.Y
Hope that gets you on the right track.
That's a boolean attribute used as a "switch" which I happen to call toggle (because it toggles back and forth between off and on states).