mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-10 12:05:22 -06:00
use modulus to skip extra rotations, use _ for repeated code
This commit is contained in:
@@ -148,6 +148,6 @@ class Level:
|
|||||||
def rotate_level(self, times_rotated):
|
def rotate_level(self, times_rotated):
|
||||||
m = np.array(self.level)
|
m = np.array(self.level)
|
||||||
print(m)
|
print(m)
|
||||||
for i in range(0, times_rotated):
|
for _ in range(0, times_rotated % 4):
|
||||||
m = np.rot90(m)
|
m = np.rot90(m)
|
||||||
self.level = m.tolist()
|
self.level = m.tolist()
|
||||||
Reference in New Issue
Block a user