Skip to content
Snippets Groups Projects
Commit 121a0a40 authored by Arnaud Albiez's avatar Arnaud Albiez
Browse files

mise en place du main et des deplacement

parent 92582899
No related merge requests found
......@@ -2,10 +2,9 @@
#include "grid.h"
#include <stdbool.h>
int main(void){
struct Grid* grid = init_level("./level1.txt");
bool run = true;
while(run){
struct Grid* grid = init_level("./level1.txt");
Affichage_grid(grid);
char entry = fgetc(stdin);
switch(entry){
......@@ -13,7 +12,25 @@ int main(void){
run = false;
break;
}
case 'z' :{
move_player(grid, TOP);
break;
}
case 's' :{
move_player(grid, BOTTOM);
break;
}
case 'q' :{
move_player(grid, LEFT);
break;
}
case 'd' :{
move_player(grid, RIGHT);
break;
}
}
}
free_grid(grid);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment