Open DidiCatman opened 7 years ago
move method in my abstract mob class:
protected enum Direction {
UP, DOWN, LEFT, RIGHT
}
protected Direction dir;
public void move(int xa, int ya) {
if (xa != 0 && ya != 0) {
move(xa, 0);
move(0, ya);
return;
}
if (xa > 0) dir = Direction.RIGHT;
if (xa < 0) dir = Direction.LEFT;
if (ya > 0) dir = Direction.DOWN;
if (ya < 0) dir = Direction.UP;
if (!collision(xa, ya)) {
x += xa;
y += ya;
}
}
can you provide this code in a new branch, to test and highlight the differences?
movement and collision should be revised. i have to simple methods in my abstract mob (your creature) class that handle movement and collision. movement works just fine. i only have some problems with collision detection with npc.