#pragma once #include "../../component/action/component_action_keep_in_rectangle.h" #include "../../component/action/component_action_shoot.h" #include "../../component/control/component_control_player.h" #include "../../component/entity/component_character.h" #include "../../component/stat/component_ammo.h" #include "../../component/stat/component_game_entity_type.h" #include "../../component/stat/component_goodies.h" #include "../../component/stat/component_invincibility.h" #include "../../component/stat/component_redirects.h" #include "../../component/stat/component_stun.h" #include "../../component/stat/component_upgrades.h" #include "../../component/stat/component_heart.h" #include "../../component/component_circle_collision.h" #include "../../ecs_component.h" #include "entity_snake.h" #include "entity_player_health_display.h" #include "entity_player_ammo_display.h" #include "entity_player_redirect_display.h" #define PLAYER_IS_SOLID false #define PLAYER_IS_BOUNCE false #define PLAYER_IS_AFFECTED_BY_GRAVITY false #define PLAYER_CONTROL_MOVE_SPEED 1 #define PLAYER_FRICTION 0.875 #define PLAYER_VELOCITY_MAX 10 #define PLAYER_ACTION_SHOOT_SPEED 10 #define PLAYER_ACTION_SHOOT_HEIGHT 60.0f #define PLAYER_ACTION_SHOOT_OFFSET 150.0f #define PLAYER_CONTROL_SHOOT_COOLDOWN 12 #define PLAYER_CONTROL_RECALL_COOLDOWN 60 #define PLAYER_CONTROL_REDIRECT_ANGLE_THRESHOLD 15 // Degrees #define PLAYER_AMMO_START 1 #define PLAYER_HEALTH_MAX 5 #define PLAYER_REDIRECTS_START 1 #define PLAYER_GAME_ENTITY_TYPE GAME_ENTITY_PLAYER #define PLAYER_ALLEGIANCE ALLEGIANCE_PLAYER #define PLAYER_INVINCIBILITY_TIMER 120 #define PLAYER_STUN_TIMER 30 #define PLAYER_CIRCLE_RADIUS 75.0f #define PLAYER_ANIMATION_SQUASH_BASE 1.0f #define PLAYER_ANIMATION_SQUASH_MULTIPLIER 0.01f #define PLAYER_ANIMATION_SQUASH_SPEED 0.01f #define PLAYER_ANIMATION_STRETCH_BASE 1.0f #define PLAYER_ANIMATION_STRETCH_MULTIPLIER 0.01f #define PLAYER_ANIMATION_STRETCH_SPEED 0.01f #define PLAYER_GOODIES_VALUE 100 static const Rectangle PLAYER_ACTION_KEEP_IN_RECTANGLE = { .x = 80, .y = 80, .w = 1820, .h = 930 }; static const ivec2 PLAYER_FRAME_SIZE = {1024, 1024}; static const ivec2 PLAYER_ATLAS_SIZE = {1, 3}; static const vec2 PLAYER_SIZE = {300.0f, 300.0f}; static const vec2 PLAYER_PHYSICS_SIZE = {60.0f, 20.0f}; void entity_player_init(ECS* ecs, u32 id, vec3 position, u32 spawnID);