Closed abel-mak closed 2 years ago
A quick solution can be maxx
to get the maximum possible value of the current window and check the player's x
to be within range 0
and maxx
.
But a more elegant solution is designing a base class (#4) to apply this to all objects. I'm still not sure how to implement such a base class, as I've had tried before without success
player gets outside the window when moving horizontally