le jeu des motos dans tron - retour accueil
git clone git://bebou.netlib.re/tron
Log | Files | Refs | README |
commit 35fb549f033d8d32350804e46aadb8f89edb5db2 parent 05b11ae870c271d3c15529a72aef4b27277c9b1e Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Sun, 29 Jun 2025 11:16:54 +0200 On peut resize sur l'écran titre Diffstat:
M | tron.c | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tron.c b/tron.c @@ -160,7 +160,7 @@ int main(int argc, char **argv) { while(ev.ch!=32) { tb_clear(); - display_title_screen(height, width); + display_title_screen(arena.height, arena.width); display(bikes,ticknb,arena,timeout); tb_present(); tb_poll_event(&ev); @@ -183,6 +183,10 @@ int main(int argc, char **argv) { break; } } + if (ev.type==TB_EVENT_RESIZE) { + arena.width=ev.w-10; + arena.height=ev.h-1; + } if(ev.key==27) { for (int i=0;i<bikes.count;i++) free(bikes.list[i].path); free (bikes.list);