UnderwaterApps / overlap2d-runtime-libgdx

Overlap2D - UI and Level Editor libgdx runtime
http://overlap2d.com
Other
170 stars 96 forks source link

Add action to allow to apply forces on physics objects #89

Closed leruaa closed 8 years ago

leruaa commented 8 years ago

All is said in the titlte, I added Action.force() method that apply a force on an entity with physics at each world step.

azakhary commented 8 years ago

Hey sorry for late reply. Was busy. So this looks very useful, but, I am not sure it should be part of default Actions package, for example it is not in libGDX. What I am trying to say is, all of this changes are ok except Actions.java which should only contain essentials. Instead I would suggest adding ForceActions class to utils package, that will do the same. does it makes sense? (main reason being, whoever is not planning to use physics which can be a majority when they use o2d for UI) will not have to have this initialized by default.

leruaa commented 8 years ago

I don't mind to move all physics related actions to another class, but don't you think that the both classes should be in the same package ?

It would be a breaking change to move Actions in utils, but after all Overlap2d is still alpha...

azakhary commented 8 years ago

yeah I guess we can keep that class in same package.

leruaa commented 8 years ago

Ok I moved all the physics related actions into PhysicsActions class

azakhary commented 8 years ago

Thanks! this looks ok to me, let me just do a test run, see if things are all right.

leruaa commented 8 years ago

Did you have time to test this ?

azakhary commented 8 years ago

Yup, just checked out, made a test project, tested, and it does indeed work as it should! :) Merging now. I apologize for being unresponsive here :)