-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FlxCamera
"jitters" when following a target
#134
Fix FlxCamera
"jitters" when following a target
#134
Conversation
Resolves the following issue: * FlixelCommunity#5 - AdamAtomic#227 Fix provided by [Krix](https://github.com/krix)
I have not tested the new code in a running project, but it compiles just fine without any error messages. |
I really dislike the name
refers to the current sprite state (no rotation, no scaling, etc). For that reason, I think we should replace the get property |
I don't quite follow. The function Otherwise, as far as I can tell, all functions that begin with |
You are right. The name |
Will also avoid an error if the `target` object is not a `FlxSprite`.
Allrighty then, property renamed to I also added an additional check, making sure the However, after checking the only other objects that extend |
Thanks! Your check is ok to me. It's better safe than sorry. Just nitpicking, shoudn't we drop the |
Isn't a state a type of property? I usually see functions as (1) actively "doing" something, or (2) a "dynamic getter" that returns different values based on the values passed in. Calling Just because the function does more than just |
I see your point. Most of the time I follow what you described, except when the very first idea related to the method is not related to getting a property. As I said before, just nitpicking :) |
I don't quite understand what you mean here. Could you clarify?
And I appreciate it. :) Something very important to keep in mind in discussions with me: I can be very opinionated, but that doesn't mean I'm right. This goes for everyone, if you disagree with me, please tell me so. |
"very opinionated" is good, it ensures we exchange ideas :) What I meant about the "very first idea" is: if the method returns the value of a single property, then it should be a getter. If it returns the result of a test or a combination of property values (sum, etc), then it should be a non-getter method. Try this straight analysis: dropping the use of methods, would it be possible to implement |
Well, you could see But I am adaptable. So, what's the final verdict: read-only getter or function? |
haha, I guess we convinced each other :) Just nit-picking, I would still go with a function. |
Also does some minor cleanup of making sure brace placement matches the rest of the code, and removes one unecessary comment.
Alrighty, done. I also fixed some slight formatting so Dirk's changes match the rest of the code. I haven't had a chance to test this, but I compiled the SWC and sent it to |
I have a game with that jittering bug. I will test it against your SWC and check it everything is ok. |
Fix `FlxCamera` "jitters" when following a target
This fix cause a bug with multiple cameras that are used in Mode. It doesn't show correctly. Beside this bug, Mode doesn't even show the Menu and Emitter issue. |
In |
@WingEraser I've played Mode against the last |
See here: #179 (comment) |
Resolves the following issue:
Fix provided by Krix