-
Notifications
You must be signed in to change notification settings - Fork 17
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
Organize FlxG
and FlxU
a tad better
#142
Comments
Sounds like a great idea to me, the 4 "sections" the functions should be split into in your opinion make a lot of sense, too! I'm thinking it should be a lot easier for newcomers to grasp what each of the classes actually does, while right now, it's more like pretty much everything is in One thing that's debateable though is the naming / the actual organization. For example, if Either way, |
Most of that logic was my attempt to make Flixel more modular. I'm still not a fan of how much of Flixel is static. It may be helpful for beginners, but just seems "dirty" to me.
The problem is, some of those classes need access to variables, such as the current My solution was to create the separate
This static variable can then be replaced with a new instance if the
There were two classes created by AdamAtomic already set up as plugins: I see anything in the |
I've had similar thoughts about making flixel more modular, and turning some of the default functionality into plugins. The problem I see is that a lot of the stuff (debugging, replays, etc) is tightly intertwined with FlxG/FlxGame and would take a lot of refactoring to fully extract out. You would also need to improve the plugin system a lot, adding the ability to intercept key presses amongst other things. |
I liked the structure you suggested, @IQAndreas . I would still polish some edges (such as using I really like that organization, but let me share some of my experience with Flixel. When I started using it, it was simple to understand the meaning (and methods) of I agree with @moly that we should turn some features into plugins (looking at you, replays!). It will be a huge work, but it will definitely make Flixel better. For me, a new and overhauled plugin system seems the way to go. |
There is an open improvement request regarding Flixel plugin system. I've added some ideas about a new plugin system there. |
FlxMathI agree with @Dovyski, it's a better idea to be clear and name this I would like to move the following "pure math" functions from
The following functions require
There is only one method for random number generation. At the moment I feel it also belongs in
|
FlxMath from Flixel Power ToolsThe following "pure math" functions are added in FlxMath from FlixelPowerTools:
"Pure math" vector functions - see earlier thoughts on
And it also contains the following random functions (see earlier thoughts about
There are a few more methods in the Flixel Power Tools' Does not use either FlxPoint or FlxRect
Uses FlxRect - Shall these be moved to things like
Uses the AS3 Rectangle, but not Point or FlxPoint - we already have a
|
Today I noticed there is also a |
FlxCoreUtilsWith only three methods, I feel the FlxCoreUtils from the Flixel Power Tools should be imported like this. Move Move |
About FlxU and FlxMath
Ok to me. The only thing I don't like is the name
They should be static methods of
I agree it should belong to |
I guess it might also be worth investigating whether the duplicates of the standard-math-functions like In HaxeFlixel, those actually turned out to be slower and have been removed. |
About FlxMath from Flixel Power Tools
Those are the functions I think we should merge into FlxMath:
Excluding the sin/cos functions (which I don't think vanilla Flixel should have), the remaining functions are just "hiding" tasks that are easy to solve, e.g. add a value then
They should be part of
The only method I would like to merge is
I guess they all should be implemented as
I agree, we should remove this function. |
@Gama11 I don't like that duplication too, but I guess a reason why Adam did this was to make Flixel "standalone". As a consequence it's easier to port it to another platform, such as iOS (you don't have to mimic any Flash package, only port Flixel code). I think we can make Flixel math function way better than their math-counterparts by using these tricks. For example, |
Although it probably wouldn't work in most AS3 libraries, in Flixel I feel it was actually a good idea (this is the type of library that ports well to other languages, as we have seen). (but of course, if the functions are slower, maybe they aren't such a good idea)
Good idea, I created an issue for that so we don't forget about it: #196
I personally think |
Ka Wing's idea of using a spreadsheet was a rather good one, so I put these two up which may help make it clear which methods everyone agrees should be moved, and which ones are still up for debate:
Does anyone disagree with the |
Yeah, that would be great. I suggested |
I got lost in so much discussions :) Are you saying the use of |
Almost. Right now, it's See: |
I'm not getting comments showing up in any of the Google Spreadsheet. Are they removed after a while, or am I doing something wrong? Also, there are several edits by anonymous users, but I can't see what they actually changed. Is there any way to view only the diff like in Git or Wikipedia edits? |
The tab at the bottom you'll see a white number on a black background next to the label. The number says the total comments on the sheet. Click on it and you'll get all comments. You can go back to previous changes by |
I can't see any of that. I checked it again in Chrome, and it appeared; must be a FireFox thing. |
I can see it in Firefox (v26, Windows 7 x64) and I'm not logged in. |
I like it! |
I suggest you guys take a look at the front ends in I don't think the three camera effects there are are really worth it to create a new class for. In HaxeFlixel we have the CameraFrontEnd for that. |
Any updates on this issue, @IQAndreas ? |
I'm looking at the spreadsheet, and thinking about in which order would be the "most efficient" when applying all the changes. Would you guys be alright with adding |
No problem, go ahead and add |
Does the front end system for |
Yeah, it like that approach. HaxeFlixel has several front ends, some we can keep, some we might drop. I would be happy with the following:
I think I messed up the concept of front end here because I labelled some entries as aliases. If I did mess things up, I need some more info :) |
Not sure you'd want to move the inputs themselves into The |
Ok, now I got it. I remember you guys handle inputs separately e.g. |
Yeah. |
This would break much existing code, but I feel
FlxG
andFlxU
are needlessly cluttered and could be split into smaller classes.The full list of proposed changes can be found in the following forum thread:
http://forums.flixel.org/index.php/topic,5675
The actual changes can be found in the following branch:
https://github.com/IQAndreas-testprojects/flixel/commits/dev_organizing_flixel
I had already merged in several other fixes into that branch; only the last 4 commits are related to this issue.
The text was updated successfully, but these errors were encountered: