Implement input.c

- Implement input handling in input.c
  - test successful
- Add missing function showPauseScreen to menu.h/c
This commit is contained in:
jonny_jr9
2023-11-11 13:39:54 +01:00
parent 061b4431c7
commit d94eed0136
5 changed files with 113 additions and 9 deletions

View File

@@ -1,8 +1,6 @@
#pragma once
void processInputEvent();
//wird von SDL aufgerufen, wenn Taste gedrückt wurde
//bekommt Info darüber, welche Taste gedrückt wurde
//ruft zugehörige Aktion über switch caseauf
// z.B. bei Pfeiltaste -> rufe snakeSetDir auf
// im Menü bei Settings -> rufe menuNavigate auf
// checks for and processes queued SDL input events and passes them
// to menu.c or controls snake depending on current game.gameState
// => has to be run repeatedly from main()
void processInputEvent();

View File

@@ -1,15 +1,19 @@
#pragma once
#include "SDL.h"
void showStartScreen();
//zum Starten Enter drücken
//optional: "E" eingeben für Settings
void showPauseScreen();
void showLeaderboard();
//zeigt die besten Spieldurchläufe inkl. Punktestand an
void showSettings(); //optional
//startet Settungs-Menü
void menuHandleInput(int event); //als Übergabeparameter: int(?) event -> welcher Datentyp hängt von SDL ab
void menuHandleInput(SDL_Event event); //als Übergabeparameter: int(?) event -> welcher Datentyp hängt von SDL ab
//switch case für welcher Modus
//switch case für welche Taste gedrückt wurde