0 Replies Latest reply on Dec 15, 2010 2:37 PM by angryannoyance

    Player centered in screen?


      Okay so i want the player to always be centered in the middle of the screen left and right as well as top and bottom.


      heres what i have now only centered left and right.




      onEnterFrame = function(){ //this function will run every frame (needed for moving the character

           if(Key.isDown(37) || Key.isDown(65)){ //if the "A" key or Left Arrow Key is Down

                          lvlHolder._x += mainSpeed;//then the move the guy left

                          lvlHolder.bgHolder._x -= mainSpeed*.5;

           } else if(Key.isDown(39) || Key.isDown(68)){//if the "D" key or Right Arrow Key is Down

                          lvlHolder._x -= mainSpeed; //then move the guy to the right

                          lvlHolder.bgHolder._x += mainSpeed*.5;