DungeonCrawl
|
Implements functions for the map mode of the game. More...
#include "map_mode.h"
#include "../game.h"
#include "../inventory/inventory_mode.h"
#include "../io/input/input_handler.h"
#include "../io/io_handler.h"
#include "../io/output/common/output_handler.h"
#include "../io/output/specific/map_output.h"
#include "draw/draw_light.h"
#include "map.h"
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Functions | |
void | set_player_start_pos (const int player_x, const int player_y) |
Sets the starting position of the player. | |
vector2d_t | get_player_pos () |
Get the current player position. | |
map_mode_result_t | handle_input (const input_event_t *input_event, character_t *player) |
Functions is only exposed for testing purposes. | |
map_mode_result_t | map_mode_update (character_t *player) |
Updates the player position based on the player's input and redraws the maze. | |
void | init_map_mode (void) |
Initializes the map mode. | |
void | shutdown_map_mode (void) |
Frees any resources associated with the map mode. |
Variables | |
vector2d_t | map_anchor = {5, 2} |
vector2d_t | player_pos |
int | player_has_key = 0 |
bool | first_function_call = true |
Implements functions for the map mode of the game.
Definition in file map_mode.c.
vector2d_t get_player_pos | ( | ) |
Get the current player position.
Definition at line 33 of file map_mode.c.
map_mode_result_t handle_input | ( | const input_event_t * | input_event, |
character_t * | player ) |
Functions is only exposed for testing purposes.
Definition at line 37 of file map_mode.c.
void init_map_mode | ( | void | ) |
Initializes the map mode.
Definition at line 139 of file map_mode.c.
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 at line 116 of file map_mode.c.
void set_player_start_pos | ( | int | player_x, |
int | player_y ) |
Sets the starting position of the player.
player_x | The starting x position of the player. |
player_y | The starting y position of the player. |
Definition at line 26 of file map_mode.c.
void shutdown_map_mode | ( | void | ) |
Frees any resources associated with the map mode.
Definition at line 147 of file map_mode.c.
bool first_function_call = true |
Definition at line 23 of file map_mode.c.
vector2d_t map_anchor = {5, 2} |
Definition at line 20 of file map_mode.c.
int player_has_key = 0 |
Definition at line 22 of file map_mode.c.
vector2d_t player_pos |
Definition at line 21 of file map_mode.c.