Botón para anular/activar la gravedad

This commit is contained in:
2024-08-22 20:26:06 +02:00
parent af5bc7dcd6
commit 1883032be5
3 changed files with 49 additions and 11 deletions
+6
View File
@@ -115,4 +115,10 @@ void Ball::modVel(float vx, float vy)
this->vy = this->vy + vy;
onFloor = false;
stopped = false;
}
// Cambia la gravedad
void Ball::switchGravity()
{
g = g == 0.0f ? GRAVITY : 0.0f;
}