Jump to content



Accelerometer in tiled map

  • You cannot reply to this topic
1 reply to this topic

#1 da32   Members   -  Reputation: 100

Like
0Likes
Like

Posted 07 December 2011 - 08:15 PM

Hi there..i have been working on a game which uses accelerometer. The map i'm using is made using Tiled and i'm having problem implementing accelerometer to move the character. I've tried it but the movement is not smooth at all and very jumpy. I'm using xcode and cocos2d to make the game. Here is my code:

Spoiler
Hope that someone could help me solve this problem. Thank You.

Ad:

#2 WasabiSauce   Members   -  Reputation: 100

Like
0Likes
Like

Posted 23 December 2011 - 12:28 PM

Don't use CCMove or CCMoveBy for moving your player. In your player move method just simply set the player position to destX and destY that you already derived in your

-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration

method. You already create a delta movement with the accelerometer. Basically what you are doing is 60 times per second you are starting a move action and it doesn't have time to complete.






We are working on generating results for this topic
PARTNERS