separació per entitats
This commit is contained in:
28
source/game/entities/bala.hpp
Normal file
28
source/game/entities/bala.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
// bala.hpp - Classe per a projectils de la nau
|
||||
// © 1999 Visente i Sergi (versió Pascal)
|
||||
// © 2025 Port a C++20 amb SDL3
|
||||
|
||||
#pragma once
|
||||
#include "core/types.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
class Bala {
|
||||
public:
|
||||
Bala() : renderer_(nullptr) {}
|
||||
Bala(SDL_Renderer *renderer);
|
||||
|
||||
void inicialitzar();
|
||||
void disparar(const Punt &posicio, float angle);
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar() const;
|
||||
|
||||
// Getters
|
||||
bool esta_activa() const { return dades_.esta; }
|
||||
const Punt &get_centre() const { return dades_.centre; }
|
||||
void desactivar() { dades_.esta = false; }
|
||||
|
||||
private:
|
||||
SDL_Renderer *renderer_;
|
||||
Poligon dades_;
|
||||
void mou(float delta_time);
|
||||
};
|
||||
Reference in New Issue
Block a user