Author Topic: Horribly complicated adjustment request  (Read 1212 times)

Arbieo

  • Guest
Horribly complicated adjustment request
« on: Sat, Jul 3, 2010 »
So, I was nosing through the code loking for the cause of some strange camera behavior and I came along this snippet of code in FlxGame.as

Code: [Select]
//Update the camera and game state
FlxG.doFollow();
_state.update();

It updates the camera BEFORE updating the state. Shouldn't it be:

Code: [Select]
//Update the camera and game state
_state.update();
FlxG.doFollow();

So that all the positions (especially the object being tracked!) are updated before we look at them with the camera. Otherwise, the camera is tracking objects a frame late which leads to strange behavior. Flipping these lines fixed my problems.