mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 11:29:46 +02:00
Korrekturen und Anpassungen im Bereich Extends Object
This commit is contained in:
@@ -43,6 +43,19 @@ public class ImageLoader {
|
|||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
imageFileName="de/heatup/resources/images/little_blue_guy_verysmall.png";
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
imageFileName="de/heatup/resources/images/dummy_image.png";
|
imageFileName="de/heatup/resources/images/dummy_image.png";
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import javax.imageio.ImageIO;
|
|||||||
import de.heatup.mapengine.CollisionHandler;
|
import de.heatup.mapengine.CollisionHandler;
|
||||||
import de.heatup.ui.Main;
|
import de.heatup.ui.Main;
|
||||||
|
|
||||||
|
//TODO: Magische Nummern entfernen
|
||||||
|
|
||||||
public class Opponent extends Player {
|
public class Opponent extends Player {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -63,6 +65,7 @@ public class Opponent extends Player {
|
|||||||
this.move = false;
|
this.move = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( direction == 'y' ) {
|
if ( direction == 'y' ) {
|
||||||
if ( CollisionHandler.checkCollision(this, 'l') ) {
|
if ( CollisionHandler.checkCollision(this, 'l') ) {
|
||||||
this.move = false;
|
this.move = false;
|
||||||
@@ -102,10 +105,6 @@ public class Opponent extends Player {
|
|||||||
this.move = true;
|
this.move = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Umentscheiden oder weiter in die vorgegeben Richtung
|
// Umentscheiden oder weiter in die vorgegeben Richtung
|
||||||
if ( ! this.move ) {
|
if ( ! this.move ) {
|
||||||
//Logger.write("Redeciding...");
|
//Logger.write("Redeciding...");
|
||||||
@@ -115,11 +114,9 @@ public class Opponent extends Player {
|
|||||||
if ( redecide && this.direction == this.prevd && this.i != this.previ ) {
|
if ( redecide && this.direction == this.prevd && this.i != this.previ ) {
|
||||||
this.i *= -1;
|
this.i *= -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Logger.write("Moving...");
|
//Logger.write("Moving...");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.move = true;
|
this.move = true;
|
||||||
|
|
||||||
// Blockade auflösen, gehe doch in die Richtung aus man gekommen ist
|
// 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 char staticObjectType;
|
||||||
private int staticObjectWidth;
|
private int staticObjectWidth;
|
||||||
private int staticObjectHeight;
|
private int staticObjectHeight;
|
||||||
|
private int imgcounter = 0;
|
||||||
|
|
||||||
public StaticObject(char staticObjectType, Point location, int staticObjectWidth, int staticObjectHeight) {
|
public StaticObject(char staticObjectType, Point location, int staticObjectWidth, int staticObjectHeight) {
|
||||||
this.staticObjectType = staticObjectType;
|
this.staticObjectType = staticObjectType;
|
||||||
@@ -46,6 +47,32 @@ public class StaticObject extends JComponent {
|
|||||||
loadBufferedImage();
|
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
|
* 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 |
Reference in New Issue
Block a user