@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); } } } }
public Vec2 getProjectileSpawnPoint() { // TODO move to an interface like IProjectileParent or something mProjectileSpawnPoint.set( mPhysics.getX() + 3, mPhysics.getY()); // TODO change arguments to mPhysics.getProjectileSpawn return mProjectileSpawnPoint; }
public void draw(SpriteBatch sb) { sb.drawSprite( mAnimation.getFrame(), mPhysics.getX() + mDrawOffsetX, mPhysics.getY() + mDrawOffsetY, mDrawWidth, mDrawHeight); }
@Override public void preRender(PApplet p) { super.preRender(p); p.rectMode(PApplet.CENTER); p.fill(getFillColor().getRGB()); p.stroke(getStrokeColor().getRGB()); p.strokeWeight(getStrokeWeight()); }
public float getY() { return mPhysics.getY(); }
public void update(float deltaTime) { mAnimation.update(deltaTime); mPhysics.update(); }
@Override public void render(PApplet p) { p.rect(0, 0, getWidth(), getHeight()); super.render(p); }