changeset 13:7cab9923c732

Blood and stairs
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Mon, 27 Feb 2012 23:37:43 +0100
parents 88cb0ac8e488
children 1f9de3322be5
files mhrok.png mhrok.py
diffstat 2 files changed, 25 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
Binary file mhrok.png has changed
--- a/mhrok.py	Mon Feb 27 23:15:12 2012 +0100
+++ b/mhrok.py	Mon Feb 27 23:37:43 2012 +0100
@@ -128,7 +128,6 @@
 
         self.map = [[0] * self.width for y in xrange(self.height)]
 
-
         areas = [
             ((0, 0), (9, 11)), ((11, 0), (9, 11)), ((22, 0), (9, 11)),
             ((0, 13), (9, 11)), ((11, 13), (9, 11)), ((22, 13), (9, 11)),
@@ -154,9 +153,16 @@
             x2 = x + r(0, w/2) * 2
             y2 = y + r(0, h/2) * 2
             self.path((x1, y1), (x2, y2), 2)
+
         for room in rooms:
             (x, y), (w, h) = room
             self.fill((x, y), (w + 1, h + 1), 1)
+            for i in xrange(r(0, 2)):
+                self[r(x, x+w), r(y, y+h)] = 3
+            for i in xrange(r(1, 3)):
+                self[r(x, x+w), r(y, y+h)] = 4
+
+        self[r(x, x+w), r(y, y+h)] = 5
 
         #self.map[2][1] = 2
         #self.map[1][1] = 2
@@ -205,34 +211,36 @@
         for y, row in enumerate(self.map):
             for x, square in enumerate(row):
                 pos = x * 20 + 4, y * 12
+                border = 0
                 if square == 1:
                     background.blit(tiles[23], pos)
-                    if not self[x - 1, y]:
-                        background.blit(tiles[9], pos)
-                    if not self[x + 1, y]:
-                        background.blit(tiles[19], pos)
-                    if not self[x, y - 1]:
-                        background.blit(tiles[4], pos)
-                    if not self[x, y + 1]:
-                        background.blit(tiles[14], pos)
+                    border = 4
                 elif square == 2:
                     background.blit(tiles[33], pos)
-                    if not self[x - 1, y]:
-                        background.blit(tiles[29], pos)
-                    if not self[x + 1, y]:
-                        background.blit(tiles[39], pos)
-                    if not self[x, y - 1]:
-                        background.blit(tiles[24], pos)
-                    if not self[x, y + 1]:
-                        background.blit(tiles[34], pos)
+                    border = 24
                 elif square == 3:
                     background.blit(tiles[23], pos)
                     background.blit(blood, pos)
+                    border = 4
                 elif square == 4:
                     background.blit(tiles[23], pos)
                     background.blit(blood2, pos)
+                    border = 4
+                elif square == 5:
+                    background.blit(tiles[38], pos)
+                    border = 4
                 elif square < 0:
                     background.blit(tiles[39 - square], pos)
+                    border = 24
+                if border:
+                    if not self[x - 1, y]:
+                        background.blit(tiles[5 + border], pos)
+                    if not self[x + 1, y]:
+                        background.blit(tiles[15 + border], pos)
+                    if not self[x, y - 1]:
+                        background.blit(tiles[border], pos)
+                    if not self[x, y + 1]:
+                        background.blit(tiles[10 + border], pos)
 
         return background