From b56e5dc0e92794b5bd499a51e2c38ec6f38c8081 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 9 Sep 2016 22:08:07 +0200 Subject: [PATCH] Start working toward light placement --- data/images/32/lamp.png | Bin 0 -> 797 bytes data/images/32/laser.png | Bin 0 -> 552 bytes data/images/32/spotlight.png | Bin 0 -> 1429 bytes data/images/Makefile | 2 +- data/images/cursors/lamp.png | Bin 0 -> 797 bytes data/images/cursors/laser.png | Bin 0 -> 552 bytes data/images/cursors/spotlight.png | Bin 0 -> 1429 bytes tabakrolletjie/scenes/day.py | 21 ++++++++++++++++++++- 8 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 data/images/32/lamp.png create mode 100644 data/images/32/laser.png create mode 100644 data/images/32/spotlight.png create mode 100644 data/images/cursors/lamp.png create mode 100644 data/images/cursors/laser.png create mode 100644 data/images/cursors/spotlight.png diff --git a/data/images/32/lamp.png b/data/images/32/lamp.png new file mode 100644 index 0000000000000000000000000000000000000000..e7cfa82e320c4b3fb134de7e48229a4a31a0eedf GIT binary patch literal 797 zcmV+&1LFLNP)DbefCR8kX*j+yXPFvxk^NY zQ{vl6)vFqi-cX6-kQAJqowambztuGDT2YisS(YyVAdcgZbN=M}{-fu4{g;=Q*}F-J zXzwM<@|9s2W81dFBuS_YNs^Fl+o53?V_BB3-ow3j0b}gWG|hRIWu?NK$g+$~)0{KL z?)LGQra)1Y?>9F$zbwo8(Q377;`wT|g6p~nf&k)ONs^$dDi~vEG#YD;*=&~H-{1ds z9OozJ{Leut=ytmg`CUg*M3!aIU@)NNa=EqZ<#I`b!GJ8wq9}?A(dc%&4+o`yF?Khd zPS?qH9EWm%0-5iU2)Uqri!!XAGG*GYCTefY7f?zYBheFhifNk4hy@ zr*kf$@%D;rQ%6+sZ})F>E`BuNsz9l*NDd<61bvMgWZ z2iVsc$3#SN9Eaj}#VK1ro-2;yka8g@M1XVtBBzh7p~59EN b`8a+BLEtrkWRv$@=P#r|QM;m!O1X6EtW32QCql>44T zLWnBR0-8U!w!p?(dn}wQ?*)VqpF5q-mv*~-*Xx&!M&rWw{R=5&9YAZnS4utY zcDtwjet)Nw(yP_#+iW)bYOVdAX<)5Axq$013?GzIwy2a+HVnfD;5ySI2jDi2Fr7{@#{Al-UL=HgS&rk-?RGK7W1}t##qVT5F;x qdIZv}xU-LDxd11i{@rl;xAg8QbAI9y*}Utd>OS8p&FYWM8fvs~!pO-xMWIgTSmQK(c>6oojBqlt-$yvO6=)Q%I;djKNB*|TS#mCSVu6+AT0iuLo6 z&1O^E`6hOvVvh{~xm>R70L2~~05X}(+j0XGdlUndeFTaA_xARd#k{w-7gnn^`{Kom_?&YD*5u0B#HcfzxG`4T$=(}mXj(a%d*7te93#y^E_CV)yl5wSpfi&BqbF^ z0RUJm7L*IXVzB@K6h(m~N$&w<}gvP?W4-zv|J6_3ZkvMd7ti9`ajEJrl} zp6BP)UYpHkL?V%r14JSbn9XJs{J``4yavE=+^eOfrJM>73gs9$K*5VI21u*Hm6eqXp-?DOD)Ue%l&P$& zTu`42Uhe^jD4R$mv>LsC|Nhm!zP<*5ih{nrz6S>m9LT9{iA3Tp5oI-i0##VO zcQ_m^larGd0)fEmj|B(>0-AayKomthfByV8ElAy&=ybZKk&zKmEtTEf z-46j&xLmGlQ&Usf?UvrDsi~~X<+=u-;>?*dkJR?-*RL-FXr#@yWL~c~s0Pl=%;cO- z=XoN6+wHzGHZ~>}n{1`Au`$u@c3&YPIGxV(v$L~#_1(#nCx2bkTrm+5p{Ay$p{uLwu^KpC zwOs{Z+{))4Q&6mZ`}Tc#zYx2aT0lx6wV?Ck8% jvMkSiXwGc`ltX_5VH`IQvK9#I00000NkvXXu0mjfI{m1( literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..e7cfa82e320c4b3fb134de7e48229a4a31a0eedf GIT binary patch literal 797 zcmV+&1LFLNP)DbefCR8kX*j+yXPFvxk^NY zQ{vl6)vFqi-cX6-kQAJqowambztuGDT2YisS(YyVAdcgZbN=M}{-fu4{g;=Q*}F-J zXzwM<@|9s2W81dFBuS_YNs^Fl+o53?V_BB3-ow3j0b}gWG|hRIWu?NK$g+$~)0{KL z?)LGQra)1Y?>9F$zbwo8(Q377;`wT|g6p~nf&k)ONs^$dDi~vEG#YD;*=&~H-{1ds z9OozJ{Leut=ytmg`CUg*M3!aIU@)NNa=EqZ<#I`b!GJ8wq9}?A(dc%&4+o`yF?Khd zPS?qH9EWm%0-5iU2)Uqri!!XAGG*GYCTefY7f?zYBheFhifNk4hy@ zr*kf$@%D;rQ%6+sZ})F>E`BuNsz9l*NDd<61bvMgWZ z2iVsc$3#SN9Eaj}#VK1ro-2;yka8g@M1XVtBBzh7p~59EN b`8a+BLEtrkWRv$@=P#r|QM;m!O1X6EtW32QCql>44T zLWnBR0-8U!w!p?(dn}wQ?*)VqpF5q-mv*~-*Xx&!M&rWw{R=5&9YAZnS4utY zcDtwjet)Nw(yP_#+iW)bYOVdAX<)5Axq$013?GzIwy2a+HVnfD;5ySI2jDi2Fr7{@#{Al-UL=HgS&rk-?RGK7W1}t##qVT5F;x qdIZv}xU-LDxd11i{@rl;xAg8QbAI9y*}Utd>OS8p&FYWM8fvs~!pO-xMWIgTSmQK(c>6oojBqlt-$yvO6=)Q%I;djKNB*|TS#mCSVu6+AT0iuLo6 z&1O^E`6hOvVvh{~xm>R70L2~~05X}(+j0XGdlUndeFTaA_xARd#k{w-7gnn^`{Kom_?&YD*5u0B#HcfzxG`4T$=(}mXj(a%d*7te93#y^E_CV)yl5wSpfi&BqbF^ z0RUJm7L*IXVzB@K6h(m~N$&w<}gvP?W4-zv|J6_3ZkvMd7ti9`ajEJrl} zp6BP)UYpHkL?V%r14JSbn9XJs{J``4yavE=+^eOfrJM>73gs9$K*5VI21u*Hm6eqXp-?DOD)Ue%l&P$& zTu`42Uhe^jD4R$mv>LsC|Nhm!zP<*5ih{nrz6S>m9LT9{iA3Tp5oI-i0##VO zcQ_m^larGd0)fEmj|B(>0-AayKomthfByV8ElAy&=ybZKk&zKmEtTEf z-46j&xLmGlQ&Usf?UvrDsi~~X<+=u-;>?*dkJR?-*RL-FXr#@yWL~c~s0Pl=%;cO- z=XoN6+wHzGHZ~>}n{1`Au`$u@c3&YPIGxV(v$L~#_1(#nCx2bkTrm+5p{Ay$p{uLwu^KpC zwOs{Z+{))4Q&6mZ`}Tc#zYx2aT0lx6wV?Ck8% jvMkSiXwGc`ltX_5VH`IQvK9#I00000NkvXXu0mjfI{m1( literal 0 HcmV?d00001 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): -- 2.34.1