transfered from codeberg
This commit is contained in:
57
source_code/player_module/player/player.h
Normal file
57
source_code/player_module/player/player.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef player_h
|
||||
#define player_h
|
||||
|
||||
#include "chunk.h"
|
||||
#include "inventory.h"
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct world_struct;
|
||||
|
||||
typedef struct player_struct
|
||||
{
|
||||
Vector3 position;
|
||||
Vector3 velocity;
|
||||
float yaw;
|
||||
float pitch;
|
||||
float mouse_sensitivity;
|
||||
Camera3D camera;
|
||||
Vector3 corner_of_watched_block;
|
||||
Vector3 block_being_watched;
|
||||
float reach;
|
||||
float breaking_block_progress;
|
||||
bool should_highlight_block;
|
||||
bool is_breaking_block;
|
||||
bool has_entered_new_chunk;
|
||||
float movement_speed;
|
||||
|
||||
struct chunk_position_struct occupied_chunks_position;
|
||||
struct chunk_position_struct negative_borders;
|
||||
struct chunk_position_struct positive_borders;
|
||||
struct
|
||||
{
|
||||
bool below, above;
|
||||
bool left, right;
|
||||
bool front, back;
|
||||
} is_making_contact_with;
|
||||
uint8_t health;
|
||||
uint8_t fortitude;
|
||||
uint8_t selected_hotbar_slot;
|
||||
struct chunk_struct* nearby_chunks[3][3][3];
|
||||
struct inventory_struct inventory;
|
||||
} player_struct;
|
||||
|
||||
|
||||
uint8_t create_player(struct player_struct** player);
|
||||
|
||||
void destroy_player(struct player_struct** player);
|
||||
|
||||
void update_player_controller(struct player_struct *player);
|
||||
|
||||
void update_players_known_chunks(struct player_struct* player,
|
||||
struct world_struct *world);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user