DEADSOFTWARE

Initial commit.
[LongFlight.git] / src / code / kalter / longflight / game / ship / ShipGamer.java
1 package code.kalter.longflight.game.ship;
3 import code.kalter.longflight.Loader;
4 import code.kalter.longflight.LongFlight;
5 import java.io.IOException;
6 import javax.microedition.lcdui.Image;
8 /**
9 * Все свойства корабликов игрока
10 *
11 * @author KalterFive
12 */
13 public class ShipGamer implements Ship {
15 private static ShipGamer instance;
17 public static ShipGamer getInstance() throws IOException {
18 if (instance == null) {
19 instance = new ShipGamer();
20 }
21 return instance;
22 }
24 private final int[] life;
25 private final int[] time;
26 private final int[] acceleration;
27 private final int[] velocityMax;
28 private final int[] deltaFire;
29 private final int[] speedOverheat;
30 private final Image[] image;
32 public ShipGamer() throws IOException {
33 life = new int[COUNT];
34 time = new int[COUNT];
35 acceleration = new int[COUNT];
36 velocityMax = new int[COUNT];
37 deltaFire = new int[COUNT];
38 speedOverheat = new int[COUNT];
39 image = new Image[COUNT];
41 Loader imageLoader = Loader.getInstance();
43 //TYPE: LAX
44 life[LAX] = 3;
45 time[LAX] = 2;
46 acceleration[LAX] = 2;
47 velocityMax[LAX] = 6;
48 deltaFire[LAX] = 250;
49 speedOverheat[LAX] = 4;
50 image[LAX] = imageLoader.getImage("/gfx/ship/" + LAX + ".png");
52 //TYPE: POWERFUL
53 life[POWERFUL] = 10;
54 time[POWERFUL] = 2;
55 acceleration[POWERFUL] = 2;
56 velocityMax[POWERFUL] = 4;
57 deltaFire[POWERFUL] = 300;
58 speedOverheat[POWERFUL] = 4;
59 image[POWERFUL] = imageLoader.getImage("/gfx/ship/" + POWERFUL
60 + ".png");
62 //TYPE: UNIVERSAL
63 life[UNIVERSAL] = 5;
64 time[UNIVERSAL] = 2;
65 acceleration[UNIVERSAL] = 2;
66 velocityMax[UNIVERSAL] = 8;
67 deltaFire[UNIVERSAL] = 200;
68 speedOverheat[UNIVERSAL] = 4;
69 image[UNIVERSAL] = imageLoader.getImage("/gfx/ship/" + UNIVERSAL
70 + ".png");
72 //TYPE: STRONG
73 life[STRONG] = 6;
74 time[STRONG] = 4;
75 acceleration[STRONG] = 4;
76 velocityMax[STRONG] = 24;
77 deltaFire[STRONG] = 200;
78 speedOverheat[STRONG] = 4;
79 image[STRONG] = imageLoader.getImage("/gfx/ship/" + STRONG + ".png");
80 }
82 public int getLife(int type) {
83 return life[type];
84 }
86 public int getTime(int type) {
87 return time[type];
88 }
90 public int getAcceleration(int type) {
91 return acceleration[type];
92 }
94 public int getVelocityMax(int type) {
95 return velocityMax[type];
96 }
98 public int getDeltaFire(int type) {
99 return deltaFire[type];
102 public int getSpeedOverheat(int type) {
103 return speedOverheat[type];
106 public Image getImage(int type) {
107 return image[type];