1 package code
.kalter
.longflight
.space
;
3 import code
.kalter
.longflight
.Loader
;
4 import code
.kalter
.longflight
.Sprite
;
5 import java
.io
.IOException
;
6 import javax
.microedition
.lcdui
.Graphics
;
7 import javax
.microedition
.lcdui
.Image
;
14 class Egg
extends Sprite
{
16 private boolean alive
;
17 private final int maxH
;
19 public Egg(String path
, int screenW
, int maxH
) throws IOException
{
20 this(Loader
.getInstance().getImage(path
), screenW
, maxH
);
23 public Egg(Image image
, int screenW
, int maxH
) {
24 super(image
, (screenW
- image
.getWidth()) / 2, -image
.getHeight());
28 public void paint(Graphics graph
) {
43 public void activate() {
47 public void deactivate() {
49 setY(-image
.getHeight());