projects
/
tabakrolletjie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e591704
)
Limit how close lights can be placed to each other
author
Neil
<neil@dip.sun.ac.za>
Fri, 9 Sep 2016 21:46:58 +0000
(23:46 +0200)
committer
Neil
<neil@dip.sun.ac.za>
Fri, 9 Sep 2016 21:46:58 +0000
(23:46 +0200)
tabakrolletjie/scenes/day.py
patch
|
blob
|
history
diff --git
a/tabakrolletjie/scenes/day.py
b/tabakrolletjie/scenes/day.py
index 7860c87b44e4db2d09c7c11549215648a0ab0acb..1c518c526514a0ea8871dedf5e2d87e4f831caf4 100644
(file)
--- a/
tabakrolletjie/scenes/day.py
+++ b/
tabakrolletjie/scenes/day.py
@@
-100,10
+100,13
@@
class DayScene(BaseScene):
def _place_spotlight(self, gamestate, colour, ev):
if self._seeds > 5:
- self._seeds -= 5
- self._update_toolbar(gamestate)
pos = pymunk.pygame_util.from_pygame(ev.pos,
pygame.display.get_surface())
+ # Bail if we're too close to an existing light
+ if self._lights.nearest(pos, max_distance=25):
+ return
+ self._seeds -= 5
+ self._update_toolbar(gamestate)
cfg = {
"type": "spotlight",
"colour": colour,