I want to move the background when I tilt the iPhone so it will look like it is moving your character. So if I tilt it forward, my background will go backwards.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use a CCParallaxNode.
Here is a good article / blog, about using CCParallaxNode in a 2d scrolling game. In this person’s example, they are moving the background on every frame, but you could modify it to only move when tilting the iphone by using the UIAcceleration delegate.
Here is the link: here