I am trying to make a little ball that rolls around based on the accelerometer values in the iPhone.
This code will not build:
-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
if(difficulty == @"Easy")
{
CGFloat newX = (CGFloat)(ball.frame.origin.x + (CGFloat)acceleration.x);
CGFloat newY = (CGFloat)(ball.frame.origin.y + (CGFloat)acceleration.y);
ball.frame.origin.x = newX;
ball.frame.origin.y = newY;
}
}
It gives me an lvalue required as left operand of assignment error.
I've tried 100 different things and I fail every time...This is just the latest failure.
Anyone have any insight?