Korrekturen und Anpassungen im Bereich Extends Object

This commit is contained in:
andreas
2014-12-08 21:02:20 +01:00
parent b7ec09a2ed
commit 9578b9915a
8 changed files with 44 additions and 7 deletions
@@ -43,7 +43,20 @@ public class ImageLoader {
break;
case 'p':
imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
//imageFileName="de/heatup/resources/images/red_bug_25x25.png";
break;
case 'q':
//imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
imageFileName="de/heatup/resources/images/little_bug_25x25_1.png";
break;
case 's':
//imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
imageFileName="de/heatup/resources/images/little_bug_25x25_2.png";
break;
case 't':
//imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
imageFileName="de/heatup/resources/images/little_bug_25x25_3.png";
break;
default:
imageFileName="de/heatup/resources/images/dummy_image.png";
break;
+4 -7
View File
@@ -8,6 +8,8 @@ import javax.imageio.ImageIO;
import de.heatup.mapengine.CollisionHandler;
import de.heatup.ui.Main;
//TODO: Magische Nummern entfernen
public class Opponent extends Player {
private static final long serialVersionUID = 1L;
@@ -63,6 +65,7 @@ public class Opponent extends Player {
this.move = false;
}
}
if ( direction == 'y' ) {
if ( CollisionHandler.checkCollision(this, 'l') ) {
this.move = false;
@@ -101,11 +104,7 @@ public class Opponent extends Player {
charDir = playerDirection;
this.move = true;
}
/*
*
*/
// Umentscheiden oder weiter in die vorgegeben Richtung
if ( ! this.move ) {
//Logger.write("Redeciding...");
@@ -115,11 +114,9 @@ public class Opponent extends Player {
if ( redecide && this.direction == this.prevd && this.i != this.previ ) {
this.i *= -1;
}
} else {
//Logger.write("Moving...");
}
this.move = true;
// Blockade auflösen, gehe doch in die Richtung aus man gekommen ist
@@ -24,6 +24,7 @@ public class StaticObject extends JComponent {
private char staticObjectType;
private int staticObjectWidth;
private int staticObjectHeight;
private int imgcounter = 0;
public StaticObject(char staticObjectType, Point location, int staticObjectWidth, int staticObjectHeight) {
this.staticObjectType = staticObjectType;
@@ -45,6 +46,32 @@ public class StaticObject extends JComponent {
if ( this.bf1 == null ) {
loadBufferedImage();
}
// this.imgcounter++;
// if ( staticObjectType == 'p' && this.imgcounter > 0 && this.imgcounter < 5 ) {
// System.out.println("hit 1");
// staticObjectType = 'p';
// loadBufferedImage();
// } if ( staticObjectType == 'p' && this.imgcounter > 5 && this.imgcounter < 10 ) {
// System.out.println("hit 2");
// staticObjectType = 'q';
// loadBufferedImage();
// }
// if ( staticObjectType == 'q' && this.imgcounter > 10 && this.imgcounter < 15 ) {
// System.out.println("hit 3");
// staticObjectType = 's';
// loadBufferedImage();
// }
// if ( staticObjectType == 's' && this.imgcounter > 15 && this.imgcounter < 20 ) {
// System.out.println("hit 4");
// staticObjectType = 't';
// loadBufferedImage();
// }
// if ( staticObjectType == 't' && this.imgcounter > 50) {
// System.out.println("hit 5");
// this.imgcounter = 0;
// staticObjectType = 'p';
// }
/*
* Skalieren der Bilder wenn größer als Bounds
Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B