uniform teleportation

This commit is contained in:
rendo 2026-03-13 11:31:03 +05:00
commit 24048c387a

View file

@ -55,10 +55,10 @@ void Pacman::tick() {
if (this->position.y < world.bound_offset*CELL_SIZE){ if (this->position.y < world.bound_offset*CELL_SIZE){
this->position.y += world.height-2*world.bound_offset*CELL_SIZE; this->position.y += world.height-2*world.bound_offset*CELL_SIZE;
} }
if (this->position.x >= world.width-(world.bound_offset-1)*CELL_SIZE){ if (this->position.x >= world.width-world.bound_offset*CELL_SIZE){
this->position.x -= world.width-2*world.bound_offset*CELL_SIZE; this->position.x -= world.width-2*world.bound_offset*CELL_SIZE;
} }
if (this->position.y >= world.height-(world.bound_offset-1)*CELL_SIZE){ if (this->position.y >= world.height-world.bound_offset*CELL_SIZE){
this->position.y -= world.height-2*world.bound_offset*CELL_SIZE; this->position.y -= world.height-2*world.bound_offset*CELL_SIZE;
} }
} }