mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Update left-moving star BG in fixed timestep loop
Otherwise they will move too fast.
This commit is contained in:
@@ -1813,14 +1813,6 @@ void Graphics::drawbackground( int t )
|
||||
{
|
||||
FillRect(backBuffer,stars[i], getRGB(0x55,0x55,0x55));
|
||||
}
|
||||
stars[i].x -= Sint16(starsspeed[i]);
|
||||
if (stars[i].x < -10)
|
||||
{
|
||||
stars[i].x += 340;
|
||||
stars[i].y = int(fRandom() * 240);
|
||||
stars[i].w = 2;
|
||||
starsspeed[i] = 4+int(fRandom()*4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@@ -2187,6 +2179,28 @@ void Graphics::drawbackground( int t )
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::updatebackground(int t)
|
||||
{
|
||||
switch (t)
|
||||
{
|
||||
case 1:
|
||||
//Starfield
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
stars[i].w = 2;
|
||||
stars[i].h = 2;
|
||||
stars[i].x -= Sint16(starsspeed[i]);
|
||||
if (stars[i].x < -10)
|
||||
{
|
||||
stars[i].x += 340;
|
||||
stars[i].y = int(fRandom() * 240);
|
||||
stars[i].w = 2;
|
||||
starsspeed[i] = 4+int(fRandom()*4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::drawmap()
|
||||
{
|
||||
if (!foregrounddrawn)
|
||||
|
||||
Reference in New Issue
Block a user