Hi,
I am currently using melon.js together with pomelo to develop a 2d multiplayer space game.
Over the last few weeks I noticed several things in melon.js that did not work as expected, are missing (I changed/added some of them locally) or just cost me some time.
Until now I mainly worked on the server side code, so before I start digging deeper, I would like to set up a workflow how I can contribute things.
As I never have contributed to an open source project before, I am not sure how I should proceed.
I guess normally one would fork the repo, open an issue and make a pull request for every one of them, or just make an issue if they have no fix?
Or can I just open one issue for all the fixes I made? Do I even need to make issues (I have never used pull requests before)?
Here is a list of the things I found so far:
loader:
- unloadAll cannot work with the current implementation (res vs. name).
camera:
- bounds should be optional (allow for infinite scrolling in all directions)
- move does not match description (moves relative instead of absolute) -> add new method moveTo and update comment
- follow does not work with negative coordinates (at least in an older build, didn't try it with the current dev version).
- on the right and bottom of the screen, sprites disappear/appear once their position is outside/inside the viewport, regardless of their size.
input:
- isKeyPressed should always return key state regardless of lock state
- keydown should update lock state instead of isKeyPressed, as this function might never be called and the KEYDOWN event then always shows true for unlocked (why is this inverted?)
- register pointer event should check if rect is defined when setting _float
matrix:
- add method to set rotation to specific angle
vector:
- add method to multiply by scalar (like div(n))
state:
- when the screen is a visible object, switching to a different state does not call the onDestroyEvent of the current state before the onResetEvent of the new state is called -> remove children immediately
save:
- delete is a keyword and shows a syntax error in eclipse when used as an object key or function name -> rename delete to remove
general:
- file names should reflect the name of the class they contain (e.g. me.viewport is in camera.js, why not rename it to viewport.js?)
- one class per file would make it easier to find stuff (e.g. state.js contains ScreenObject and state)
- more consistent naming (e.g. ObjectContainer: getEntityByName vs. getChildByProp)
- defer should work like call and apply and take the context as first argument to allow deferred calls on object methods (e.g. this.draw.defer(this, context);)
Function.prototype.defer = function defer() {
return setTimeout(this.bind.apply(this, arguments), 0.01);
};