arreglos d'estil

This commit is contained in:
2025-03-24 14:08:26 +01:00
parent 29b18e30b5
commit 9bc129e9b0
3 changed files with 96 additions and 93 deletions
+5 -5
View File
@@ -1,16 +1,16 @@
#include "ball.h"
#include <stdlib.h> // for rand
#include <cmath> // for fabs
#include "defines.h" // for BALL_SIZE, Color, SCREEN_HEIGHT, GRAVITY_FORCE
#include <stdlib.h> // for rand
#include <cmath> // for fabs
#include "defines.h" // for BALL_SIZE, Color, SCREEN_HEIGHT, GRAVITY_FORCE
class Texture;
// Constructor
Ball::Ball(float x, float vx, float vy, Color color, std::shared_ptr<Texture> texture)
: sprite_(std::make_unique<Sprite>(texture)),
pos_({x, 0.0f, BALL_SIZE, BALL_SIZE})
{
pos_ = {x, 0.0f, BALL_SIZE, BALL_SIZE};
vx_ = vx;
vy_ = vy;
sprite_ = std::make_unique<Sprite>(texture);
sprite_->setPos({pos_.x, pos_.y});
sprite_->setSize(BALL_SIZE, BALL_SIZE);
sprite_->setClip({0, 0, BALL_SIZE, BALL_SIZE});