how do i tilt gravity in realtime? like tilting over a stack of boxes..
I know there have been threads in the past, but I can't find them when I use the search field.. so yea I'm wondering how i can use the accelerometer to shift gravity of objects in realtime
I've made some attempts at it, but i'm having trouble with the tilting not updating continously.. it seems like when i tilt to the left or the right i get a single register but thats it.
I have some ideas to go beyond this, but really I just think my methods (like stacking numerous rules with range values being terribly inefficient and potentially performance hindering.
Thanks!
Caleb
I've made some attempts at it, but i'm having trouble with the tilting not updating continously.. it seems like when i tilt to the left or the right i get a single register but thats it.
I have some ideas to go beyond this, but really I just think my methods (like stacking numerous rules with range values being terribly inefficient and potentially performance hindering.
Thanks!
Caleb
Comments
Hope this helps.
This type of physics is called "Sandbox" I don't think it can be accomplished fully with GS, maybe in the future...
---------------
Posted by LeonardDeveloper, contact me on thermoapps@thermo-apps.com
Be sure to visit my WEBSITE
Have a look at my GS Tutorials
----------------------------------------------------
http://www.part12studios.com/Temp/Water_Test_1.gameproj.zip
its ugly but its how i'm trying to get the tilt to work.. perhaps someone can see a better way so when tilting left or right the balls continue to drift downward..
another question that would probably answer the same question in a different way would be how to do a labyrinth style game like this:
In the 'Tilter' prototype -- turn off the first two rules. They are not necessary.
Then place a constrain behavior in the prototype:
Constrain Attribute: game.Direction To: (vectorToAngle(game.Accelerometer.X,game.Accelerometer.Y)+90)%360
And that is it! Your water will flow in whatever direction you want it to go by tilting the device.
Hope that helps!
RThurman
i need to better understand constraints.. they are a mystery to me when to use them..
happy new years!
Caleb
RThurman
thanks!
so do i use one "constraint attribute" behavior to set a range of like.. 30 degrees.. to 60 degrees? or would i use two constraints for two ranges.. i just can't seem to get a good mix.. i tried changing the 360 to 180 in RThurman's formula but that didn't give the right results either.
Thanks!
Caleb