From: Neil Date: Fri, 9 Sep 2016 20:08:07 +0000 (+0200) Subject: Start working toward light placement X-Git-Tag: tabakrolletjie-v1.0.0~149 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=b56e5dc0e92794b5bd499a51e2c38ec6f38c8081;p=tabakrolletjie.git Start working toward light placement --- diff --git a/data/images/32/lamp.png b/data/images/32/lamp.png new file mode 100644 index 0000000..e7cfa82 Binary files /dev/null and b/data/images/32/lamp.png differ diff --git a/data/images/32/laser.png b/data/images/32/laser.png new file mode 100644 index 0000000..789f0e5 Binary files /dev/null and b/data/images/32/laser.png differ diff --git a/data/images/32/spotlight.png b/data/images/32/spotlight.png new file mode 100644 index 0000000..4e55c02 Binary files /dev/null and b/data/images/32/spotlight.png differ diff --git a/data/images/Makefile b/data/images/Makefile index b1a7f01..d460e6b 100644 --- a/data/images/Makefile +++ b/data/images/Makefile @@ -6,7 +6,7 @@ MOULD=eyeballA eyeballB eyeballC LIGHT=spotlight lamp laser IMG16=$(MOULD_BODY) -IMG32=$(TURNIP) $(MOULD_BODY) $(MOULD) +IMG32=$(TURNIP) $(MOULD_BODY) $(MOULD) $(LIGHT) IMG64=$(MOULD_BODY) $(LIGHT) CURSORS=seed diff --git a/data/images/cursors/lamp.png b/data/images/cursors/lamp.png new file mode 100644 index 0000000..e7cfa82 Binary files /dev/null and b/data/images/cursors/lamp.png differ diff --git a/data/images/cursors/laser.png b/data/images/cursors/laser.png new file mode 100644 index 0000000..789f0e5 Binary files /dev/null and b/data/images/cursors/laser.png differ diff --git a/data/images/cursors/spotlight.png b/data/images/cursors/spotlight.png new file mode 100644 index 0000000..4e55c02 Binary files /dev/null and b/data/images/cursors/spotlight.png differ diff --git a/tabakrolletjie/scenes/day.py b/tabakrolletjie/scenes/day.py index 9e55fba..cf27859 100644 --- a/tabakrolletjie/scenes/day.py +++ b/tabakrolletjie/scenes/day.py @@ -16,6 +16,7 @@ from ..transforms import Overlay from ..constants import SCREEN_SIZE, FONTS from ..widgets import ImageButton from ..turnip import Turnip, TurnipInvalidPosition +from ..transforms import Overlay class DayScene(BaseScene): @@ -45,6 +46,12 @@ class DayScene(BaseScene): self._tools = [ ImageButton('32', 'seed.png', name='seed', pos=(50, SCREEN_SIZE[1] - 40)), + ImageButton('32', 'spotlight.png', name='blue_spotlight', + pos=(100, SCREEN_SIZE[1] - 40), + transform=Overlay(colour=(0, 0, 255, 128))), + ImageButton('32', 'spotlight.png', name='red_spotlight', + pos=(150, SCREEN_SIZE[1] - 40), + transform=Overlay(colour=(255, 0, 0, 128))), ImageButton('32', 'default_cursor.png', name='reset tool', pos=(SCREEN_SIZE[0] - 50, SCREEN_SIZE[1] - 40)), ] @@ -94,7 +101,16 @@ class DayScene(BaseScene): self._tool = None else: self._tool = tool.name - self._set_cursor(tool.name) + if self._tool == 'seed': + self._set_cursor(tool.name) + elif self._tool == 'red_spotlight': + self._set_cursor( + 'spotlight', + transform=Overlay(colour=(255, 0, 0, 128))) + elif self._tool == 'blue_spotlight': + self._set_cursor( + 'spotlight', + transform=Overlay(colour=(0, 0, 255, 128))) return if self._tool == "seed": if self._seeds > 0: @@ -116,6 +132,9 @@ class DayScene(BaseScene): # Not tool, so check lights self._lights.toggle_nearest(ev.pos, surfpos=True) print self._lights.lit_by(ev.pos, surfpos=True) + elif ev.button == 3 and self._tool: + self._tool = None + self._unset_cursor() @debug_timer("day.tick") def tick(self, gamestate):