Muchos pequeños cambios para estandarizar y mejorar la demo
This commit is contained in:
+3
-4
@@ -1,5 +1,4 @@
|
||||
#include "ball.h"
|
||||
#include "defines.h"
|
||||
|
||||
// Constructor
|
||||
Ball::Ball(int x, int y, int w, int h, int vx, int vy, Texture *texture)
|
||||
@@ -13,8 +12,8 @@ Ball::Ball(int x, int y, int w, int h, int vx, int vy, Texture *texture)
|
||||
sprite = new Sprite(texture);
|
||||
sprite->setPos({x, y});
|
||||
sprite->setSize(w, h);
|
||||
sprite->setClip({0, 0, 24, 24});
|
||||
color = {255, 255, 255};
|
||||
sprite->setClip({0, 0, w, h});
|
||||
color = {(rand() % 192) + 32, (rand() % 192) + 32, (rand() % 192) + 32};
|
||||
}
|
||||
|
||||
// Destructor
|
||||
@@ -69,7 +68,7 @@ void Ball::update()
|
||||
|
||||
if (collision)
|
||||
{
|
||||
color = {rand() % 255, rand() % 255, rand() % 255};
|
||||
sprite->setAnimationSpeed((rand() % 15) + 5);
|
||||
}
|
||||
|
||||
// Actualiza la posición del sprite
|
||||
|
||||
Reference in New Issue
Block a user