JustAnotherDnDGame 0.1.0
Jeu de rôle tactique au d20, vue de dessus, en C++/Qt
Loading...
Searching...
No Matches
PlayerSpawn.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Valentin Eloy
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include "Core/Math/Vector2.h"
7
12
13namespace core {
14
16inline constexpr float PLAYER_WIDTH = 0.4f;
18inline constexpr float PLAYER_HEIGHT = 0.8f;
19
21[[nodiscard]] inline Vector2 playerSize() {
23}
24
31[[nodiscard]] inline Vector2 playerSpawnPosition(int column, int row) {
32 return Vector2{static_cast<float>(column) + (1.0f - PLAYER_WIDTH) * 0.5f,
33 static_cast<float>(row) + (1.0f - PLAYER_HEIGHT) * 0.5f};
34}
35
36} // namespace core
Vecteur 2D à composantes flottantes, propre à Core (sans dépendance DirectX).
Espace de noms du moteur et de la logique de jeu.
Definition Bootstrap.h:9
constexpr float PLAYER_HEIGHT
Hauteur du personnage, en unités monde.
Definition PlayerSpawn.h:18
Vector2 playerSpawnPosition(int column, int row)
Coin haut-gauche du personnage centré dans la tuile (column, row).
Definition PlayerSpawn.h:31
Vector2 playerSize()
Definition PlayerSpawn.h:21
constexpr float PLAYER_WIDTH
Largeur du personnage, en unités monde (une tuile = 1 unité).
Definition PlayerSpawn.h:16
Vecteur bidimensionnel en coordonnées monde (composantes float).
Definition Vector2.h:21