import java.awt.*; import java.lang.*; import java.util.*; import Location; import Player; public final class Player_Pinla extends Player { private final double rotate = 0.2243; private final int maxVelocity = 7; private final int accel = 2; private final int maxShields = 120; private final int firePowerStep = 14; private final int maxFirePower = 34; private final Color myColor[] = { new Color(192, 192, 192), new Color(96, 96, 96), new Color(255, 64, 0), new Color(255, 32, 255) }; private int mx[] = new int[6]; private int my[] = new int[6]; Player_Pinla(int id, String name) { this.name = name; this.id = id; shields = maxShields; firePower = firePowerStep; alive = true; setConstants(rotate, maxVelocity, accel, maxShields, firePowerStep, maxFirePower); } public final void paint(Graphics g, int x, int y, int t) { for (int i = t; i > 0; i--) { pastX[i] = pastX[i-1]; pastY[i] = pastY[i-1]; if (pastX[i] != -1) { g.setColor(engine[i]); g.fillOval(pastX[i]+(x-1)-X, pastY[i]+(y-1)-Y, 3, 3); } } g.setColor(Color.pink); for (int i = 0; i < 5 && t == 14; i++) { if (fire[i] != -1) g.fillOval(fireX[i]+(x-1)-X, fireY[i]+(y-1)-Y, 3, 3); } g.setColor(myColor[2]); g.fillOval(x-2, y-2, 5, 5); mx[0] = x; mx[1] = x - Math.round((float) (8*Math.cos(angle))) - Math.round((float) (8*Math.sin(angle))); mx[2] = x + Math.round((float) (6*Math.cos(angle))) - Math.round((float) (3*Math.sin(angle))); mx[3] = x + Math.round((float) (8*Math.cos(angle))); mx[4] = x + Math.round((float) (6*Math.cos(angle))) + Math.round((float) (3*Math.sin(angle))); mx[5] = x - Math.round((float) (8*Math.cos(angle))) + Math.round((float) (8*Math.sin(angle))); my[0] = y; my[1] = y - Math.round((float) (8*Math.sin(angle))) + Math.round((float) (8*Math.cos(angle))); my[2] = y + Math.round((float) (6*Math.sin(angle))) + Math.round((float) (3*Math.cos(angle))); my[3] = y + Math.round((float) (8*Math.sin(angle))); my[4] = y + Math.round((float) (6*Math.sin(angle))) - Math.round((float) (3*Math.cos(angle))); my[5] = y - Math.round((float) (8*Math.sin(angle))) - Math.round((float) (8*Math.cos(angle))); g.setColor(myColor[0]); g.fillPolygon(mx,my,6); g.setColor(myColor[3]); g.drawLine(x,y, x + Math.round((float) (10*Math.cos(angle))), y + Math.round((float) (10*Math.sin(angle)))); g.setColor(myColor[1]); g.fillOval(x + Math.round((float) (1*Math.cos(angle)))-1, y + Math.round((float) (1*Math.sin(angle)))-1, 3, 3); } public final String getDescription() { return "This medium fighter is fast, but lacks good shields."; } public final int[] getData() { int temp[] = { 28, maxVelocity, accel, maxShields, firePowerStep, maxFirePower }; return temp; } }