Go to the source code of this file.
◆ FIRST_LEVEL
| #define FIRST_LEVEL 1 /** Index of the level loaded when the game starts (0 <= index < LEVEL_COUNT) */ |
◆ LEVEL_COUNT
| #define LEVEL_COUNT 2 /** Total number of levels */ |
◆ MAP_CELL_SIZE
Size of the squares that forms the map, usually is good to have it (aprox) 3 times the player collision size
◆ structures_t
Structures that can form the map
| Enumerator |
|---|
| UNDEFINED | |
| AIR | This structure is for error managing
|
| STONE | Nothing, the squares where the entities can move
|
| WOOD | |
| DOOR | |
◆ change_to_map()
| void change_to_map |
( |
const int |
level_idx | ) |
|
Updates the current map info to the map of the level_idx level
◆ draw_map_2D()
| void draw_map_2D |
( |
void |
| ) |
|
Draw in the screen a 2D matrix of squares, white being wall and blakc being floor
◆ get_camera_spwan_from_id()
Returns the player spawn point of the level_idx level, in the form of a trc_world_position_t
- Parameters
-
| level_idx | The index of the level to get (from 0 to LEVEL_COUNT) |
◆ get_map_ceiling_at()
Returnss the ceiling structure of the current map at the given position
◆ get_map_floor_at()
Returnss the floor structure of the current map at the given position
◆ get_map_offset_from_id()
| int get_map_offset_from_id |
( |
const int |
level_idx | ) |
|
Returns the level offset for the maps list, to get the map of that level
- Parameters
-
| level_idx | The index of the level to get (from 0 to LEVEL_COUNT) |
◆ get_map_size_from_id()
Returns the map size of the level_idx level, in the form of a trc_world_position_t, where x and y are the dimensions
- Parameters
-
| level_idx | The index of the level to get (from 0 to LEVEL_COUNT) |
◆ get_map_wall_at()
Returns the wall structure of the current map at the given position
◆ map_pos_to_real_pos()
Returns the windows position for the middle of the map square
◆ to_grid_pos()
Given a trc_grid_position_t (with floats) returns the corresponding cell position in the current map
◆ to_world_pos()
Given a position in a grid (with integers) returns the trc_grid_position_t with the values pointing to the same cell in the map (in the center of the cell, to be precise)
◆ update_map_wall_at()
Replaces the wall structure of the current map at the given position with the given new_wall