FlixelCommunity / flixel

Community fork of Adam “Atomic” Saltsman's popular game engine Flixel. Distilled from a variety of Flash games he worked on over the last couple years, including Gravity Hook, Fathom and Canabalt, its primary function is to provide some useful base classes that you can extend to make your own game objects.
http://flixelcommunity.org/
Other
84 stars 17 forks source link

Fix offset by one in STYLE_LOCKON camera mode. #189

Closed Dovyski closed 10 years ago

Dovyski commented 10 years ago

This pull request fixes the offset by one in STYLE_LOCKON camera mode by replacing ceil() with floor() for the targetX and targetY adjustmentns. As pointed out here, the use of floor() fixes the problem. This change does not interfere with the camera jittering fix, which remains in place and working.

WingEraser commented 10 years ago

Lol, I just tested master and we forgot this. Run Mode and see for yourself. FlxCamera::follow()

deadzone = new FlxRect((width-w)/2,(height-h)/2 - h * 0.25,w,h);

deadzone = new FlxRect((width-w)/2,(height-h)/2,w,h);

IQAndreas commented 10 years ago

Lol, I just tested master and we forgot this.

http://www.youtube.com/watch?v=WWaLxFIVX1s

Well, I did some digging and found out why that extra bit was added. It seems like the offending commit that was supposed to fix problems with jittering also included changes which fixed a few minor unrelated things in FlxCamera (one of which didn't actually need fixing).

The (hopefully) final pull request can be found at https://github.com/FlixelCommunity/flixel/pull/191, after which I will undo the merge and re-merge with the final changes (I would hate to have ugly commit history in there).

IQAndreas commented 10 years ago

Lol, I just tested master and we forgot this.

Final camera bug fixed in 064b978ed460bc8cfca0eb9598e68320fb465e17

(I was going to close this issue as well, but turns out it's already closed)