6#include <SFML/Graphics/Color.hpp>
9#include "engine/component.h"
11#include "graphics/color.h"
13#include "maths/vec2.h"
32constexpr auto INVALID_CLIENT_ID = ClientId{ 0 };
33using Frame = std::uint32_t;
38constexpr short playerHealth = 5;
39constexpr float playerSpeed = 1.0f;
41constexpr float playerShootingPeriod = 0.3f;
42constexpr float bulletSpeed = 2.0f;
43constexpr float bulletScale = 0.2f;
44constexpr float bulletPeriod = 3.0f;
45constexpr float playerInvincibilityPeriod = 1.5f;
46constexpr float invincibilityFlashPeriod = 0.5f;
67constexpr std::array<
core::Color, std::max(4u, maxPlayerNmb)> playerColors
71 core::Color::yellow(),
75constexpr std::array<
core::Vec2f, std::max(4u, maxPlayerNmb)> spawnPositions
83constexpr std::array<
core::Degree, std::max(4u, maxPlayerNmb)> spawnRotations
93 PLAYER_CHARACTER =
static_cast<core::EntityMask>(core::ComponentType::OTHER_TYPE),
94 BULLET =
static_cast<core::EntityMask>(core::ComponentType::OTHER_TYPE) << 1u,
95 ASTEROID =
static_cast<core::EntityMask>(core::ComponentType::OTHER_TYPE) << 2u,
96 PLAYER_INPUT =
static_cast<core::EntityMask>(core::ComponentType::OTHER_TYPE) << 3u,
97 DESTROYED =
static_cast<core::EntityMask>(core::ComponentType::OTHER_TYPE) << 4u,
105namespace PlayerInputEnum
Degree is an utility class that describes degree angles (0 to 360). It can be easily converted to Rad...
Definition: angle.h:56
std::uint32_t EntityMask
EntityMask is the type used to define the bitwise mask of an Entity. It is used to know what Componen...
Definition: entity.h:22
constexpr auto INVALID_PLAYER
INVALID_PLAYER is an integer constant that defines an invalid player number.
Definition: game_globals.h:26
constexpr std::size_t maxInputNmb
maxInputNmb is the number of inputs stored into an PlayerInputPacket
Definition: game_globals.h:60
constexpr std::size_t windowBufferSize
windowBufferSize is the size of input stored by a client. 5 seconds of frame at 50 fps
Definition: game_globals.h:51
ClientId
ClientId is a type used to define the client identification. It is given by the server to clients.
Definition: game_globals.h:31
std::uint8_t PlayerNumber
PlayerNumber is a type used to define the number of the player. Starting from 0 to maxPlayerNmb.
Definition: game_globals.h:22
constexpr long long startDelay
startDelay is the delay to wait before starting a game in milliseconds
Definition: game_globals.h:56
std::uint8_t PlayerInput
PlayerInput is a type defining the input data from a player.
Definition: game_globals.h:103
constexpr float fixedPeriod
fixedPeriod is the period used in seconds to start a new FixedUpdate method in the game::GameManager
Definition: game_globals.h:64
constexpr std::uint32_t maxPlayerNmb
mmaxPlayerNmb is a integer constant that defines the maximum number of player per game
Definition: game_globals.h:37
Color is a struct defining an RGBA color with 4 bytes.
Definition: color.h:12
Vec2f is a utility class that represents a mathematical 2d vector.
Definition: vec2.h:12