;'
authorFrank DeMarco <frank.s.demarco@gmail.com>
Wed, 3 Sep 2014 14:43:14 +0000 (23:43 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Wed, 3 Sep 2014 14:43:14 +0000 (23:43 +0900)
config
shaken_and_spit_out/SSO.py

diff --git a/config b/config
index eb32813..ba3cfc8 100644 (file)
--- a/config
+++ b/config
@@ -34,8 +34,8 @@ cloud = img/Safire-Translimitter.png
 initializer = img/D2643llleiob/
 
 [text]
-preface = It was a cybernetic adaptation/that allowed it the predilection/to
-          attempt PSPPIT, continual/establishment of foundation in/the firmament
+preface = It was a cybernetic adaptation/that enabled it the predilection/to
+          attempt P\u27A2P;' P\u2591T, continual/establishment of foundation in/firmament
 preamble = Good something/they that speak in proverbs say/come into the
            city/let it be built/where the flies collect/on a live cadaver in
            the road
index cda6a0b..ed9b4e4 100644 (file)
@@ -146,7 +146,8 @@ class Preface(GameChild, Surface):
 
     def set_text(self):
         lines = self.get_configuration("text", "preface",
-                                       False).upper().split("/")
+                                       False).decode("unicode-escape").upper().split("/")
+        print self.get_configuration("text", "preface", False).decode("latin-1")
         cc = 0
         for line in lines:
             if len(line) > cc:
@@ -161,7 +162,7 @@ class Preface(GameChild, Surface):
                           SRCALPHA)
         text = self.text = Sprite(self, 200)
         text.display_surface = self
-        magic_word = "PSPPIT"
+        magic_word = u"P\u27A2P;' P\u2591T"
         magic_colors = deque(((255, 128, 128), (255, 255, 128), (128, 255, 128),
                               (128, 255, 255), (128, 128, 255),
                               (255, 128, 255)))
@@ -176,11 +177,12 @@ class Preface(GameChild, Surface):
                 for char in line:
                     if char == " ":
                         space_count += 1
-                space_widths = [1 + extra / space_count] * space_count
-                for ii in xrange(len(space_widths)):
-                    if ii >= (extra % space_count):
-                        break
-                    space_widths[ii] += 1
+                if space_count:
+                    space_widths = [1 + extra / space_count] * space_count
+                    for ii in xrange(len(space_widths)):
+                        if ii >= (extra % space_count):
+                            break
+                        space_widths[ii] += 1
                 magic_word_ii = 0
                 for ii in xrange(len(line)):
                     if line != lines[-1] and line[ii] == " ":
@@ -189,7 +191,8 @@ class Preface(GameChild, Surface):
                         if (magic_word_ii and \
                             magic_word_ii < len(magic_word)) \
                                or line[ii:ii + len(magic_word)] == magic_word:
-                            color = magic_colors[magic_word_ii]
+                            color = magic_colors[0]
+                            magic_colors.rotate(-1)
                             magic_word_ii += 1
                         else:
                             color = (255, 255, 255)
@@ -295,7 +298,7 @@ class Arrow(Sprite):
 class Floor(Sprite):
 
     def __init__(self, parent):
-        Sprite.__init__(self, parent, 340)
+        Sprite.__init__(self, parent, (520, 80))
         base = load(self.get_resource("image", "brick")).convert()
         ds = self.ds = self.get_display_surface()
         surface = Surface((ds.get_width(), 17))