cleanup time-based: elimina entitats frame-based (Bullet/Item/Player/Balloon), VELX en px/s, Game::popBalloon amb vel en px/s
This commit is contained in:
@@ -33,14 +33,12 @@ class Bullet {
|
||||
auto operator=(const Bullet &) -> Bullet & = delete;
|
||||
|
||||
void render(); // Pinta el objeto en pantalla
|
||||
auto move() -> MoveResult; // Actualiza la posición y estado del objeto (frame-based)
|
||||
auto move(float dt_s) -> MoveResult; // Actualiza la posición y estado del objeto (time-based)
|
||||
auto move(float dt_s) -> MoveResult; // Actualiza la posición y estado del objeto
|
||||
void disable(); // Deshabilita el objeto
|
||||
|
||||
[[nodiscard]] auto isEnabled() const -> bool; // Comprueba si el objeto está habilitado
|
||||
[[nodiscard]] auto getPosX() const -> int; // Obtiene el valor de la variable
|
||||
[[nodiscard]] auto getPosY() const -> int; // Obtiene el valor de la variable
|
||||
[[nodiscard]] auto getVelY() const -> int; // Obtiene el valor de la variable
|
||||
[[nodiscard]] auto getKind() const -> Kind; // Obtiene el valor de la variable
|
||||
[[nodiscard]] auto getOwner() const -> int; // Obtiene el valor de la variable
|
||||
|
||||
@@ -50,7 +48,7 @@ class Bullet {
|
||||
auto getCollider() -> Circle &; // Obtiene el circulo de colisión
|
||||
|
||||
private:
|
||||
// Velocidades time-based (px/s). Derivades de les antigues px/frame * 60.
|
||||
// Velocitats en px/s (derivades de les antigues px/frame * 60).
|
||||
static constexpr float VEL_Y_PX_PER_S = -180.0F; // Era -3 px/frame
|
||||
static constexpr float VEL_X_LEFT_PX_PER_S = -120.0F; // Era -2 px/frame
|
||||
static constexpr float VEL_X_RIGHT_PX_PER_S = 120.0F; // Era +2 px/frame
|
||||
@@ -61,14 +59,12 @@ class Bullet {
|
||||
// Variables
|
||||
int pos_x_; // Posición en el eje X (px enters per al sprite/collider)
|
||||
int pos_y_; // Posición en el eje Y
|
||||
float pos_x_f_{0}; // Acumulador subpíxel per al moviment time-based
|
||||
float pos_y_f_{0}; // Acumulador subpíxel per al moviment time-based
|
||||
float pos_x_f_{0}; // Acumulador subpíxel
|
||||
float pos_y_f_{0}; // Acumulador subpíxel
|
||||
Uint8 width_; // Ancho del objeto
|
||||
Uint8 height_; // Alto del objeto
|
||||
int vel_x_; // Velocidad en el eje X (frame-based: px/frame)
|
||||
int vel_y_; // Velocidad en el eje Y (frame-based: px/frame)
|
||||
float vel_x_s_{0}; // Velocidad en el eje X (time-based: px/s)
|
||||
float vel_y_s_{0}; // Velocidad en el eje Y (time-based: px/s)
|
||||
float vel_x_s_{0}; // Velocidad en el eje X (px/s)
|
||||
float vel_y_s_{0}; // Velocidad en el eje Y (px/s)
|
||||
Kind kind_; // Tipo de objeto
|
||||
int owner_; // Identificador del dueño del objeto
|
||||
Circle collider_; // Circulo de colisión del objeto
|
||||
|
||||
Reference in New Issue
Block a user