clouds
authorFrank DeMarco <frank.s.demarco@gmail.com>
Sun, 29 Jun 2014 10:56:23 +0000 (19:56 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Sun, 29 Jun 2014 10:56:23 +0000 (19:56 +0900)
14 files changed:
hair_on_arm/HairOnArm.py
resource/aud/car-kicker/countdown.ogg [new file with mode: 0644]
resource/aud/car-kicker/game-over.ogg [new file with mode: 0644]
resource/aud/car-kicker/go.ogg [new file with mode: 0644]
resource/aud/car-kicker/landing.ogg [new file with mode: 0644]
resource/aud/car-kicker/miss.ogg [new file with mode: 0644]
resource/aud/car-kicker/restart.ogg [new file with mode: 0644]
resource/aud/car-kicker/scan.ogg [new file with mode: 0644]
resource/aud/car-kicker/shrank.ogg [new file with mode: 0644]
resource/aud/car-kicker/success.ogg [new file with mode: 0644]
resource/img/television-alien-city/celestial-vision.png [new file with mode: 0644]
resource/img/television-alien-city/heat-secant.png [new file with mode: 0644]
resource/img/television-alien-city/my-hand-fever.png [new file with mode: 0644]
resource/img/television-alien-city/spuu.png [new file with mode: 0644]

index 611169d..d77d8a1 100644 (file)
@@ -614,27 +614,25 @@ class Lens(Animation):
         surface = load(self.get_resource("image", "lens-cloud")).convert_alpha()
         self.clouds_background_surface = surface.copy()
         pixels = PixelArray(self.clouds_background_surface)
-        for x in xrange(len(pixels)):
-            for y in xrange(len(pixels[0])):
-                color = Color(*ds.unmap_rgb(pixels[x][y]))
+        for x in xrange(self.clouds_background_surface.get_width()):
+            for y in xrange(self.clouds_background_surface.get_height()):
+                color = Color(*self.clouds_background_surface.get_at((x, y)))
                 h, s, l, a = color.hsla
                 color.hsla = h, s, l, max(0, a - 51)
-                pixels[x][y] = color
+                self.clouds_background_surface.set_at((x, y), color)
         self.clouds_foreground_surface = surface.copy()
-        pixels = PixelArray(self.clouds_foreground_surface)
-        for x in xrange(len(pixels)):
-            for y in xrange(len(pixels[0])):
-                color = Color(*ds.unmap_rgb(pixels[x][y]))
+        for x in xrange(self.clouds_foreground_surface.get_width()):
+            for y in xrange(self.clouds_foreground_surface.get_height()):
+                color = Color(*self.clouds_foreground_surface.get_at((x, y)))
                 h, s, l, a = color.hsla
                 color.hsla = h, s, l, max(0, a - 34)
-                pixels[x][y] = color
-        del pixels
+                self.clouds_foreground_surface.set_at((x, y), color)
         self.clouds_background_offset = randint(0, surface.get_width() - 1)
         self.clouds_foreground_offset = randint(0, surface.get_width() - 1)
         self.clouds_mask = mask = self.gradient_surfaces[0].copy()
         plate = Surface(mask.get_size(), SRCALPHA)
         plate.fill((255, 255, 255))
-        mask.blit(plate, (0, 0), None, BLEND_RGBA_MIN)
+        mask.blit(plate, (0, 0), None, BLEND_RGB_MAX)
         self.set_colors()
 
     def scan(self):
@@ -659,11 +657,13 @@ class Lens(Animation):
         self.clouds_background_offset += 1
         if self.clouds_background_offset >= self.clouds_background_surface. \
                get_width():
-            self.clouds_background_offset = 0
+            self.clouds_background_offset -= self.clouds_background_surface. \
+                                             get_width()
         self.clouds_foreground_offset += 2
         if self.clouds_foreground_offset >= self.clouds_foreground_surface. \
                get_width():
-            self.clouds_foreground_offset = 0
+            self.clouds_foreground_offset -= self.clouds_foreground_surface. \
+                                             get_width()
 
     def draw_background(self):
         ds = self.display_surface
@@ -671,18 +671,18 @@ class Lens(Animation):
 
     def draw_foreground(self):
         ds = self.display_surface
-        # for offset in (0, -self.clouds_background_surface.get_width()):
-        #     mask = self.clouds_mask.copy()
-            mask.blit(self.clouds_background_surface,
-        #               (self.clouds_background_offset + offset, 20), None,
-                      BLEND_RGBA_MIN)
-        #     ds.blit(mask, self.gradient_rect)
-        # for offset in (0, -self.clouds_foreground_surface.get_width()):
-        #     mask = self.clouds_mask.copy()
-            mask.blit(self.clouds_foreground_surface,
-        #               (self.clouds_foreground_offset + offset, 20), None,
-                      BLEND_RGBA_MIN)
-        #     ds.blit(mask, self.gradient_rect)
+        mask = self.clouds_mask.copy()
+        for offset in (0, -self.clouds_background_surface.get_width()):
+            mask.blit(self.clouds_background_surface,
+                      (self.clouds_background_offset + offset, -17), None,
+                      BLEND_RGBA_MIN)
+        ds.blit(mask, self.gradient_rect)
+        mask = self.clouds_mask.copy()
+        for offset in (0, -self.clouds_foreground_surface.get_width()):
+            mask.blit(self.clouds_foreground_surface,
+                      (self.clouds_foreground_offset + offset, -12), None,
+                      BLEND_RGBA_MIN)
+        ds.blit(mask, self.gradient_rect)
         shadow = self.shadow_mask.copy()
         shadow.blit(self.shadow_plate, (0, 0), None, BLEND_RGBA_MIN)
         ds.blit(shadow, self.shadow_rect)
diff --git a/resource/aud/car-kicker/countdown.ogg b/resource/aud/car-kicker/countdown.ogg
new file mode 100644 (file)
index 0000000..2fef5ae
Binary files /dev/null and b/resource/aud/car-kicker/countdown.ogg differ
diff --git a/resource/aud/car-kicker/game-over.ogg b/resource/aud/car-kicker/game-over.ogg
new file mode 100644 (file)
index 0000000..ed5b6f9
Binary files /dev/null and b/resource/aud/car-kicker/game-over.ogg differ
diff --git a/resource/aud/car-kicker/go.ogg b/resource/aud/car-kicker/go.ogg
new file mode 100644 (file)
index 0000000..7817607
Binary files /dev/null and b/resource/aud/car-kicker/go.ogg differ
diff --git a/resource/aud/car-kicker/landing.ogg b/resource/aud/car-kicker/landing.ogg
new file mode 100644 (file)
index 0000000..afc317d
Binary files /dev/null and b/resource/aud/car-kicker/landing.ogg differ
diff --git a/resource/aud/car-kicker/miss.ogg b/resource/aud/car-kicker/miss.ogg
new file mode 100644 (file)
index 0000000..2842c55
Binary files /dev/null and b/resource/aud/car-kicker/miss.ogg differ
diff --git a/resource/aud/car-kicker/restart.ogg b/resource/aud/car-kicker/restart.ogg
new file mode 100644 (file)
index 0000000..b254f6f
Binary files /dev/null and b/resource/aud/car-kicker/restart.ogg differ
diff --git a/resource/aud/car-kicker/scan.ogg b/resource/aud/car-kicker/scan.ogg
new file mode 100644 (file)
index 0000000..583ee67
Binary files /dev/null and b/resource/aud/car-kicker/scan.ogg differ
diff --git a/resource/aud/car-kicker/shrank.ogg b/resource/aud/car-kicker/shrank.ogg
new file mode 100644 (file)
index 0000000..6618327
Binary files /dev/null and b/resource/aud/car-kicker/shrank.ogg differ
diff --git a/resource/aud/car-kicker/success.ogg b/resource/aud/car-kicker/success.ogg
new file mode 100644 (file)
index 0000000..e01af3f
Binary files /dev/null and b/resource/aud/car-kicker/success.ogg differ
diff --git a/resource/img/television-alien-city/celestial-vision.png b/resource/img/television-alien-city/celestial-vision.png
new file mode 100644 (file)
index 0000000..c9ef1aa
Binary files /dev/null and b/resource/img/television-alien-city/celestial-vision.png differ
diff --git a/resource/img/television-alien-city/heat-secant.png b/resource/img/television-alien-city/heat-secant.png
new file mode 100644 (file)
index 0000000..fd22531
Binary files /dev/null and b/resource/img/television-alien-city/heat-secant.png differ
diff --git a/resource/img/television-alien-city/my-hand-fever.png b/resource/img/television-alien-city/my-hand-fever.png
new file mode 100644 (file)
index 0000000..ae31806
Binary files /dev/null and b/resource/img/television-alien-city/my-hand-fever.png differ
diff --git a/resource/img/television-alien-city/spuu.png b/resource/img/television-alien-city/spuu.png
new file mode 100644 (file)
index 0000000..5add4e9
Binary files /dev/null and b/resource/img/television-alien-city/spuu.png differ