fat
This commit is contained in:
parent
8f7be5556b
commit
a5a47d1c41
41
NS.py
41
NS.py
|
@ -16,7 +16,8 @@ from pygame.image import load, fromstring
|
||||||
from pygame.transform import rotate, flip
|
from pygame.transform import rotate, flip
|
||||||
from pygame.time import get_ticks
|
from pygame.time import get_ticks
|
||||||
from pygame.font import Font
|
from pygame.font import Font
|
||||||
from pygame.gfxdraw import aapolygon, arc
|
from pygame.draw import aalines, lines
|
||||||
|
from pygame.gfxdraw import aapolygon, arc, polygon
|
||||||
from pygame.locals import *
|
from pygame.locals import *
|
||||||
|
|
||||||
from lib.pgfw.pgfw.Game import Game
|
from lib.pgfw.pgfw.Game import Game
|
||||||
|
@ -791,7 +792,8 @@ class Platform(GameChild):
|
||||||
if self.active:
|
if self.active:
|
||||||
for light in self.lights:
|
for light in self.lights:
|
||||||
light.update()
|
light.update()
|
||||||
|
for light in self.lights:
|
||||||
|
light.draw_glow()
|
||||||
|
|
||||||
|
|
||||||
class Light(Animation):
|
class Light(Animation):
|
||||||
|
@ -854,21 +856,34 @@ class Light(Animation):
|
||||||
elif self.is_playing(self.glow) and (not boss.queue or
|
elif self.is_playing(self.glow) and (not boss.queue or
|
||||||
not self.in_orientation(boss.queue[chemtrails.queue_index])):
|
not self.in_orientation(boss.queue[chemtrails.queue_index])):
|
||||||
self.reset()
|
self.reset()
|
||||||
points = self.points
|
if not self.hidden:
|
||||||
else:
|
ds = self.get_display_surface()
|
||||||
|
aa_filled_polygon(ds, self.get_points(), self.color)
|
||||||
|
|
||||||
|
def get_points(self):
|
||||||
|
if self.get_game().introduction.active:
|
||||||
points = []
|
points = []
|
||||||
for point in self.points:
|
for point in self.points:
|
||||||
points.append((point[0], point[1] - self.INTRODUCTION_OFFSET))
|
points.append((point[0], point[1] - self.INTRODUCTION_OFFSET))
|
||||||
if not self.hidden:
|
return points
|
||||||
|
else:
|
||||||
|
return self.points
|
||||||
|
|
||||||
|
def draw_glow(self):
|
||||||
|
for ii in reversed(xrange(0, self.glow_index, 1)):
|
||||||
|
shifted = []
|
||||||
|
for point in self.get_points():
|
||||||
|
shifted.append((point[0], point[1] - ii))
|
||||||
|
ratio = 1 - float(ii + 1) / (self.MAX_GLOW_INDEX + 1)
|
||||||
|
alpha = int(ratio * 255)
|
||||||
|
color = Color(self.color.r, self.color.g, self.color.b, alpha)
|
||||||
ds = self.get_display_surface()
|
ds = self.get_display_surface()
|
||||||
aa_filled_polygon(ds, points, self.color)
|
intermediate = Surface(ds.get_size(), SRCALPHA)
|
||||||
for ii in reversed(xrange(self.glow_index)):
|
lines(intermediate,
|
||||||
shifted = []
|
get_hsla_color(int(color.hsla[0]), int(color.hsla[1]), int(color.hsla[2]), int(ratio * 100)),
|
||||||
for point in points:
|
True, shifted, 5)
|
||||||
shifted.append((point[0], point[1] - 1 * (ii + 1)))
|
ds.blit(intermediate, (0, 0))
|
||||||
alpha = (1 - float(ii + 1) / (self.MAX_GLOW_INDEX + 1)) * 255
|
# aapolygon(ds, shifted, color)
|
||||||
color = Color(self.color.r, self.color.g, self.color.b, int(alpha))
|
|
||||||
aapolygon(ds, shifted, color)
|
|
||||||
|
|
||||||
def in_orientation(self, orientation):
|
def in_orientation(self, orientation):
|
||||||
if self.position == NS.LNW:
|
if self.position == NS.LNW:
|
||||||
|
|
Loading…
Reference in New Issue