Finished castle
Justin Armstrong justinmeister@gmail.com
Sun, 09 Mar 2014 01:29:16 -0800
5 files changed,
86 insertions(+),
43 deletions(-)
M
data/states/town.py
→
data/states/town.py
@@ -30,6 +30,7 @@ """Create a dictionary of sprite sheet tiles"""
tile_dict = {} tileset1 = setup.GFX['tileset1'] tileset2 = setup.GFX['tileset2'] + tileset3 = setup.GFX['tileset3'] sword = setup.GFX['sword'] shield = setup.GFX['shield'] potion = setup.GFX['potion']@@ -51,13 +52,22 @@ tile_dict['gem'] = self.get_tile(0, 0, gem, 32, 32)
tile_dict['castle bridge'] = self.get_tile(48, 27, tileset1, 16, 32 ) tile_dict['flower1'] = self.get_tile(64, 64, tileset2) tile_dict['flower2'] = self.get_tile(80, 64, tileset2) + tile_dict['horiz castle wall'] = self.get_tile(32, 0, tileset3, 48, 32) + tile_dict['vert castle wall'] = self.get_tile(0, 16, tileset3) + tile_dict['castle tower'] = self.get_tile(116, 16, tileset1, 48, 64) + tile_dict['main castle roof'] = self.get_tile(0, 0, tileset1, 160, 16) + tile_dict['left castle roof piece'] = self.get_tile(0, 0, tileset1, 48, 16) + tile_dict['right castle roof piece'] = self.get_tile(112, 0, tileset1, 48, 16) + tile_dict['castle side'] = self.get_tile(0, 72, tileset3) + tile_dict['castle door'] = self.get_tile(32, 64, tileset2, 16, 16, 4) return tile_dict - def get_tile(self, x, y, tileset, width=16, height=16): + def get_tile(self, x, y, tileset, width=16, height=16, scale=1): """Gets the surface and rect for a tile""" surface = self.get_image(self, x, y, width, height, tileset) + surface = pg.transform.scale(surface, (width*scale, height*scale)) rect = surface.get_rect() tile_dict = {'surface': surface,@@ -138,6 +148,18 @@ elif letter == 'B':
tile = self.town_map_dict['castle bridge'] self.blit_tile_to_map(tile, row, column, map) + elif letter == 'C': + tile = self.town_map_dict['horiz castle wall'] + self.blit_tile_to_map(tile, row, column, map) + + elif letter == 'V': + tile = self.town_map_dict['vert castle wall'] + self.blit_tile_to_map(tile, row, column, map) + + elif letter == 'S': + tile = self.town_map_dict['castle side'] + self.blit_tile_to_map(tile, row, column, map) + tile_map.close()@@ -161,6 +183,27 @@ tile = self.town_map_dict['flower1']
self.blit_tile_to_map(tile, row, column, map) elif letter == '*': tile = self.town_map_dict['flower2'] + self.blit_tile_to_map(tile, row, column, map) + elif letter == 'T': + tile = self.town_map_dict['castle tower'] + self.blit_tile_to_map(tile, row, column, map) + elif letter == 'W': + tile = self.town_map_dict['vert castle wall'] + self.blit_tile_to_map(tile, row, column, map) + elif letter == 'M': + tile = self.town_map_dict['main castle roof'] + self.blit_tile_to_map(tile, row, column, map) + elif letter == 'L': + tile = self.town_map_dict['left castle roof piece'] + self.blit_tile_to_map(tile, row, column, map) + elif letter == 'R': + tile = self.town_map_dict['right castle roof piece'] + self.blit_tile_to_map(tile, row, column, map) + elif letter == '#': + tile = self.town_map_dict['tree'] + self.blit_tile_to_map(tile, row, column, map) + elif letter == 'O': + tile = self.town_map_dict['castle door'] self.blit_tile_to_map(tile, row, column, map) tile_map.close()
M
data/states/town_layer2.txt
→
data/states/town_layer2.txt
@@ -1,36 +1,36 @@
-0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 +#TC00C00C00000C00C0CT000# +000000000L00R0000000000#0 +#0W0000M0000000000000W#0# +0#W0000000O0000000000W0#0 +#0V000T000000000T0000V#0# +0#V000000000000000000V0#0 +#0V000000000000000000V#0# +00V000000000000000000V0#0 +#TV00000000000000000TV00# +00C00C00C0000C00C00C000#0 +#00000000000000000000000# +00000000000BB000000000000 +@@@@@@@@@@@00@@@@@@@@@@@@ 0000000000000000000000000 -0333033300000000033303330 -0333033300000000033303330 -0222022200000000022202220 -02D202D20000000002D202D20 +0000000000011000000000000 +0000000000011000000000000 +0000000000011000000000000 +0000000000011000000000000 +0000000000011000000000000 +0333033300011000033303330 +0333033300011000033303330 +0222022200011000022202220 +02D202D20001100002D202D20 0010001000011000001000100 0011111111111111111111100 0000000000011000000000000 0000000000011000000000000 00000000001$*100000000000 -0000000001$*$*10000000 +0000000001$*$*10000000000 00000000001$*100000000000 0000000000011000000000000 0000000000011000000000000 -MMMMMMMMMMM11MMMMMMMMMMMM +0000000000011000000000000 0000000000011000000000000 0000000000011000000000000 0000000000011000000000000
M
data/states/town_map.txt
→
data/states/town_map.txt
@@ -1,21 +1,21 @@
0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 -0000000000000000000000000 +00C00C00C00C00C00C0C00000 +00V000000000000000000V000 +00V0000SSSSSSSSSS0000V000 +00V0000SSSSSSSSSS0000V000 +00V0000SSSSSSSSSS0000V000 +00V0000SSSSSSSSSS0000V000 +0TV000000000000000000V000 +00V000000000000000000V000 +00C00C00C0000C00C00C00000 0000000000000000000000000 00000000000BB000000000000 MMMMMMMMMMMBBMMMMMMMMMMMM -0000000000000000000000000 -0000000000011000000000000 -0000000000011000000000000 +T00000000000000000000000T 0000000000011000000000000 +T00000000001100000000000T 0000000000011000000000000 +T00000000001100000000000T 0000000000011000000000000 T33303330001100003330333T 0333033300011000033303330@@ -28,14 +28,14 @@ 0T000000000110000000000T0
T0T00000001GG100000000T0T 0T0T000001GGGG1000000T0T0 T0T00T00001GG1000000T0T0T -0000000000011000000000000 +0T000000000110000000000T0 0000000000011000000000000 MMMMMMMMMMM11MMMMMMMMMMMM -0000000000011000000000000 -0000000000011000000000000 -0000000000011000000000000 -T0T0T00000011000000000000 -0T0T000000011000000000000 +0T000000000110000000000T0 +T00000000001100000000000T +0T000000000110000000000T0 +T0T0T0000001100000000000T +0T0T0000000110000000000T0 T0T0000000011000000333T0T 0T033300000110000003330T0 T0T3330000011000000222T0T