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
;
9 * Все свойства корабликов игрока
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();
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();
46 acceleration
[LAX
] = 2;
49 speedOverheat
[LAX
] = 4;
50 image
[LAX
] = imageLoader
.getImage("/gfx/ship/" + LAX
+ ".png");
55 acceleration
[POWERFUL
] = 2;
56 velocityMax
[POWERFUL
] = 4;
57 deltaFire
[POWERFUL
] = 300;
58 speedOverheat
[POWERFUL
] = 4;
59 image
[POWERFUL
] = imageLoader
.getImage("/gfx/ship/" + POWERFUL
65 acceleration
[UNIVERSAL
] = 2;
66 velocityMax
[UNIVERSAL
] = 8;
67 deltaFire
[UNIVERSAL
] = 200;
68 speedOverheat
[UNIVERSAL
] = 4;
69 image
[UNIVERSAL
] = imageLoader
.getImage("/gfx/ship/" + UNIVERSAL
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");
82 public int getLife(int type
) {
86 public int getTime(int type
) {
90 public int getAcceleration(int type
) {
91 return acceleration
[type
];
94 public int getVelocityMax(int type
) {
95 return velocityMax
[type
];
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
) {