LOGO explota
This commit is contained in:
@@ -3,39 +3,42 @@
|
||||
// © 2025 Port a C++20 amb SDL3
|
||||
|
||||
#pragma once
|
||||
#include "core/graphics/shape.hpp"
|
||||
#include "core/types.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/graphics/shape.hpp"
|
||||
#include "core/types.hpp"
|
||||
|
||||
class Enemic {
|
||||
public:
|
||||
Enemic() : renderer_(nullptr) {}
|
||||
Enemic(SDL_Renderer *renderer);
|
||||
public:
|
||||
Enemic()
|
||||
: renderer_(nullptr) {}
|
||||
Enemic(SDL_Renderer* renderer);
|
||||
|
||||
void inicialitzar();
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar() const;
|
||||
void inicialitzar();
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar() const;
|
||||
|
||||
// Getters (API pública sense canvis)
|
||||
bool esta_actiu() const { return esta_; }
|
||||
const Punt &get_centre() const { return centre_; }
|
||||
const std::shared_ptr<Graphics::Shape> &get_forma() const { return forma_; }
|
||||
void destruir() { esta_ = false; }
|
||||
// Getters (API pública sense canvis)
|
||||
bool esta_actiu() const { return esta_; }
|
||||
const Punt& get_centre() const { return centre_; }
|
||||
const std::shared_ptr<Graphics::Shape>& get_forma() const { return forma_; }
|
||||
void destruir() { esta_ = false; }
|
||||
|
||||
private:
|
||||
SDL_Renderer *renderer_;
|
||||
private:
|
||||
SDL_Renderer* renderer_;
|
||||
|
||||
// [NUEVO] Forma vectorial (compartida entre tots els enemics)
|
||||
std::shared_ptr<Graphics::Shape> forma_;
|
||||
// [NUEVO] Forma vectorial (compartida entre tots els enemics)
|
||||
std::shared_ptr<Graphics::Shape> forma_;
|
||||
|
||||
// [NUEVO] Estat de la instància (separat de la geometria)
|
||||
Punt centre_;
|
||||
float angle_; // Angle de moviment
|
||||
float velocitat_;
|
||||
float drotacio_; // Delta rotació visual (rad/s)
|
||||
float rotacio_; // Rotació visual acumulada
|
||||
bool esta_;
|
||||
// [NUEVO] Estat de la instància (separat de la geometria)
|
||||
Punt centre_;
|
||||
float angle_; // Angle de moviment
|
||||
float velocitat_;
|
||||
float drotacio_; // Delta rotació visual (rad/s)
|
||||
float rotacio_; // Rotació visual acumulada
|
||||
bool esta_;
|
||||
|
||||
void mou(float delta_time);
|
||||
void mou(float delta_time);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user