uniform teleportation
This commit is contained in:
parent
ad944ba385
commit
24048c387a
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue