From eb032b9310c50c128c838ca86c83382509b637b2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 12 Jan 2016 17:50:52 +0100 Subject: [PATCH] Aggiunta fine turno dopo aver attaccato. --- main.cpp | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/main.cpp b/main.cpp index 870b7e7..0d05532 100644 --- a/main.cpp +++ b/main.cpp @@ -201,37 +201,38 @@ class Player : public Entity } else if(input == 'a') //A { + printf("ATTACCO selezionato"); if(getch() == 224) { char atk=getch(); switch(atk) { - - case 72: //ATK SU - if(map[x][y-1]==ENEMY) - { - attack(x, y-1); - } - break; - case 80: //ATK GIU - if(map[x][y+1]==ENEMY) - { - attack(x, y+1); - } - break; - case 75: //ATK SX - if(map[x-1][y]==ENEMY) - { - attack(x-1, y); - } - break; - case 77: //ATK DX - if(map[x+1][y]==ENEMY) - { - attack(x+1, y); - } - break; + case 72: //ATK SU + if(map[x][y-1]==ENEMY) + { + attack(x, y-1); + } + break; + case 80: //ATK GIU + if(map[x][y+1]==ENEMY) + { + attack(x, y+1); + } + break; + case 75: //ATK SX + if(map[x-1][y]==ENEMY) + { + attack(x-1, y); + } + break; + case 77: //ATK DX + if(map[x+1][y]==ENEMY) + { + attack(x+1, y); + } + break; } + waiting = false; } } //Se ti sei mosso, controlla in che direzione e aggiorna correttamente la x e la y.