-
Notifications
You must be signed in to change notification settings - Fork 0
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
Modules that are need to be developed #2
Comments
collision checking functions eg RectsOverlap, CircleOverlaps, PointInRect, etc |
There's some non-frameworky utility stuff in Diddy and in my own personal projects that might be useful too: There's also a side-project in Diddy for multithreading, but that might be out of scope. |
I would definetely vote for these modules you mentioned. For the color, there could be a class for each color space? |
I think it would be better to have a single Color class, then use getters |
I also vote for the inclusion of classes: Vector, Matrix, Color and ArrayUtil. Please, look at the collection’s scheme in wiki, are there any questions or objections? |
Seems nice to me 👍 |
I was actually about to post my own structure proposal, but then I realised it's almost identical to that one anyway. :) pub.native: Any externed stuff goes in here and is not referenced anywhere else in the library. Anything that's not supported by a particular platform should have a NOP stub method or a pure Monkey implementation (as mentioned before). pub.math: Have separate classes for matrix/vector dimensions. ie. Matrix3, Matrix4, Vector2, Vector3. Might be nice to have a MathUtil class there somewhere too that can handle easing and interpolation. Easing/interpolation aren't really restricted to graphics, so I think they belong in the math module. It'd also be a nice place to put things like clamping, and possibly a better pseudorandom number generator. |
I have an interpolation only module (no dependencies on mojo). |
Sounds good. To be honest I think it would be useful for Color too. Tweening RGB is just horrid, but tweening HSL is lovely. Rather than restricting tweening to these kinds of data types, I propose we make Vector/Color implement an ITweenable interface that allows you to tween as many different components as you like. You could do 1000 components if you want! ;) |
Yeah, you can't really tween rgb values - I agree on that. The problem with an ITweenable interface is the following: So maybe there is an obvious solution to that? It's because I tried to do exactly that (ITweenable interface) and failed because every class has a different amount of values which it returns. EDIT: Oh, you mean the vector and color class have to implement the tweening themselves? That's a possibility. |
Haven't tested, probably has compilation errors: Interface ITweenable Class Vector2 Implements ITweenable
End Class Color Implements ITweenable
End Function Tween:Void(target:ITweenable, startValue:ITweenable, |
Well, that's great :) Tween:Float(...) ' for normal Interpolation I think handling when something is finished should be left to the user. |
Looks good but maybe not the I______ class names ;) ? I think we should try and keep things verbose. Although I dont think its sensible to require that if you want a vector in your app that you then have to import the tween lib? We have to be careful that we don't turn pub into a framework. |
Hmm... you'd want to make an event system very extendable and generic, which leaves a lot of work up to the developer, defeating the purpose of the module. |
You could do a basic callback system? |
I only prefixed the interface with I because it's sort of a standard in many languages to mark interfaces and virtual classes as such. |
Oh by the way, here's a simple Color class I just whacked together. Only a suggestion.
|
skn3, you are right. pub shouldn't be a framework. Maybe only the tweening functions itself could be a seperate module (no dependencies). |
swooclock - you could add setRGB(r, g, b, a = 1.0) and setHSL(h, s, l) for convenience. Also having some predefined ones like in XNA would be nice: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.color_members(v=xnagamestudio.31).aspx Generally I think all our classes should have a ToString() Method. |
Huh! It seems I’m late for the discussion? :) Actually, I'm glad to see such an activity - it's great! It’s a pity that I can’t take an active part yet. So, fell free to make any changes to the schema and other wiki pages, if it’s necessary. Also, I think that it's possible to add some modules already. For example, I created a repository pub.files.json (implementation by muddy_shoes) and added it as a submodule to the main repository (develop branch). In general about discussion. I agree with @skn3 that we need to be careful not to turn the pub into a framework. But I support the adding of tweening system. Callback functionality also seems useful. But I'm not sure to which group it can be included. pub.native sounds reasonable, but, in my opinion, not semantically. Although I think it is useful, and it warns about potential problems with different target. In general, I don’t mind.
I think it would make sense to merge them in one module. That is pub.math.vector includes Vector2 and Vector3 etc. |
@Shinkiro1 I had actually planned on adding those exact methods. :) Also, can we decide on a coding style? You can see mine from that code snippet, but of course I don't want to force anything on anyone. |
The wiki has the coding standards which are essentially the same as the ones in monkey. The wiki also has a collection scheme which suggests you to put the color class inside utils (which does not exist for now). |
Ok cool, I'll push a Color class soon. Regarding tweening, I'd thought of doing something like this, as it's more math-related than restricted to tweening.
Edit: @Shinkiro1 I'll see if I can integrate your tweening module with Color (without dependencies). If it looks to work well, I'll put in some vector/matrix classes and integrate those too. |
Just gotta fill in some documentation then I'll push. Basically you can write to any of Red/Green/Blue/Hue/Saturation/Luminance and it will update the colour accordingly. I've made an ImmutableColor class that's used internally to make the predefined colours immutable. I've done the Lerpable thing too, pending suggestions for a better interface name! |
You guys ok with me pushing some vector/matrix classes? They're loosely based on the libgdx ones (Vector2/Matrix3) https://github.com/libgdx/libgdx/tree/master/gdx/src/com/badlogic/gdx/math |
Oops... clicked the wrong button XD |
Of course. You are free to push whatever your want ;) |
Pushed. Note how small math.monkey is, though. I really think a lot of the functions in collisions.monkey can be moved in there instead. They seem a bit generic and not necessarily restricted to collisions. For example, DistanceBetweenPoints should really just be Length, since it's Pythagoras. There's a fine line between "providing tools for the developer" and "holding their hand". I've always leaned toward the former. |
Example:
|
But do we want to force the user to import "math" if all they want to do is just have "collisions" in their game. Everything needs to be as self contained as possible. What does everyone think the limit of importing other pub modules should be? |
This is why you use private imports. That way the module "just works", |
I agree with @swoolcock and I think we can give some freedom in the use of basic monkey modules as well as pub modules. It’s just important to not abuse it. |
Basically we can pick a handful of mandatory utility modules (hopefully no |
Ok that does make things a tad easier, I wasn't sure what way we are going. Yeah definite that utils have no imports unless they are monkey core modules. I wonder if this pub project would be beneficial with marks new github approach for monkey? OR will the two projects compete? |
I think we would all be happy if project was the part of the official Monkey repository. But I'm not sure that Mark will support the idea. He said many times that he does not believe in the success of big modules bundle. Although it might be worth a try. Maybe someone will ask Mark about it? |
shortest straw does it? lol He seemed to hint about 3rd party additions in his github thread so it could be a good oppertunity? |
Yeah, I’ve noticed it as well. I think we should ask Mark about it. But I don’t want to be intrusive :) |
lol true ;) I guess we should wait and see what happens. |
List of non-existing modules that you think are basic and they need to be developed for inclusion in the future.
The text was updated successfully, but these errors were encountered: