Bullet: ara tenen animació de tres frames, encara que no es nota una puta merda
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <SDL3/SDL_stdinc.h> // Para Uint8
|
||||
#include <memory> // Para shared_ptr, unique_ptr
|
||||
#include "sprite.h" // Para Sprite
|
||||
#include "animated_sprite.h" // Para AnimatedSprite
|
||||
#include "utils.h" // Para Circle
|
||||
class Texture;
|
||||
|
||||
@@ -27,12 +27,12 @@ class Bullet
|
||||
{
|
||||
public:
|
||||
// Constructor y Destructor
|
||||
Bullet(float x, float y, BulletType bullet_type, bool powered_up, int owner, std::shared_ptr<Texture> texture);
|
||||
Bullet(float x, float y, BulletType bullet_type, bool powered, int owner);
|
||||
~Bullet() = default;
|
||||
|
||||
// Métodos principales
|
||||
void render(); // Dibuja la bala en pantalla
|
||||
BulletMoveStatus move(); // Mueve la bala y devuelve su estado
|
||||
void render(); // Dibuja la bala en pantalla
|
||||
BulletMoveStatus update(); // Actualiza el estado del objeto
|
||||
|
||||
// Estado de la bala
|
||||
bool isEnabled() const; // Comprueba si está activa
|
||||
@@ -51,7 +51,7 @@ private:
|
||||
static constexpr float BULLET_VEL_X_RIGHT_ = 2.0f;
|
||||
|
||||
// Propiedades
|
||||
std::unique_ptr<Sprite> sprite_; // Sprite con los gráficos
|
||||
std::unique_ptr<AnimatedSprite> sprite_; // Sprite con los gráficos
|
||||
|
||||
float pos_x_; // Posición en el eje X
|
||||
float pos_y_; // Posición en el eje Y
|
||||
@@ -62,6 +62,7 @@ private:
|
||||
Circle collider_; // Círculo de colisión
|
||||
|
||||
// Métodos internos
|
||||
void shiftColliders(); // Ajusta el círculo de colisión
|
||||
void shiftSprite(); // Ajusta el sprite
|
||||
void shiftColliders(); // Ajusta el círculo de colisión
|
||||
void shiftSprite(); // Ajusta el sprite
|
||||
BulletMoveStatus move(); // Mueve la bala y devuelve su estado
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user