Tilt to rotate the background???

Hi

I have a game that I am working on and I cannot for the life of me figure this issue out. If anyone has played Locoroco you understand the behaviour I am after. When you tilt the device the "world" rotates moving the actor. This means the gravity is always straight down but the background rotates, as do the actors placed making the floor of the platform.

Any ideas

Cheers

Comments

  • old_kipperold_kipper Member Posts: 1,420
    Create a scene large enough for the camera to rotate within it (seem to remember I did scene 600x600 with a camera size of 480x320) and then offset the camera, so its centred on the field. Constrain the angle camera to vector to angle- (x,y accelerometers). If you want foreground elements to stay with camera rotation you can also centre them on the centre of the scene and constrain them as well or offset them from centre rotation. The only problem is to get the rotation smooth and not too jumpy. This can be done by averaging the rotation over time. One day we may get rotational rate through the expressions editor (from the iOS API. It is there but GS doesn't address it at present). This would mean you could pull off a lot more tricks with inertia without having to do the storing of the angle over time.

    This is a really interesting area to play with but not everything is that easy to make work. Also you have to check everything on device and with the current problems with the viewer not locking to orientation you would have to do builds to check if you are getting things right. Hopeful the next release with address this in the viewer. I've had to halt working on this project at the moment as a result of the problem. I also had to flip to building the working file upside down on one update of GS. All very strange...
  • thegasman2000thegasman2000 Member Posts: 10
    Thanks old_kipper I am moving over from Flash and the whole myriad of options in GS is a tad overwhelming sometimes but obviously some stuff need adding. Thanks again! :D
Sign In or Register to comment.