migrat a sistema de shapes
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
// © 2025 Port a C++20 amb SDL3
|
||||
|
||||
#pragma once
|
||||
#include "core/graphics/shape.hpp"
|
||||
#include "core/types.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <memory>
|
||||
|
||||
class Nau {
|
||||
public:
|
||||
@@ -16,9 +18,9 @@ public:
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar() const;
|
||||
|
||||
// Getters
|
||||
const Punt &get_centre() const { return dades_.centre; }
|
||||
float get_angle() const { return dades_.angle; }
|
||||
// Getters (API pública sense canvis)
|
||||
const Punt &get_centre() const { return centre_; }
|
||||
float get_angle() const { return angle_; }
|
||||
bool esta_viva() const { return !esta_tocada_; }
|
||||
|
||||
// Col·lisions (Fase 10)
|
||||
@@ -26,7 +28,14 @@ public:
|
||||
|
||||
private:
|
||||
SDL_Renderer *renderer_;
|
||||
Triangle dades_;
|
||||
|
||||
// [NUEVO] Forma vectorial (compartida, només 1 instància de Nau però preparat per reutilització)
|
||||
std::shared_ptr<Graphics::Shape> forma_;
|
||||
|
||||
// [NUEVO] Estat de la instància (separat de la geometria)
|
||||
Punt centre_;
|
||||
float angle_; // Angle d'orientació
|
||||
float velocitat_; // Velocitat (px/s)
|
||||
bool esta_tocada_;
|
||||
|
||||
void aplicar_fisica(float delta_time);
|
||||
|
||||
Reference in New Issue
Block a user