feat: Added portals

This commit is contained in:
2025-10-06 21:07:55 +01:00
parent be49003a8d
commit 680d375b8c
9 changed files with 158 additions and 33 deletions

View File

@@ -165,6 +165,11 @@ void PlayerUpdate(F32 delta, Player *player) {
dir = V2f_Scale(NormaliseV2F(dir), PLAYER_SPEED*delta);
player->collision.pos.x += dir.x;
player->collision.pos.y += dir.y;
for(int i = 0; i < player->world->portalCount; i++) {
if(AABB_Collide(player->world->portals[0].box, player->collision)) {
player->currentArea = player->world->portals[0].area;
}
}
}
void PlayerDraw(D_Context *draw, Player *player) {