Hi everyone,
I've just started using Box2d WCK (in fact I'm using it in tandem with Air for Android) so thought it time to join a forum and get involved!
Sorry to start with a question but I'm having real difficulty getting my head round the world gravity properties. Essentially I'm trying to change the world gravity based on the phone's accelerometer. I figured I would just set the world (myWorld) instance's properties for gravity in the same manner as the WCK component i.e....
myWorld.gravityX = 9.8;
myWorld.gravityY = 0;
For testing purposes I'm doing this from AS3 code on the root timeline to an instance of the world placed on the first and only frame... no effect.
I've tried the setGravity(x,y) method I spotted after digging around and this method doesn't seem to exist. I'm pretty competent with AS3 generally but this is the first time I've used alchemy, box2D and components like this... clearly I'm missing something 🙂
Any help would be much appreciated!
Thanks!
I've just started using Box2d WCK (in fact I'm using it in tandem with Air for Android) so thought it time to join a forum and get involved!
Sorry to start with a question but I'm having real difficulty getting my head round the world gravity properties. Essentially I'm trying to change the world gravity based on the phone's accelerometer. I figured I would just set the world (myWorld) instance's properties for gravity in the same manner as the WCK component i.e....
myWorld.gravityX = 9.8;
myWorld.gravityY = 0;
For testing purposes I'm doing this from AS3 code on the root timeline to an instance of the world placed on the first and only frame... no effect.
I've tried the setGravity(x,y) method I spotted after digging around and this method doesn't seem to exist. I'm pretty competent with AS3 generally but this is the first time I've used alchemy, box2D and components like this... clearly I'm missing something 🙂
Any help would be much appreciated!
Thanks!