millorat el rebot dalt
arreglada la repetició de la tecla space
This commit is contained in:
+5
-3
@@ -67,7 +67,7 @@ void Ball::update()
|
||||
{
|
||||
y = 0;
|
||||
vy = -vy;
|
||||
vy = -vy * loss;
|
||||
//vy = -vy * loss;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones con la parte inferior
|
||||
@@ -90,7 +90,6 @@ void Ball::update()
|
||||
{
|
||||
vx = 0.0f;
|
||||
stopped = true;
|
||||
// exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +108,10 @@ void Ball::render()
|
||||
// Modifica la velocidad
|
||||
void Ball::modVel(float vx, float vy)
|
||||
{
|
||||
this->vx = this->vx + vx;
|
||||
if (stopped)
|
||||
{
|
||||
this->vx = this->vx + vx;
|
||||
}
|
||||
this->vy = this->vy + vy;
|
||||
onFloor = false;
|
||||
stopped = false;
|
||||
|
||||
Reference in New Issue
Block a user