Gornova/MarteEngine — Issue #74: Duplicate debugging code
Author: Stef569
Created: 2012-02-15 22:41:26+00:00
State: open

The debug rectangle is rendered 2 times:
In World @ https://github.com/Gornova/MarteEngine/blob/master/src/it/marteEngine/World.java#L137
In Entity @ https://github.com/Gornova/MarteEngine/blob/master/src/it/marteEngine/entity/Entity.java#L277

g.setColor(ME.borderColor);
Rectangle hitBox = new Rectangle(e.x + e.hitboxOffsetX, e.y
+ e.hitboxOffsetY, e.hitboxWidth, e.hitboxHeight);
g.draw(hitBox);
g.setColor(Color.white);

Maybe debugging code should be in 1 place. A DebugEntity extends Entity maybe this class would wrap a normal Entity. This DebugEntity would then render all debug information and at the start of the render method do super.render. Keeps Entity cleaner...