|
|
|
|
@ -135,14 +135,17 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
|
|
|
|
|
|
boolean overlaps = false;
|
|
|
|
|
boolean delete = false;
|
|
|
|
|
if(Intersector.overlaps(tempObject.getCollisionSprite(), playerSprite)){
|
|
|
|
|
overlaps = true;
|
|
|
|
|
|
|
|
|
|
if(d.getCurrentEntities()[i].getId() == 2){
|
|
|
|
|
if(Intersector.overlaps(tempObject.getCollisionSprite(), gs.getPlayer().getFullCollisionSprite())){
|
|
|
|
|
overlaps = true;
|
|
|
|
|
delete = true;
|
|
|
|
|
d.getCurrentEntities()[i].attack(d.getPlayer());
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
}
|
|
|
|
|
else if(Intersector.overlaps(tempObject.getCollisionSprite(), playerSprite)){
|
|
|
|
|
|
|
|
|
|
overlaps = true;
|
|
|
|
|
if(d.getCurrentEntities()[i].getId() != 0){
|
|
|
|
|
switch(gs.entitySprites[i].getAttackState()){
|
|
|
|
|
case 0:
|
|
|
|
|
@ -158,8 +161,6 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
for(RectangleMapObject rectangleObject : mapObjects.getByType(RectangleMapObject.class)){
|
|
|
|
|
Rectangle rectangle = rectangleObject.getRectangle();
|
|
|
|
|
@ -187,6 +188,10 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(gs.entitySprites[i].getAttackState() == 2 && d.getCurrentEntities()[i].getId() != 0){
|
|
|
|
|
gs.entitySprites[i].resetAttackState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(overlaps){
|
|
|
|
|
d.getCurrentEntities()[i].setxPos(x);
|
|
|
|
|
d.getCurrentEntities()[i].setyPos(y);
|
|
|
|
|
|