DungeonCrawl
Loading...
Searching...
No Matches
map_mode.h
Go to the documentation of this file.
1
5#ifndef MAP_MODE_H
6#define MAP_MODE_H
7
9#include "../common.h"
11
12// Notcurses uses RGB channels directly, but we can define our colors for consistency
13#define COLOR_FOREGROUND 0xffffff// White
14#define COLOR_BACKGROUND 0x000000// Black
15
16#define LIGHT_RADIUS 3
17
18typedef enum {
19 CONTINUE,
20 QUIT,
21 NEXT_FLOOR,
22 COMBAT,
23 SHOW_MENU,
24 SHOW_STATS,
25 SHOW_INVENTORY
26} map_mode_result_t;
27
34void set_player_start_pos(int player_x, int player_y);
35
41
46map_mode_result_t map_mode_update(character_t* player);
47
51void init_map_mode(void);
55void shutdown_map_mode(void);
56
57// has to be exposed for testing
61map_mode_result_t handle_input(const input_event_t* input_event, character_t* player);
62#endif//MAP_MODE_H
Exposes functions for working working with the character.
Defines common macros, types, and global variables for color schemes and utilities.
Exposes functions for working with input.
map_mode_result_t handle_input(const input_event_t *input_event, character_t *player)
Functions is only exposed for testing purposes.
Definition map_mode.c:37
void set_player_start_pos(int player_x, int player_y)
Sets the starting position of the player.
Definition map_mode.c:26
map_mode_result_t map_mode_update(character_t *player)
Updates the player position based on the player's input and redraws the maze.
Definition map_mode.c:116
void init_map_mode(void)
Initializes the map mode.
Definition map_mode.c:139
vector2d_t get_player_pos()
Get the current player position.
Definition map_mode.c:33
void shutdown_map_mode(void)
Frees any resources associated with the map mode.
Definition map_mode.c:147
Structure for advanced input events with context data.
Definition input_types.h:43
2-dimensional vector struct
Definition common.h:164