JohnathonNow / Bending

A 2D, multiplayer online action game.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restructure access to the Client

JohnathonNow opened this issue · comments

Right now Client has many public fields, which is sad. On top of that, many are static, which is extra sad. For example, see below where other modules access Client's fields directly.

if (isLiquid(x, y)) {
toMove *= Client.swimmingSpeed;
} else {
toMove *= Client.runningSpeed;
}

app.spellselection.XP.setText("XP: " + Client.XP);
app.spellselection.USER.setText("USER: " + Client.jtb.getText());
Client.immaKeepTabsOnYou.setSelectedIndex(1);
app.spellselection.setVisible(true);

Ultimately, I would like for Client to be split up into smaller components, as right now it is a terrible blend of game state, game logic, UI nonsense, and other things I don't even know is there. For now, however, it having everything static removed and replaced with something else - perhaps a singleton.

I'm sufficiently happy with #52 to close this for now.