58df58e1070cbf81a048548ae09beef6d1fc187d
1 package code
.kalter
.longflight
.space
;
3 import java
.io
.IOException
;
4 import javax
.microedition
.lcdui
.Graphics
;
7 * Космос: звёзды, планеты и фон
13 private static Space instance
;
15 public static Space
getInstance(int screenW
, int screenH
)
17 if (instance
== null) {
18 instance
= new Space(screenW
, screenH
);
23 private final Egg egg
;
24 private final Tile tile
;
25 private final Planet planet
;
26 private final Star star
;
28 private Space(int screenW
, int screenH
) throws IOException
{
29 egg
= new Egg("/gfx/ship/5.png", screenW
, screenH
);
30 tile
= new Tile("/gfx/space/background.png", screenW
, screenH
);
31 planet
= new Planet(screenW
, screenH
);
32 star
= new Star(screenW
, screenH
);
35 public void paint(Graphics graphics
) {
37 planet
.paint(graphics
);
42 public void update() {
49 public void activateEgg() {
53 public void deactivateEgg() {