I'm a Programming Teacher. I've played games my whole life. I like supporting games that are multiplattform. I'm trying to become a Indie Game Developer. I love the old SNES RPG's and pixel art so my game is going to be a Secret of Mana 2 like game :)

Report RSS Super Refactoring

Posted by on

I have spent some time to learn the box2d wrapper from libgdx.
I made a simple abstract class that I used for every object in the game.

But I realised that the creation-code was a bloat once-run code.

And luckly I remembered my scarse Design Pattern training and figured to make a Factory for the creation process.

Not only did I remove a lot of code that was in the way in the Player class, the code was reused much more efficient in the creation process :)

And thank Linus Torvalds for Git!

To try to refactor the code without knowing a easy way to restore it would be terrifying!

Know it was 3 clicks away.

But now it works, 2 players, simple attack and a simple projectile.

I also solved some rendering bloat.

I just hope that it won't lag when i start to do more.

I've also started to use Idea IntelliJ.
Coming from Eclipse and Netbeans, it's just a really powerful IDE for Java.
It analyzes my code-style and gives superb code completion.
Git integration ofcourse.

I'm also using gradle as a build tool now, perfect for building the project on new computers :D

Code away!

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: