11 Replies Latest reply on Jul 14, 2011 7:41 AM by kglad

    Question about 2d sprite animation..


      So, I am developing an ios app, and it is a simple platformer game. I have a 2dimensional sprite that sits in the center of the stage, and never moves.. When the accelorometer is tilted, the stage moves around the main Character, but only horizontally.. How can I get the accelorometer to simply flip the main characters image, so that he faces where he appears to be heading? Again, this game is for the iPhone/iPod platform, so anybody with knolege of coding is greatly needed to explain this to me.

      __________This is a simple code I used for moving the stage around the Character________________


      /* Move with Accelerometer Allows the object to be moved by tilting the mobile device.  Instructions: 1. To increase or decrease the amount of movement, replace the number 30 below with the number of pixels you want the symbol instance to move when tilting the mobile device. Note the number 30 appears twice in the code below. */  var fl_Accelerometer_3:Accelerometer = new Accelerometer(); fl_Accelerometer_3.addEventListener(AccelerometerEvent.UPDATE, fl_AccelerometerUpdateHandler_3);  function fl_AccelerometerUpdateHandler_3(event:AccelerometerEvent):void {      levelone.x+= event.accelerationX*30;       }


      If anymore info is needed to help you help me, don't hesitate to ask.