From 8406c478924d4364b9a017f655e6757863341ff9 Mon Sep 17 00:00:00 2001 From: adrianna Date: Sat, 10 Sep 2016 13:25:06 +0200 Subject: [PATCH] rotating spotlight fixture --- TODO.txt | 2 +- data/images/32/spotlight.png | Bin 1429 -> 1294 bytes data/images/48/spotlight.png | Bin 2154 -> 1913 bytes data/images/cursors/spotlight.png | Bin 1429 -> 1294 bytes sources/vector/spotlight.svg | 12 ++++++------ tabakrolletjie/lights.py | 13 ++++++++++++- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/TODO.txt b/TODO.txt index e94fc8d..bfc582a 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,7 +6,6 @@ TODO * Battery and light power consts * Mould resistances * Mould power increases to prevent farming -* Fitting rotation * Save game * More sounds * Five levels @@ -17,3 +16,4 @@ Done * Light colour selection * All lights multicolour * Light direction configuration +* Fitting rotation diff --git a/data/images/32/spotlight.png b/data/images/32/spotlight.png index 4e55c022e23c4665dbb2ca7bef6df1481cf7f6c0..0cf4b791e25a405309b35d0c5ca16bcc53a425fb 100644 GIT binary patch delta 1201 zcmV;i1Wx;v3yunqZGQxdNklf&N#0$!lciQ&X(QW3|5xXI&cplvJ&)Bmg&V+(3VSf9=_`XD=m_$#ggz{&t2`NfH_x8*%aCMGb&Yyk2iFfPecH0FcY&6g5$=*F%z|vYG>c zD2kwIy0}&pMFIXk1F|f?0g%aL$_}u%tFkQTiU7G>u6QzaI^B_VK&R6c*V$}VE&^n; z*(@QuKPZZ#2+#9n2M`1SG))r#AcR1c<$nM~QQU||qW}P_)v5`FLS+YFSr%5SRRaJV z$3c>$^?xG3`uh4}AP~p{Kub#tHa9nq1i)gk0007kKt2!%_=^BM&#$elto#Y=o`H>x z4duX{-cylCB(K$K0RYR(%dgYv^jZ-B0Jplj8dsC!@wixSfOtG!JlVluFaaQ13P8f) z@P?Yu-rf$s-=8m+`QqYYzN4d~IEFcn3t`V#hJVB1_&SkD5JCuHS(fzm^|9refW5uF zY&aYygb*SK0&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APw1@^o5{~z@iEpMJj$;;y6 P00000NkvXXu0mjf_NYaK delta 1337 zcmV-91;+Z03Y80xZGQz4Nkl65r(yqA@sxJ1=7K1)y9YJWD zJcNxY2%7XkD8<*l%?Z8=eUtiP2$YtB;zKPcbV?Dnxz<4pRd7sOTm|Xz$MHc|1)?Y-l z`oTHZj{w6kW`n_SsHv&xsKH=3Twh;bUsqRGZ!j2Y_w3oTTd&ves;jH3s;#ZvWipv| zn@lDh0EnU}i=voaSy@>X1R6oojBqlt-$yvO6=)Q%I;djKNB*|TS#mCSVu6+AT0 ziuLo6&1O^E`6hOvVvh{~xm>R70L2~~05X}(+j0XGdlUndeFTaA_xARd#k{w-7k^f(HT&Yli};;8cfNb_RAB* zk|ZS+MF9X`0At04%2SZV-45X9>0Y5+jNi!TO9tHG6(l?$OzC{rr) zP$-nCtgKv6p9@~^0f;D@NF=lxy?_7y)xN&I2Y>3y_!udQg1)}K2L}!u$f<3KMB*(G zWi@~TRam`uI2?*dkJR?-*RL-FXr#@yWL~c~ zs0Pl=%;cO-=XoN6+wHzGHZ~>}n{1`Au`$u@c3&YPIGxV(v$L~#_1(#nCx2b+d z+S=;v@9*c-m|M4Qtu!|`d$t51A{;+{{HJs}ttB2B8j5ywbX)|WBO+L>R!@6-`z4>x zH{8?HbGN6b=dRD^8*XoJzht#qJ+!vN)^&7rTpSu2imG|i=`ZRgINJG^)AUI0KopGS9h_oEv(ZhS*T8;e{q5fP!Lrlz5*tLw2K2%FCF z;^HEOLZNqqgM;zG!NGVa6neL~xPQ25tRM)~)z$U5rlzK0Gp|hn3Zr6dYiqkYFfb6? z$st8i6dD*9h_$t~T?Js=%I6zY vx2aT0lx6wV?Ck8%vMkSiXwGc`ltX_5VH`IQvK9#I00000NkvXXu0mjfUU`;Q diff --git a/sources/vector/spotlight.svg b/sources/vector/spotlight.svg index 4f0d58b..11c4300 100644 --- a/sources/vector/spotlight.svg +++ b/sources/vector/spotlight.svg @@ -26,8 +26,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.4" - inkscape:cx="123.25557" - inkscape:cy="182.29837" + inkscape:cx="115.01124" + inkscape:cy="139.81635" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -63,14 +63,14 @@ id="layer1" transform="translate(0,-698.0315)"> diff --git a/tabakrolletjie/lights.py b/tabakrolletjie/lights.py index fef2b44..7b2c263 100644 --- a/tabakrolletjie/lights.py +++ b/tabakrolletjie/lights.py @@ -9,6 +9,7 @@ import pygame.display import pygame.draw import pygame.locals as pgl import pygame.rect +import pygame.transform from .constants import LIGHT_CATEGORY, FITTINGS_CATEGORY, COLOURS from .rays import RayPolyManager @@ -258,7 +259,6 @@ class BaseLight(object): else: self.colour = self.colour_cycle[self.colour_pos] self.on = True - self.invalidate_fitting_image() def tick(self): pass @@ -312,6 +312,17 @@ class SpotLight(BaseLight): self.angular_velocity = kw.pop("angular_velocity", None) super(SpotLight, self).__init__(**kw) + def fitting_image(self): + fitting_image = super(SpotLight, self).fitting_image() + rot_fitting_image = pygame.transform.rotozoom(fitting_image, self.ray_manager.direction - 90, 1) + + rot_rect = fitting_image.get_rect().copy() + rot_rect.center = rot_fitting_image.get_rect().center + rot_fitting_image = rot_fitting_image.subsurface(rot_rect).copy() + + return rot_fitting_image + + def tick(self): if self.angular_velocity: self.ray_manager.direction -= self.angular_velocity -- 2.34.1