- turnip = Turnip(age=0, pos=ev.pos)
- self._turnips.append(turnip)
- self._seeds -= 1
- self._update_toolbar
+ # We don't want top-left to equal the mouse position,
+ # 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)
+ try:
+ turnip = Turnip(age=0, pos=pos, space=self._space)
+ self._turnips.append(turnip)
+ self._seeds -= 1
+ self._update_toolbar()
+ except TurnipInvalidPosition as e:
+ # TODO: Add error sound or something
+ pass