mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-25 10:14:58 +01:00
Move Lab backbox updates to Graphics::updatebackground()
So that the backboxes don't go NYOOOOOOOOM.
This commit is contained in:
parent
92cd695859
commit
1c38b63a37
1 changed files with 28 additions and 23 deletions
|
@ -1964,29 +1964,6 @@ void Graphics::drawbackground( int t )
|
||||||
backboxrect.w = backboxes[i].w - 2;
|
backboxrect.w = backboxes[i].w - 2;
|
||||||
backboxrect.h = backboxes[i].h - 2;
|
backboxrect.h = backboxes[i].h - 2;
|
||||||
FillRect(backBuffer,backboxrect, bcol2);
|
FillRect(backBuffer,backboxrect, bcol2);
|
||||||
|
|
||||||
backboxes[i].x += backboxvx[i];
|
|
||||||
backboxes[i].y += backboxvy[i];
|
|
||||||
if (backboxes[i].x < -40)
|
|
||||||
{
|
|
||||||
backboxes[i].x = 320;
|
|
||||||
backboxes[i].y = fRandom() * 240;
|
|
||||||
}
|
|
||||||
if (backboxes[i].x > 320)
|
|
||||||
{
|
|
||||||
backboxes[i].x = -32;
|
|
||||||
backboxes[i].y = fRandom() * 240;
|
|
||||||
}
|
|
||||||
if (backboxes[i].y < -40)
|
|
||||||
{
|
|
||||||
backboxes[i].y = 240;
|
|
||||||
backboxes[i].x = fRandom() * 320;
|
|
||||||
}
|
|
||||||
if (backboxes[i].y > 260)
|
|
||||||
{
|
|
||||||
backboxes[i].y = -32;
|
|
||||||
backboxes[i].x = fRandom() * 320;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: //Warp zone (horizontal)
|
case 3: //Warp zone (horizontal)
|
||||||
|
@ -2200,6 +2177,34 @@ void Graphics::updatebackground(int t)
|
||||||
starsspeed[i] = 4+int(fRandom()*4);
|
starsspeed[i] = 4+int(fRandom()*4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
//Lab
|
||||||
|
for (int i = 0; i < 18; i++)
|
||||||
|
{
|
||||||
|
backboxes[i].x += backboxvx[i];
|
||||||
|
backboxes[i].y += backboxvy[i];
|
||||||
|
if (backboxes[i].x < -40)
|
||||||
|
{
|
||||||
|
backboxes[i].x = 320;
|
||||||
|
backboxes[i].y = fRandom() * 240;
|
||||||
|
}
|
||||||
|
if (backboxes[i].x > 320)
|
||||||
|
{
|
||||||
|
backboxes[i].x = -32;
|
||||||
|
backboxes[i].y = fRandom() * 240;
|
||||||
|
}
|
||||||
|
if (backboxes[i].y < -40)
|
||||||
|
{
|
||||||
|
backboxes[i].y = 240;
|
||||||
|
backboxes[i].x = fRandom() * 320;
|
||||||
|
}
|
||||||
|
if (backboxes[i].y > 260)
|
||||||
|
{
|
||||||
|
backboxes[i].y = -32;
|
||||||
|
backboxes[i].x = fRandom() * 320;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue