added collision for monsters (and made test world-setup)
This commit is contained in:
@@ -59,6 +59,8 @@ public class Entity {
|
||||
collisionOn = false;
|
||||
panel.collisionH.checkTile(this);
|
||||
panel.collisionH.checkObject(this, false);
|
||||
panel.collisionH.checkEntity(this, panel.npc);
|
||||
panel.collisionH.checkEntity(this, panel.monster);
|
||||
panel.collisionH.checkPlayer(this);
|
||||
|
||||
if(!collisionOn) {
|
||||
|
||||
@@ -34,8 +34,10 @@ public class Player extends Entity {
|
||||
}
|
||||
|
||||
public void setDefaultValues() {
|
||||
worldX = panel.tileSize * 23;
|
||||
worldY = panel.tileSize * 21;
|
||||
// worldX = panel.tileSize * 23;
|
||||
// worldY = panel.tileSize * 21;
|
||||
worldX = panel.tileSize * 10;
|
||||
worldY = panel.tileSize * 13;
|
||||
speed = 4;
|
||||
direction = Direction.DOWN;
|
||||
|
||||
@@ -75,6 +77,9 @@ public class Player extends Entity {
|
||||
int npcIndex = panel.collisionH.checkEntity(this, panel.npc);
|
||||
interactNPC(npcIndex);
|
||||
|
||||
// CHECK MONSTER COLLISION
|
||||
int monsterIndex = panel.collisionH.checkEntity(this, panel.monster);
|
||||
|
||||
// CHECK EVENT
|
||||
panel.eventH.checkEvent();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user