1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Add entityclass::nocollisionat()

This function will disable a block instead of removing it entirely,
mimicking the previous `active` system of 2.2.
This commit is contained in:
Misa 2020-10-09 15:35:50 -07:00 committed by Ethan Lee
parent b3b1a0696b
commit d8cee4866e
2 changed files with 17 additions and 0 deletions

View file

@ -1081,6 +1081,21 @@ void entityclass::removeblockat( int x, int y )
}
}
void entityclass::nocollisionat(int x, int y)
{
for (size_t i = 0; i < blocks.size(); i++)
{
if (blocks[i].xp == x && blocks[i].yp == y)
{
blocks[i].wp = 0;
blocks[i].hp = 0;
blocks[i].rect.w = blocks[i].wp;
blocks[i].rect.h = blocks[i].hp;
}
}
}
void entityclass::removetrigger( int t )
{
for(size_t i=0; i<blocks.size(); i++)

View file

@ -79,6 +79,8 @@ public:
void removeblockat(int x, int y);
void nocollisionat(int x, int y);
void removetrigger(int t);
void copylinecross(int t);