@Override public void render() { super.render(); ArrayList<Long> selected = Application.get().getLogic().getGame().getSelectedWeapons(); if (selected.size() > 0) { if (selected.size() > 1) { int i = 0; for (long a : Application.get().getLogic().getGame().getSelectedWeapons()) { GameActor actor = Application.get().getLogic().getActor(a); StatusComponent sc = (StatusComponent) actor.getComponent("StatusComponent"); Renderer.get().drawText(sc.getActorName(), x + 40, y + 50 + i * 20, 0.5f); i++; } } else { GameActor actor = Application.get().getLogic().getActor(selected.get(0)); StatusComponent sc = (StatusComponent) actor.getComponent("StatusComponent"); WeaponsComponent wc = (WeaponsComponent) actor.getComponent("WeaponsComponent"); PhysicsComponent pc = (PhysicsComponent) actor.getComponent("PhysicsComponent"); Renderer.get().drawText(sc.getActorName(), x + 40, y + 50, 0.5f); Renderer.get().drawText("Health: " + pc.getHealth(), x + 40, y + 70, 0.5f); if (wc != null) { Renderer.get().drawText("Damage: " + wc.getDamage(), x + 40, y + 90, 0.5f); Renderer.get().drawText("Range: " + wc.getRange(), x + 40, y + 110, 0.5f); } } } }
@Override public boolean onMouseDown(int mX, int mY, int button) { if (button == 0 && mX > x && mX < x + width && mY > y && mY < y + height) { Application.get().getHumanView().addScreen(ShopScreenFactory.create()); return true; } return false; }
@Override public boolean onMouseDown(int mX, int mY, int button) { if (button == 0 && mX > x && mX < x + width && mY > y && mY < y + height) { Application.get().getEventManager().queueEvent(new GameStateChangeEvent(state)); return true; } return false; }