import java.awt.*; import java.lang.*; import java.util.*; import Location; import Player; public final class Player_Multiel extends Player { private final double rotate = 0.2618; private final int maxVelocity = 8; private final int accel = 2; private final int maxShields = 100; private final int firePowerStep = 12; private final int maxFirePower = 30; private final Color myColor[] = { new Color(30, 0, 128), new Color(64, 0, 255), new Color(255, 128, 0), new Color(128, 255, 32) }; Player_Multiel(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[0]); g.fillOval(x-6, y-6, 13, 13); g.setColor(myColor[3]); g.fillOval(x-1, y-1, 3, 3); g.setColor(Color.white); g.drawLine(x + Math.round((float) (4*Math.cos(angle))), y + Math.round((float) (4*Math.sin(angle))), x + Math.round((float) (8*Math.cos(angle))), y + Math.round((float) (8*Math.sin(angle))) ); g.setColor(myColor[2]); g.drawLine( x - Math.round((float) (6*Math.cos(angle))) + Math.round((float) (4*Math.sin(angle))), y - Math.round((float) (6*Math.sin(angle))) - Math.round((float) (4*Math.cos(angle))), x - Math.round((float) (8*Math.cos(angle))) + Math.round((float) (4*Math.sin(angle))), y - Math.round((float) (8*Math.sin(angle))) - Math.round((float) (4*Math.cos(angle))) ); g.drawLine( x - Math.round((float) (6*Math.cos(angle))) - Math.round((float) (4*Math.sin(angle))), y - Math.round((float) (6*Math.sin(angle))) + Math.round((float) (4*Math.cos(angle))), x - Math.round((float) (8*Math.cos(angle))) - Math.round((float) (4*Math.sin(angle))), y - Math.round((float) (8*Math.sin(angle))) + Math.round((float) (4*Math.cos(angle))) ); g.setColor(myColor[1]); g.drawLine( x + Math.round((float) (4*Math.sin(angle))), y - Math.round((float) (4*Math.cos(angle))), x - Math.round((float) (6*Math.cos(angle))) + Math.round((float) (4*Math.sin(angle))), y - Math.round((float) (6*Math.sin(angle))) - Math.round((float) (4*Math.cos(angle))) ); g.drawLine( x - Math.round((float) (4*Math.sin(angle))), y + Math.round((float) (4*Math.cos(angle))), x - Math.round((float) (6*Math.cos(angle))) - Math.round((float) (4*Math.sin(angle))), y - Math.round((float) (6*Math.sin(angle))) + Math.round((float) (4*Math.cos(angle))) ); } public final String getDescription() { return "This light fighter is fast, but lacks fire power."; } public final int[] getData() { int temp[] = { 24, maxVelocity, accel, maxShields, firePowerStep, maxFirePower }; return temp; } }