Browse Source

Snake rough structure

remotes/origin/David
David Moeller 11 months ago
parent
commit
42fe495bb6
  1. 28
      src/main/c/Snake/snake_start.c
  2. 0
      src/main/c/Snake/snake_start.h
  3. 5
      src/main/c/main.c

28
src/main/c/Snake/snake_start.c

@ -0,0 +1,28 @@
#include <stdio.h>
#define HEIGHT 16
#define WIDTH 16
#define AREA HEIGHT * WIDTH
typedef struct
{
char direction;
char segments[AREA];
}Snake;
void main_menu();
void snake_start(){
system("clear");
printf("Playing Snake");
getchar();
main_menu();
}
void main_menu(){
}

0
src/main/c/Snake/snake_start.h

5
src/main/c/main.c

@ -3,6 +3,7 @@
#include <stdbool.h>
#include "Template/game100.h"
#include "Snake/snake_start.h"
int main(){
bool running = true;
@ -13,7 +14,7 @@ int main(){
system("clear");
printf("Waehlen Sie eine Option:\n");
printf("\t1.Spiel1 starten\n");
printf("\t1.Snake starten\n");
printf("\t2.Spiel2 starten\n");
printf("\t3.Spiel3 starten\n");
printf("\t4.Spiel4 starten\n");
@ -25,7 +26,7 @@ int main(){
switch (option){
case 1:
//start_game1();
snake_start();
break;
case 2:
//start_game2();

Loading…
Cancel
Save