the whole game

This commit is contained in:
Kolyah35 2026-03-02 22:04:18 +03:00
parent 816e9060b4
commit f0617a5d22
2069 changed files with 581500 additions and 0 deletions

View file

@ -0,0 +1,26 @@
#include "SandTile.h"
#include "../../entity/item/FallingTile.h"
bool SandTile::instaFall = false;
/*private*/
void SandTile::checkSlide(Level* level, int x, int y, int z)
{
int x2 = x;
int y2 = y;
int z2 = z;
if (isFree(level, x2, y2 - 1, z2) && y2 >= 0) {
int r = 32;
if (instaFall || !level->hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r)) {
level->setTile(x, y, z, 0);
while (isFree(level, x, y - 1, z) && y > 0)
y--;
if (y > 0) {
level->setTile(x, y, z, id);
}
} else {
FallingTile* e = new FallingTile(level, x + 0.5f, y + 0.5f, z + 0.5f, id);
level->addEntity(e);
}
}
}