forked from snapshot112/minigame-menu
manual??? and refactoring
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Created by snapshot112 on 10/15/25.
|
||||
*
|
||||
* A game engine that uses the can run and display games in rectangular grids.
|
||||
* The graphics are made using ncursesw.
|
||||
* The graphics are made using ncurses.
|
||||
*
|
||||
* Please make sure to initialize the game engine before running any games.
|
||||
*/
|
||||
@@ -11,6 +11,8 @@
|
||||
#define MINIGAME_MENU_GRID_GAME_ENGINE_H
|
||||
#include "rooster.h"
|
||||
|
||||
#define KEY_ESCAPE 27
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
@@ -92,25 +94,29 @@ void update_grid(rooster *gp, char c, int x, int y);
|
||||
* Display the ending screen that matches the end state of the grid.
|
||||
*
|
||||
* Input:
|
||||
* gp: A pointer to the grid.
|
||||
* gp: A pointer to the grid.
|
||||
* coordinate: The location to show the ending screen.
|
||||
*
|
||||
* Side Effects:
|
||||
* The end of game screen gets displayed with a graceful exit.
|
||||
*/
|
||||
void game_exit_screen(rooster *gp);
|
||||
void game_exit_screen(const rooster *gp, coordinate location);
|
||||
|
||||
/*
|
||||
* Waits for you to press 'q' before exiting the game.
|
||||
* Waits for you to press ENTER or SPACE before exiting the game.
|
||||
*
|
||||
* Side effect: Prints "Press 'q' to exit." game to the console.
|
||||
* Input:
|
||||
* coordinate: The location to show the message.
|
||||
*
|
||||
* Side effect: Prints "Press ENTER or SPACE to exit." game to the console.
|
||||
*/
|
||||
void graceful_exit(void);
|
||||
void graceful_exit(coordinate message_location);
|
||||
|
||||
/*
|
||||
* Initialize ncurses.
|
||||
*
|
||||
* This enables cbreak, noecho, hides the cursor and enables the extra keys.
|
||||
* This also creates the color pairs needed for game_colors,
|
||||
* This also creates the color pairs needed for game_colors and sets ESCDELAY to 0.
|
||||
*/
|
||||
void init_engine(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user