separació per entitats
This commit is contained in:
33
source/game/entities/nau.hpp
Normal file
33
source/game/entities/nau.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
// nau.hpp - Classe per a la nave del jugador
|
||||
// © 1999 Visente i Sergi (versió Pascal)
|
||||
// © 2025 Port a C++20 amb SDL3
|
||||
|
||||
#pragma once
|
||||
#include "core/types.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
class Nau {
|
||||
public:
|
||||
Nau() : renderer_(nullptr) {}
|
||||
Nau(SDL_Renderer *renderer);
|
||||
|
||||
void inicialitzar();
|
||||
void processar_input(float delta_time);
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar() const;
|
||||
|
||||
// Getters
|
||||
const Punt &get_centre() const { return dades_.centre; }
|
||||
float get_angle() const { return dades_.angle; }
|
||||
bool esta_viva() const { return !esta_tocada_; }
|
||||
|
||||
// Col·lisions (Fase 10)
|
||||
void marcar_tocada() { esta_tocada_ = true; }
|
||||
|
||||
private:
|
||||
SDL_Renderer *renderer_;
|
||||
Triangle dades_;
|
||||
bool esta_tocada_;
|
||||
|
||||
void aplicar_fisica(float delta_time);
|
||||
};
|
||||
Reference in New Issue
Block a user