Make game.size take zoom into consideration (#836)

* Make game.size take zoom into consideration

* Fix formatting

* Fix formatting

* Apply suggestions from code review

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* Move _sizeBuffer

* Apply suggestions from code review

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* Update list from wolfenrains suggestion

* Fix formatting

* Update CHANGELOG.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
This commit is contained in:
Lukas Klingsbo
2021-06-09 16:39:45 +02:00
committed by GitHub
parent 607c4bbdcd
commit a7fd05f2b5
7 changed files with 39 additions and 30 deletions

View File

@ -228,9 +228,7 @@ class MultipleShapes extends BaseGame
lastToAdd = createRandomCollidable(lastToAdd, screenCollidable);
final lastBottomRight =
lastToAdd.toAbsoluteRect().bottomRight.toVector2();
final screenSize = size / camera.zoom;
if (lastBottomRight.x < screenSize.x &&
lastBottomRight.y < screenSize.y) {
if (lastBottomRight.x < size.x && lastBottomRight.y < size.y) {
add(lastToAdd);
totalAdded++;
} else {