le jeu des motos dans tron - retour accueil
git clone git://bebou.netlib.re/tron
Log | Files | Refs | README |
commit 30aff340aa11b09cc1a87484e54ee5ed0f37be86 parent 86f1da0eea3bb4763ad7cc36a477ea84cca873a6 Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Thu, 19 Jun 2025 19:12:47 +0200 Pour afficher les infos sur les deux voitures Diffstat:
M | tron.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tron.c b/tron.c @@ -30,7 +30,7 @@ void display(struct car *cars, int ticks, int tail, struct arena arena) { tb_printf(cars[i].path[j].x,cars[i].path[j].y,cars[i].color,0,"▒"); else tb_printf(cars[i].path[j].x,cars[i].path[j].y,cars[i].color,0,"▒"); - tb_printf(0,tb_height()-i,cars[i].color,0,"car %d - x: %d, y: %d, direction %d",i,cars[i].position.x,cars[i].position.y,cars[i].direction); + tb_printf(0,tb_height()-i-1,cars[i].color,0,"car %d - x: %d, y: %d, direction %d",i,cars[i].position.x,cars[i].position.y,cars[i].direction); } tb_print(0,0,0,0,"╭"); tb_print(0,arena.height,0,0,"╰"); @@ -93,7 +93,7 @@ int main(int argc, char **argv) { tb_set_input_mode(TB_INPUT_ESC | TB_INPUT_MOUSE); struct arena arena; - arena.width=tb_width()-1; arena.height=tb_height()-2; + arena.width=tb_width()-1; arena.height=tb_height()-3; struct tb_event ev; while(1) {