Skip to content
Snippets Groups Projects
main.c 638 B
Newer Older
#include "grid.h"
#include <stdbool.h>
#include <stdio.h>
int main(void)
{
  struct Grid *grid = init_level("./level1.txt");
  bool run = true;
  while (run)
  {
    Affichage_grid(grid);
    char entry = fgetc(stdin);
Arnaud Albiez's avatar
Arnaud Albiez committed
	printf("%c\n", entry);
    switch (entry)
    {
    case 'e': {
      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;
    }
Arnaud Albiez's avatar
Arnaud Albiez committed
	case "\n":{
		
	}