home *** CD-ROM | disk | FTP | other *** search
- import java.util.Random;
- import java.util.Timer;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Font;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
-
- public class AFAnimationCanvas extends Canvas implements CommandListener {
- private Random random;
- private AirForceX midlet;
- private Command cmClose;
- Image bck = null;
- Image points = null;
- Image gameover = null;
- Image life = null;
- Image upperBar = null;
- Image lowerBar = null;
- Image blackout = null;
- Image levelComplete = null;
- Image ex1 = null;
- Image ex2 = null;
- Image ex3 = null;
- Image ex4 = null;
- Image ex5 = null;
- Image user = null;
- Image userLeft = null;
- Image userRight = null;
- Image userUp = null;
- Image userDown = null;
- Image userNorm = null;
- Image town = null;
- Image aim = null;
- Image fire1 = null;
- Image fire2 = null;
- Image fire = null;
- Image enemy1 = null;
- Image enemyLarge = null;
- Image enemyMediumLarge = null;
- Image enemyMediumSmall = null;
- Image enemySmallest = null;
- Image enemy1Left = null;
- Image enemy1Right = null;
- Image clockImage = null;
- Image enemyImage = null;
- // $FF: renamed from: tm java.util.Timer
- private Timer field_0;
- private Timer m_scheduler;
- // $FF: renamed from: tt AFAnimateTimerTask
- private AFAnimateTimerTask field_1;
- private int width;
- private int height;
- int keyTest;
- private int heightDiff;
- private int widthDiff;
- int upperY;
- int lowerY;
- int rightX;
- int leftX;
- int bckgrndX;
- int bckgrndY;
- int actualSizeX;
- int actualSizeY;
- int startClipX = 0;
- int xSize = 0;
- int startClipY = 0;
- int ySize = 0;
- Font theFont;
- int theLife;
- String stringTheLife;
- int scorePosX;
- int scorePosY;
- int heartX;
- int heartY;
- int pointsX;
- int pointsY;
- int theScore;
- String stringTheScore;
- boolean changeDisplay = false;
- int userX;
- int userY;
- int gameOverX;
- int gameOverY;
- boolean gameOver = false;
- int val1;
- int val2;
- int val3;
- int val4;
- int val5;
- int val6;
- int val7;
- int val8;
- int val9;
- int val10;
- int val11;
- int val12;
- int val13;
- int val14;
- int val15;
- int val16;
- int val17;
- int val18;
- int val19;
- int val20;
- int lifeBarImageX;
- int lifeBarImageY;
- int movingLifeBarImageX;
- int townX;
- int townY;
- int town2X;
- int aimX;
- int aimY;
- int counterY;
- int counterX;
- boolean moveAim = false;
- int fireX;
- int fireY;
- int fireCycleImage;
- boolean userFired = false;
- boolean displayEnemy1 = false;
- boolean resetEnemy1 = true;
- int enemy1X;
- int enemy1Y;
- int enemy1Size;
- int enemy1Dir;
- boolean en1MoveAircraft = false;
- int en1MoveCounter;
- int en1MoveCounterLimit;
- boolean en1OutBoundary = false;
- int en1DelayCounter;
- int en1DelayCounterLimit;
- boolean en1NearLeft = false;
- boolean en1NearRight = false;
- boolean en1NearUpper = false;
- boolean en1NearLower = false;
- boolean displayEn1Explosion = false;
- int en1ExCycle;
- int en1ExX;
- int en1ExY;
- int proxX;
- int proxY;
- int en1SizeCounter;
- int en1SizeCounterLimit;
- int enemyDestroyed;
- String enemyDestroyedString;
- int enemyDestroyedStringX;
- int levelLimit;
- boolean displayLevelComplete = false;
- int displayLevelCompleteCounter;
- boolean resetLevel = false;
- int clockImageX;
- int clockImageY;
- int enemyImageX;
- int enemyImageY;
- int timerCounter;
- int timeCounterSecs;
- String levelTimeString;
- int levelTimeStringX;
- int levelTime;
-
- public AFAnimationCanvas(AirForceX var1) {
- this.midlet = var1;
- this.width = ((Canvas)this).getWidth();
- this.height = ((Canvas)this).getHeight();
- this.random = new Random();
- this.cmClose = new Command("Close", 1, 1);
- ((Displayable)this).addCommand(this.cmClose);
- ((Displayable)this).setCommandListener(this);
- this.initialiseItems();
- this.field_0 = new Timer();
- this.field_1 = new AFAnimateTimerTask(this);
- this.field_0.schedule(this.field_1, 0L, 100L);
- }
-
- protected void showNotify() {
- this.theFont = Font.getFont(0, 0, 8);
- if (this.height < 110) {
- this.heightDiff = 110 - this.height;
- this.heightDiff /= 2;
- } else {
- this.heightDiff = 0;
- }
-
- if (this.width < 110) {
- this.widthDiff = 110 - this.width;
- this.widthDiff /= 2;
- } else {
- this.widthDiff = 0;
- }
-
- this.actualSizeX = (this.width - 110) / 2;
- this.startClipX = 0 + this.actualSizeX;
- this.xSize = this.width - this.actualSizeX * 2;
- this.actualSizeY = (this.height - 110) / 2;
- this.startClipY = 0 + this.actualSizeY;
- this.ySize = this.height - this.actualSizeY * 2;
- this.upperY = this.startClipY;
- this.lowerY = this.startClipY + this.ySize;
- this.leftX = this.startClipX;
- this.rightX = this.startClipX + this.xSize;
- this.bckgrndX = this.width / 2 + this.widthDiff;
- this.bckgrndY = this.height / 2 - this.heightDiff;
- this.scorePosY = this.upperY + 0 + this.heightDiff;
- this.scorePosX = this.leftX + (80 - this.widthDiff);
- this.pointsX = this.leftX + (95 - this.widthDiff);
- this.pointsY = this.upperY + 5 + this.heightDiff;
- this.gameOverX = this.width / 2;
- this.gameOverY = this.height / 2;
- this.stringTheScore = "0";
- this.theScore = 0;
- this.theLife = 4;
- this.stringTheLife = "4";
- this.userX = this.width / 2;
- this.userY = this.lowerY - (20 + this.heightDiff);
- this.lifeBarImageX = this.leftX + 13 + this.widthDiff;
- this.lifeBarImageY = this.upperY + 5 + this.heightDiff;
- this.movingLifeBarImageX = this.leftX + 13 + this.widthDiff;
- this.townX = this.leftX + 0 + this.widthDiff;
- this.town2X = this.leftX + 110 + this.widthDiff;
- this.townY = this.lowerY - (20 + this.heightDiff);
- this.aimX = this.width / 2;
- this.aimY = this.userY - 35;
- this.counterX = 0;
- this.counterY = 0;
- this.fireX = this.width / 2;
- this.fireY = this.userY - 15;
- this.enemy1Size = 0;
- this.enemy1Dir = 0;
- this.val1 = this.leftX + 10 + this.widthDiff;
- this.val2 = this.upperY - (40 + this.heightDiff);
- this.en1MoveCounter = 0;
- this.en1MoveCounterLimit = 20;
- this.val3 = this.leftX + 10 + this.widthDiff;
- this.val4 = this.rightX - (10 + this.widthDiff);
- this.val5 = this.upperY - (40 + this.heightDiff);
- this.val6 = this.lowerY - (60 + this.heightDiff);
- this.en1DelayCounter = 0;
- this.en1DelayCounterLimit = 10;
- this.en1SizeCounter = 0;
- this.en1SizeCounterLimit = 30;
- this.en1ExCycle = 0;
- this.val7 = 0;
- this.val8 = 0;
- this.enemyDestroyed = 10;
- this.enemyDestroyedString = "10";
- this.enemyDestroyedStringX = this.leftX + 50 + this.widthDiff;
- this.levelLimit = 10;
- this.clockImageX = this.leftX + 10 + this.widthDiff;
- this.clockImageY = this.upperY + 5 + this.heightDiff;
- this.enemyImageX = this.leftX + 40 + this.widthDiff;
- this.enemyImageY = this.upperY + 7 + this.heightDiff;
- this.timerCounter = 0;
- this.levelTimeString = "60";
- this.levelTime = 60;
- this.timeCounterSecs = this.levelTime;
- this.levelTimeStringX = this.leftX + 20 + this.widthDiff;
- }
-
- public void initialiseItems() {
- try {
- this.bck = Image.createImage("/sky.png");
- this.gameover = Image.createImage("/gameover.png");
- this.levelComplete = Image.createImage("/nextWave.png");
- this.ex1 = Image.createImage("/ex1.png");
- this.ex2 = Image.createImage("/ex2.png");
- this.ex3 = Image.createImage("/ex3.png");
- this.ex4 = Image.createImage("/ex4.png");
- this.ex5 = Image.createImage("/ex5.png");
- this.userLeft = Image.createImage("/userPlaneLeftB.png");
- this.userRight = Image.createImage("/userPlaneRightB.png");
- this.userUp = Image.createImage("/userPlaneUpB.png");
- this.userDown = Image.createImage("/userPlaneDownB.png");
- this.userNorm = Image.createImage("/userPlane1B.png");
- this.town = Image.createImage("/town.png");
- this.aim = Image.createImage("/aim2.png");
- this.fire1 = Image.createImage("/bullet1.png");
- this.fire2 = Image.createImage("/bullet2.png");
- this.enemyLarge = Image.createImage("/bomber1.png");
- this.enemyMediumLarge = Image.createImage("/bomber2.png");
- this.enemyMediumSmall = Image.createImage("/bomber3.png");
- this.enemySmallest = Image.createImage("/bomber4.png");
- this.enemy1Left = Image.createImage("/bomberLeft.png");
- this.enemy1Right = Image.createImage("/bomberRight.png");
- this.clockImage = Image.createImage("/clock.png");
- this.enemyImage = Image.createImage("/planeIcon.png");
- } catch (Exception var2) {
- System.out.println("error with image load: " + var2);
- }
-
- this.user = this.userNorm;
- this.enemy1 = this.enemySmallest;
- }
-
- public void paint(Graphics var1) {
- var1.setColor(0, 0, 0);
- var1.fillRect(0, 0, this.width, this.height);
- var1.setClip(this.startClipX, this.startClipY, this.xSize, this.ySize);
- var1.drawImage(this.bck, this.bckgrndX, this.bckgrndY, 3);
- var1.drawImage(this.town, this.townX, this.townY, 3);
- var1.drawImage(this.town, this.town2X, this.townY, 3);
- if (this.theLife <= 0) {
- this.gameOver = true;
- this.gameOver();
- }
-
- if (this.enemyDestroyed <= 0) {
- this.displayEnemy1 = false;
- this.resetEnemy1 = false;
- this.displayLevelComplete = true;
- this.displayLevelCompleteCounter = 0;
- this.levelLimit += 5;
- this.enemyDestroyed = this.levelLimit;
- this.theScore += 100;
- this.levelTime += 30;
- this.timeCounterSecs = this.levelTime;
- this.changeDisplay = true;
- this.timerCounter = 0;
- if (this.en1DelayCounterLimit > 1) {
- this.en1DelayCounterLimit -= 2;
- }
- }
-
- if (this.resetLevel) {
- this.resetLevel = false;
- this.resetEnemy1 = true;
- this.changeDisplay = true;
- }
-
- if (this.timerCounter >= 10) {
- this.timerCounter = 0;
- --this.timeCounterSecs;
- this.changeDisplay = true;
- } else {
- ++this.timerCounter;
- }
-
- if (this.timeCounterSecs <= 0) {
- this.gameOver = true;
- this.gameOver();
- }
-
- if (this.resetEnemy1) {
- this.resetEnemy1 = false;
- this.displayEnemy1 = true;
- this.enemy1X = (this.random.nextInt() >>> 1) % 10 * 10 + this.val1;
- this.enemy1Y = (this.random.nextInt() >>> 1) % 10 * 10 + this.val2;
- this.enemy1Size = 1;
- this.en1NearLeft = false;
- this.en1NearRight = false;
- this.en1NearUpper = false;
- this.en1NearLower = false;
- this.en1OutBoundary = false;
- this.en1MoveAircraft = false;
- this.enemy1Size = 1;
- this.enemy1 = this.enemySmallest;
- }
-
- if (this.displayEnemy1) {
- if (!this.en1MoveAircraft) {
- if (this.en1DelayCounter >= this.en1DelayCounterLimit) {
- if (this.en1OutBoundary) {
- if (this.en1NearLeft) {
- this.enemy1Dir = 3;
- this.enemy1X += 3;
- this.enemy1Y += 3;
- } else if (this.en1NearRight) {
- this.enemy1Dir = 5;
- this.enemy1X -= 3;
- this.enemy1Y += 3;
- } else if (this.en1NearUpper) {
- this.enemy1Dir = 4;
- this.enemy1Y += 3;
- } else if (this.en1NearLower) {
- this.enemy1Dir = 0;
- this.enemy1Y -= 3;
- }
-
- this.en1NearLeft = false;
- this.en1NearRight = false;
- this.en1NearUpper = false;
- this.en1NearLower = false;
- this.en1OutBoundary = false;
- } else {
- this.enemy1Dir = (this.random.nextInt() >>> 1) % 8;
- }
-
- this.en1MoveAircraft = true;
- this.en1DelayCounter = 0;
- this.en1MoveCounter = 0;
- } else {
- ++this.en1DelayCounter;
- }
- } else if (this.en1MoveAircraft) {
- if (this.en1MoveCounter >= this.en1MoveCounterLimit) {
- this.en1MoveAircraft = false;
- this.en1MoveCounter = 0;
- } else {
- ++this.en1MoveCounter;
- if (this.enemy1X <= this.val3) {
- this.en1OutBoundary = true;
- this.en1MoveAircraft = false;
- this.en1MoveCounter = 0;
- this.en1NearLeft = true;
- } else if (this.enemy1X >= this.val4) {
- this.en1OutBoundary = true;
- this.en1MoveAircraft = false;
- this.en1MoveCounter = 0;
- this.en1NearRight = true;
- } else if (this.enemy1Y <= this.val5) {
- this.en1OutBoundary = true;
- this.en1MoveAircraft = false;
- this.en1MoveCounter = 0;
- this.en1NearUpper = true;
- } else if (this.enemy1Y >= this.val6) {
- this.en1OutBoundary = true;
- this.en1MoveAircraft = false;
- this.en1MoveCounter = 0;
- this.en1NearLower = true;
- }
-
- if (this.enemy1Size != 4) {
- if (this.en1SizeCounter >= this.en1SizeCounterLimit) {
- if (this.enemy1Size == 1) {
- this.enemy1Size = 2;
- this.enemy1 = this.enemyMediumSmall;
- } else if (this.enemy1Size == 2) {
- this.enemy1Size = 3;
- this.enemy1 = this.enemyMediumLarge;
- } else if (this.enemy1Size == 3) {
- this.enemy1Size = 4;
- this.enemy1 = this.enemyLarge;
- }
-
- this.en1SizeCounter = 0;
- } else {
- ++this.en1SizeCounter;
- }
- }
-
- if (this.enemy1Dir == 0) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemyLarge) {
- this.enemy1 = this.enemyLarge;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1Y -= 2;
- }
- } else {
- --this.enemy1Y;
- }
- } else if (this.enemy1Dir == 1) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemyLarge) {
- this.enemy1 = this.enemyLarge;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1X += 2;
- this.enemy1Y -= 2;
- }
- } else {
- ++this.enemy1X;
- --this.enemy1Y;
- }
- } else if (this.enemy1Dir == 2) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemy1Right) {
- this.enemy1 = this.enemy1Right;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1X += 2;
- }
- } else {
- ++this.enemy1X;
- }
- } else if (this.enemy1Dir == 3) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemyLarge) {
- this.enemy1 = this.enemyLarge;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1X += 2;
- this.enemy1Y += 2;
- }
- } else {
- ++this.enemy1X;
- ++this.enemy1Y;
- }
- } else if (this.enemy1Dir == 4) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemyLarge) {
- this.enemy1 = this.enemyLarge;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1Y += 2;
- }
- } else {
- ++this.enemy1Y;
- }
- } else if (this.enemy1Dir == 5) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemyLarge) {
- this.enemy1 = this.enemyLarge;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1X -= 2;
- this.enemy1Y += 2;
- }
- } else {
- --this.enemy1X;
- ++this.enemy1Y;
- }
- } else if (this.enemy1Dir == 6) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemy1Left) {
- this.enemy1 = this.enemy1Left;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1X -= 2;
- }
- } else {
- --this.enemy1X;
- }
- } else if (this.enemy1Dir == 7) {
- if (this.enemy1Size == 4 & this.enemy1 != this.enemyLarge) {
- this.enemy1 = this.enemyLarge;
- }
-
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.enemy1X -= 2;
- this.enemy1Y -= 2;
- }
- } else {
- --this.enemy1X;
- --this.enemy1Y;
- }
- }
- }
- }
- }
-
- if (this.userFired) {
- if (this.fireCycleImage == 0) {
- this.fireCycleImage = 1;
- this.fire = this.fire1;
- if (!this.displayEn1Explosion) {
- this.proxX = Math.abs(this.aimX - this.enemy1X);
- this.proxY = Math.abs(this.aimY - this.enemy1Y);
- if (this.enemy1Size != 1 && this.enemy1Size != 2) {
- if (this.enemy1Size == 3 || this.enemy1Size == 4) {
- this.val7 = 12;
- this.val8 = 6;
- }
- } else {
- this.val7 = 8;
- this.val8 = 3;
- }
-
- if (this.proxX <= this.val7 & this.proxY <= this.val8) {
- this.resetEnemy1 = true;
- this.displayEnemy1 = false;
- this.en1ExX = this.enemy1X;
- this.en1ExY = this.enemy1Y;
- this.en1ExCycle = 0;
- this.displayEn1Explosion = true;
- this.theScore += 20;
- this.changeDisplay = true;
- --this.enemyDestroyed;
- }
- }
- } else if (this.fireCycleImage == 1) {
- this.fireCycleImage = 0;
- this.fire = this.fire2;
- }
- }
-
- if (this.displayEnemy1) {
- var1.drawImage(this.enemy1, this.enemy1X, this.enemy1Y, 3);
- }
-
- if (this.displayEn1Explosion) {
- if (this.en1ExCycle == 0) {
- var1.drawImage(this.ex1, this.en1ExX, this.en1ExY, 3);
- ++this.en1ExCycle;
- } else if (this.en1ExCycle == 1) {
- var1.drawImage(this.ex2, this.en1ExX, this.en1ExY, 3);
- ++this.en1ExCycle;
- } else if (this.en1ExCycle == 2) {
- var1.drawImage(this.ex3, this.en1ExX, this.en1ExY, 3);
- ++this.en1ExCycle;
- } else if (this.en1ExCycle == 3) {
- var1.drawImage(this.ex4, this.en1ExX, this.en1ExY, 3);
- ++this.en1ExCycle;
- } else if (this.en1ExCycle == 4) {
- var1.drawImage(this.ex5, this.en1ExX, this.en1ExY, 3);
- this.en1ExCycle = 0;
- this.displayEn1Explosion = false;
- }
- }
-
- if (this.userFired) {
- var1.drawImage(this.fire, this.fireX, this.fireY, 3);
- }
-
- var1.drawImage(this.user, this.userX, this.userY, 3);
- var1.drawImage(this.aim, this.aimX, this.aimY, 3);
- if (this.displayLevelComplete) {
- if (this.displayLevelCompleteCounter >= 10) {
- this.displayLevelCompleteCounter = 0;
- this.displayLevelComplete = false;
- this.resetLevel = true;
- } else {
- ++this.displayLevelCompleteCounter;
- }
-
- var1.drawImage(this.levelComplete, this.gameOverX, this.gameOverY, 3);
- }
-
- if (this.changeDisplay) {
- this.stringTheScore = Integer.toString(this.theScore);
- this.stringTheLife = Integer.toString(this.theLife);
- this.enemyDestroyedString = Integer.toString(this.enemyDestroyed);
- this.levelTimeString = Integer.toString(this.timeCounterSecs);
- this.changeDisplay = false;
- }
-
- var1.setColor(0, 0, 0);
- var1.setFont(this.theFont);
- var1.drawString(this.stringTheScore, this.scorePosX, this.scorePosY, 20);
- var1.drawString(this.enemyDestroyedString, this.enemyDestroyedStringX, this.scorePosY, 20);
- var1.drawString(this.levelTimeString, this.levelTimeStringX, this.scorePosY, 20);
- var1.drawImage(this.enemyImage, this.enemyImageX, this.enemyImageY, 3);
- var1.drawImage(this.clockImage, this.clockImageX, this.clockImageY, 3);
- if (this.gameOver) {
- var1.drawImage(this.gameover, this.gameOverX, this.gameOverY, 3);
- }
-
- }
-
- public void gameOver() {
- this.field_1.cancel();
- this.field_0.cancel();
- this.field_0 = new Timer();
- this.field_1 = new AFAnimateTimerTask(this);
- this.field_0.schedule(this.field_1, 100000L);
- }
-
- public void reStartSA() {
- this.field_0 = new Timer();
- this.field_1 = new AFAnimateTimerTask(this);
- this.field_0.schedule(this.field_1, 0L, 100L);
- this.changeDisplay = false;
- this.gameOver = false;
- this.moveAim = false;
- this.userFired = false;
- this.displayEnemy1 = false;
- this.resetEnemy1 = true;
- this.en1MoveAircraft = false;
- this.en1OutBoundary = false;
- this.en1NearLeft = false;
- this.en1NearRight = false;
- this.en1NearUpper = false;
- this.en1NearLower = false;
- this.displayEn1Explosion = false;
- this.displayLevelComplete = false;
- this.resetLevel = false;
- this.user = this.userNorm;
- this.enemy1 = this.enemySmallest;
- }
-
- protected void hideNotify() {
- }
-
- public void commandAction(Command var1, Displayable var2) {
- if (var1 == this.cmClose) {
- this.field_1.cancel();
- this.field_0.cancel();
- this.hideNotify();
- this.midlet.RRScore(this.theScore);
- this.midlet.RMSScore();
- }
-
- }
-
- protected void keyRepeated(int var1) {
- if (((Canvas)this).hasRepeatEvents()) {
- this.field_1.repeatKey = true;
- this.field_1.m_gameAction = var1;
- }
-
- }
-
- protected void keyPressed(int var1) {
- this.keyTest = ((Canvas)this).getGameAction(var1);
- switch (this.keyTest) {
- case 1:
- if (this.counterY <= 20) {
- if (this.user != this.userUp) {
- this.user = this.userUp;
- }
-
- if (this.displayEnemy1) {
- this.enemy1Y += 5;
- }
-
- this.townY += 5;
- this.val2 += 5;
- this.val5 += 5;
- this.val6 += 5;
- ++this.counterY;
- }
- break;
- case 2:
- if (this.counterX >= -10) {
- if (this.user != this.userLeft) {
- this.user = this.userLeft;
- }
-
- if (this.displayEnemy1) {
- this.enemy1X += 5;
- }
-
- this.townX += 5;
- this.town2X += 5;
- this.val1 += 5;
- this.val3 += 5;
- this.val4 += 5;
- --this.counterX;
- }
- case 3:
- case 4:
- case 7:
- case 9:
- default:
- break;
- case 5:
- if (this.counterX <= 10) {
- if (this.user != this.userRight) {
- this.user = this.userRight;
- }
-
- if (this.displayEnemy1) {
- this.enemy1X -= 5;
- }
-
- this.townX -= 5;
- this.town2X -= 5;
- this.val1 -= 5;
- this.val3 -= 5;
- this.val4 -= 5;
- ++this.counterX;
- }
- break;
- case 6:
- if (this.counterY > 0) {
- if (this.user != this.userDown) {
- this.user = this.userDown;
- }
-
- if (this.displayEnemy1) {
- this.enemy1Y -= 5;
- }
-
- this.townY -= 5;
- this.val2 -= 5;
- this.val5 -= 5;
- this.val6 -= 5;
- --this.counterY;
- }
- break;
- case 8:
- if (!this.userFired) {
- this.userFired = true;
- this.fireCycleImage = 0;
- }
- }
-
- this.field_1.repeatKey = true;
- this.field_1.m_gameAction = var1;
- }
-
- protected void keyReleased(int var1) {
- this.field_1.repeatKey = false;
- if (this.user != this.userNorm) {
- this.user = this.userNorm;
- }
-
- if (this.userFired) {
- this.userFired = false;
- }
-
- }
- }
-