Skip to content

Commit

Permalink
Spawn rotated towards centre see #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mryellow committed Jul 27, 2017
1 parent fa4b03a commit 6689ac8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mazeexp/engine/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,15 @@ def generate_random_level(self):
eu.Vector2(padding.x, ((tiles_h+1)*self.map_layer.th)-padding.y), # Top right
eu.Vector2(((tiles_w+1)*self.map_layer.tw)-padding.x, ((tiles_h+1)*self.map_layer.th)-padding.y) # Top left
]
rotations = [
45,
-45,
135,
-135
]
self.spawn = corners[corner]
self.player = Player(self.spawn.x, self.spawn.y)
self.player.rotation = rotations[corner]
self.add(self.player, z=self.z)
self.z += 1

Expand Down

0 comments on commit 6689ac8

Please sign in to comment.