Tweak seed cursor placement offset
[tabakrolletjie.git] / tabakrolletjie / scenes / day.py
index 4c3cbfe9759c01458be1c1bcb307f4d1ca74221c..1e65fe10794b0e3e05c2a97339df7672ecbcd702 100644 (file)
@@ -21,7 +21,7 @@ from ..transforms import Overlay, Alpha, ColourWedges
 
 from ..constants import SCREEN_SIZE, FONTS, DEBUG
 from ..widgets import ImageButton
-from ..turnip import Turnip, TurnipInvalidPosition
+from ..turnip import Turnip, TurnipInvalidPosition, check_turnips
 
 
 class DayScene(BaseScene):
@@ -183,7 +183,7 @@ class DayScene(BaseScene):
             # since that looks weird, but we don't want to center
             # the turnip under the mouse either, since that
             # causes issues as well, so we compromise
-            pos = (ev.pos[0] - 8, ev.pos[1] - 8)
+            pos = (ev.pos[0] - 18, ev.pos[1] - 18)
             try:
                 turnip = Turnip(age=0, pos=pos, space=self._space)
                 self._turnips.append(turnip)
@@ -216,6 +216,9 @@ class DayScene(BaseScene):
             # Bail if we're too close to an existing light
             if self._lights.nearest(pos, max_distance=25):
                 return
+            # Also check turnips
+            if check_turnips(self._space, pos, max_distance=25):
+                return
             gamestate.seeds -= cost
             cfg["position"] = pos
             cfg["colours"] = colours