mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 12:29:44 +02:00
Collision Handler in Opponent
This commit is contained in:
@@ -8,14 +8,12 @@ import javax.imageio.ImageIO;
|
||||
|
||||
import de.heatup.cfg.Config;
|
||||
import de.heatup.logging.Logger;
|
||||
import de.heatup.mapengine.CollisionHandler;
|
||||
import de.heatup.mapengine.MapGrid;
|
||||
import de.heatup.mapengine.MapGridCell;
|
||||
|
||||
public class Opponent extends Player {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private boolean redecide = true; // Nötig sobald der Schritt in die gewollte Richtung erfolgt ist
|
||||
private Random rand = new Random();
|
||||
@@ -29,6 +27,10 @@ public class Opponent extends Player {
|
||||
private boolean blocked = false;
|
||||
private boolean move = false;
|
||||
private int blockedCounter = 0;
|
||||
|
||||
public Opponent() {
|
||||
CollisionHandler.addMovingObject(this);
|
||||
}
|
||||
|
||||
@Override protected void loadBufferedImage() {
|
||||
try {
|
||||
@@ -52,7 +54,6 @@ public class Opponent extends Player {
|
||||
this.prevX = this.getGridLocation().x;
|
||||
this.prevY = this.getGridLocation().y;
|
||||
|
||||
|
||||
// Kreuzung erkennen
|
||||
if ( d == 'x' ) {
|
||||
if ( MapGrid.getGridCell(this.getGridLocation().x, this.getGridLocation().y+1).isPath() ) {
|
||||
|
||||
Reference in New Issue
Block a user