Making a tilt platform in game
jbrown2177
Member Posts: 66
I'm making a cute little game in which you use the accelerometer to tilt the iPhone to collect items an build your score. The thing is the main character is on a platform that tilts when the iPhone is moved. How do I animate the background in accordance with the character on top of it to perform this action? It seems like it's an easy thing, but working it out in my mind it's not. Unless there's a game with an engine built like this already?
Comments
if this is what you are talking about, here's how I would try it:
- turn on gravity
- make the platform moveable so it can tilt, but in the behaviors constrain the x and y position.
- then set the accelerometer controls to accelerate or move the platform in a rotational motion.
- you can add invisible actors as collision barriers to limit the max tilt angle in either direction, (or you could do that with a rule).
- adjust the friction of the player and the platform so the player slides on the platform.
- you may need additional rules or collision actors if you want to prevent the actor from sliding off the platform.
hope that helps.
If the iceberg actor rotates, the image rotates for you. You don't need to animate unless the image itself is changing. orientation of the image can all be handled by GS.
If you have a iceberg background image with a flat platform in front for the actors to stand on, you can constrain the background image (a separate actor) to match the position and rotational angle of the platform actor. that way everything moves together seamlessly.
Let the physics do as much of the heavy lifting as you can