Hai. So i have been playing with the RotatingWorld made by @zachwlewis in his tutorial and i did a code for my needs. But for some kind of weird reason the screen wont have the center on player’s center when its rotating.All the code is in my world so here it is:
override public function update():void
{
super.update();
rotateTheWorld();
}
//lets rotate the world now
public function rotateTheWorld():void
{
player = FP.world.getInstance("player");
player.t.text = "cx: " + FP.screen.originX + " cy: " + FP.screen.originY;
centerScreenAt(player.x, player.y);
if (FP.screen.angle % 180 == 0) {
if(Input.pressed(Key.SPACE)){
//upwards = !upwards;
FP.screen.originX = player.x;
FP.screen.originY = player.y;
angle += 4;
}
}
else{
rotateMovement();
}
//statAngle = angle;
}
public function rotateMovement():void
{
angle += 4;
}
All i had found about this is that if i dont make the camera to follow my player :
//centerScreenAt(player.x, player.y);
the screen’s center is on the player when its rotating. Also tried to not use that line when the screen was rotating but with same result. Any ideas?Thx