The "should I re-factor" conundrum

An honest question here but can guarantee it has varying answers from a wide range of people with different experience and preference.

I have a little game project I have been messing around with and I have most things neatish and maintainable however I have this one damn class called WorldRenderer and it is HORRIBLE.

It holds all my cameras and backgrounds for the game, so if I wanted to (which I do) add some menus I would need to not use this class unless I create a state system and only runs certain parts of the render code depending on the games state. Which will make the class look WORSE.

Here it is for you to laugh at : https://bitbucket.org/Gibbo/falling-rocks/src/841b4e29ad5e7ac8800a484a778f10161a04cf21/FallingRocks/src/com/gibbo/fallingrocks/engine/WorldRenderer.java?at=master

So yeah, how do you determine a good time to re-factor working but horrible looking code?

That wasn’t so messy than I thought. :smiley:

For menus you could use just another Screen. Or if you are doing HUD then go for Scene2D.ui.

It is a little :stuck_out_tongue: it has the healthbar sprite for the player…it has random input handling, its got very little documentation. It really is an eyes sore imo, it could be worse but the thing is, it could easily be better lol.

Oh oh oh. If you think that’s bad, you should see my code…