Accelerometer and Jumping
ok this is causing me ALOT of pain
Basically I want to use the accelerometer to control my player in a 2d platform style game but he also needs to be able to jump (best example I can find is "The Incident" by the Big Bucket Software (on iTunes store)
Couple of things:
1. I found an amazing template which has the smoothest accelerometer transition I have seen via the forums. It uses Move behavior and has the following "low pass filter" to control the player and works great.
( game.Accelerometer.Y *.04)+( self.tiltOutput *.96)
2. I know how to make an actor jump using Motion.Linear.Vel.Y and putting some gravity on the scene
However as soon as I combine the 2 everything goes to crap.. as far as I can tell the move behaviour stops the Motion.Linear.Vel.Y from working properly and it makes gravity slow down so the player falls back to the ground very slow. To get around this I have to turn the gravity up to like 5000 but this then affects everything else in my scene.
Can anyone help me with this, recommend a better way or point me to an "The Incident" style template?
Thanks
Basically I want to use the accelerometer to control my player in a 2d platform style game but he also needs to be able to jump (best example I can find is "The Incident" by the Big Bucket Software (on iTunes store)
Couple of things:
1. I found an amazing template which has the smoothest accelerometer transition I have seen via the forums. It uses Move behavior and has the following "low pass filter" to control the player and works great.
( game.Accelerometer.Y *.04)+( self.tiltOutput *.96)
2. I know how to make an actor jump using Motion.Linear.Vel.Y and putting some gravity on the scene
However as soon as I combine the 2 everything goes to crap.. as far as I can tell the move behaviour stops the Motion.Linear.Vel.Y from working properly and it makes gravity slow down so the player falls back to the ground very slow. To get around this I have to turn the gravity up to like 5000 but this then affects everything else in my scene.
Can anyone help me with this, recommend a better way or point me to an "The Incident" style template?
Thanks
Comments
-Tad
http://www.mediafire.com/download.php?lyb9ezhdl8by3n1
@Flaming Banana I agree that gravity isn't a good idea so I will use change Velocity
@RThurman After playing around with the numbers for a while I have it to a point where its acceptable (although not awesome like "The Incident", as its no where near as responsive). Any ideas on how to improve this?
Also if I was to add a platform for the player to jump on to then things go weird again. Basically it seems that when the player is already leaning up against the platform (with the device already angled left or right) then the change velocity doesn't work properly... How do I fix this?
(BTW Sorry if that doesn't make sense I have attached my sample project below as its probably easier to just look at that and see what I mean.)
http://bit.ly/ZMGr0r
Cheers in advance :-)
There is a max speed that is set. Do you need to increase that?
To get a better jump, you should probably try setting friction to 0 in both actor prototypes.
Maybe by playing with a combination of max speed and friction, you will get something that is as "responsive" you want.
Also, some responsiveness has been designed out of it. For example, the jump is restriced so that it does not follow the tilt of the device. Perhaps you want it to tilt in mid-air.
How would I make it so the tilt works in the air?
(Actor receives event) (overlaps or collides) with (actor of type) (base/walls)
http://forums.gamesalad.com/discussion/53410
Is actually the perfect solution.. Cheers!