Added main level of dungeon.
Justin Armstrong justinmeister@gmail.com
Mon, 05 May 2014 15:29:11 -0700
5 files changed,
134 insertions(+),
11 deletions(-)
M
data/constants.py
→
data/constants.py
@@ -19,15 +19,15 @@ BATTLE = 'battle'
##Colors -BLACK = (0, 0, 0) -NEAR_BLACK = (1, 0, 0) -WHITE = (255, 255, 255) -BLACK_BLUE = (19, 15, 48) -NEAR_BLACK_BLUE = (20, 15, 48) -LIGHT_BLUE = (0, 153, 204) -DARK_RED = (118, 27, 12) -RED = (255, 0, 0) -GREEN = (0, 255, 0) +BLACK = 0, 0, 0 +NEAR_BLACK = 1, 0, 0 +WHITE = 255, 255, 255 +BLACK_BLUE = 19, 15, 48 +NEAR_BLACK_BLUE = 20, 15, 48 +LIGHT_BLUE = 0, 153, 204 +DARK_RED = 118, 27, 12 +RED = 255, 0, 0 +GREEN = 0, 255, 0 MAIN_FONT = 'DroidSans'
M
data/main.py
→
data/main.py
@@ -17,6 +17,7 @@ PLAYER_MENU = 'player menu'
OVERWORLD = 'overworld' BROTHER_HOUSE = 'brotherhouse' BATTLE = 'battle' +DUNGEON = 'dungeon' def main():@@ -33,7 +34,8 @@ ARMOR_SHOP: shop.ArmorShop(),
WEAPON_SHOP: shop.WeaponShop(), MAGIC_SHOP: shop.MagicShop(), POTION_SHOP: shop.PotionShop(), - BATTLE: battle.Battle() + BATTLE: battle.Battle(), + DUNGEON: levels.LevelState(DUNGEON, True) } run_it.setup_states(state_dict, c.MAIN_MENU)
M
data/states/levels.py
→
data/states/levels.py
@@ -31,7 +31,7 @@ self.current_time = current_time
self.state = 'normal' self.switch_to_battle = False self.allow_input = False - self.cut_off_bottom_map = ['castle', 'town'] + self.cut_off_bottom_map = ['castle', 'town', 'dungeon'] self.renderer = tilerender.Renderer(self.tmx_map) self.map_image = self.renderer.make_2x_map()
A
resources/tmx/dungeon.tmx
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?> +<map version="1.0" orientation="orthogonal" width="25" height="27" tilewidth="16" tileheight="16" backgroundcolor="#130f30"> + <tileset firstgid="1" name="tileset2" tilewidth="16" tileheight="16"> + <image source="../graphics/tileset2.png" width="160" height="180"/> + </tileset> + <tileset firstgid="111" name="tileset3" tilewidth="16" tileheight="16"> + <image source="../graphics/tileset3.png" width="176" height="192"/> + </tileset> + <layer name="Tile Layer 1" width="25" height="27"> + <data encoding="base64" compression="zlib"> + eJztlUkOwjAMRX1CYAldQveIUWLacQugDIeg6+Zk/EiJaiwXCLQIoUR6ihs3fkqy8JCIxmACpmAG5m5tVJELWV+AJdiAFVi7WH5/Em+/6LgqtEA7gI5SI2eOQsl3QS+AxNUpWD3psBCL33HkDmKxdBhGHwwYWl2eT8V+ozhkXiLPlVS8o8Q6dmCvzPLtNEchsPvO4AJOLNYGv79nDkP37/vq4PcXHdHxjw6fi+f4jXPU5fBzkw7fz5p0POpR8qwhDtunMnCkstfI3ptS2c8O7v8swFH3uAG1VgYY + </data> + </layer> + <objectgroup name="Object Layer 1" width="25" height="27"> + <object name="start point" gid="73" x="192" y="416"> + <properties> + <property name="state" value="overworld"/> + </properties> + </object> + <object name="portal" type="overworld" gid="89" x="224" y="432"/> + <object name="portal" type="overworld" gid="89" x="208" y="432"/> + <object name="portal" type="overworld" gid="89" x="192" y="432"/> + <object name="portal" type="overworld" gid="89" x="176" y="432"/> + <object name="portal" type="overworld" gid="89" x="160" y="432"/> + <object name="blocker" gid="70" x="304" y="144"/> + <object name="blocker" gid="70" x="320" y="144"/> + <object name="blocker" gid="70" x="336" y="144"/> + <object name="blocker" gid="70" x="352" y="144"/> + <object name="blocker" gid="70" x="368" y="144"/> + <object name="blocker" gid="70" x="384" y="128"/> + <object name="blocker" gid="70" x="384" y="96"/> + <object name="blocker" gid="70" x="384" y="112"/> + <object name="blocker" gid="70" x="384" y="80"/> + <object name="blocker" gid="70" x="384" y="64"/> + <object name="blocker" gid="70" x="368" y="48"/> + <object name="blocker" gid="70" x="352" y="48"/> + <object name="blocker" gid="70" x="336" y="48"/> + <object name="blocker" gid="70" x="320" y="48"/> + <object name="blocker" gid="70" x="304" y="48"/> + <object name="blocker" gid="70" x="288" y="48"/> + <object name="blocker" gid="70" x="272" y="48"/> + <object name="blocker" gid="70" x="256" y="48"/> + <object name="blocker" gid="70" x="240" y="48"/> + <object name="blocker" gid="70" x="224" y="48"/> + <object name="blocker" gid="70" x="208" y="48"/> + <object name="blocker" gid="70" x="192" y="48"/> + <object name="blocker" gid="70" x="176" y="48"/> + <object name="blocker" gid="70" x="160" y="48"/> + <object name="blocker" gid="70" x="144" y="48"/> + <object name="blocker" gid="70" x="128" y="48"/> + <object name="blocker" gid="70" x="112" y="48"/> + <object name="blocker" gid="70" x="96" y="48"/> + <object name="blocker" gid="70" x="80" y="48"/> + <object name="blocker" gid="70" x="64" y="48"/> + <object name="blocker" gid="70" x="48" y="48"/> + <object name="blocker" gid="70" x="32" y="48"/> + <object name="blocker" gid="70" x="16" y="48"/> + <object name="blocker" gid="70" x="0" y="64"/> + <object name="blocker" gid="70" x="0" y="80"/> + <object name="blocker" gid="70" x="0" y="96"/> + <object name="blocker" gid="70" x="0" y="112"/> + <object name="blocker" gid="70" x="0" y="128"/> + <object name="blocker" gid="70" x="16" y="144"/> + <object name="blocker" gid="70" x="32" y="144"/> + <object name="blocker" gid="70" x="48" y="144"/> + <object name="blocker" gid="70" x="64" y="144"/> + <object name="blocker" gid="70" x="80" y="144"/> + <object name="blocker" gid="70" x="80" y="160"/> + <object name="blocker" gid="70" x="80" y="176"/> + <object name="blocker" gid="70" x="80" y="192"/> + <object name="blocker" gid="70" x="80" y="208"/> + <object name="blocker" gid="70" x="80" y="224"/> + <object name="blocker" gid="70" x="80" y="240"/> + <object name="blocker" gid="70" x="80" y="256"/> + <object name="blocker" gid="70" x="80" y="272"/> + <object name="blocker" gid="70" x="80" y="288"/> + <object name="blocker" gid="70" x="80" y="304"/> + <object name="blocker" gid="70" x="80" y="320"/> + <object name="blocker" gid="70" x="80" y="336"/> + <object name="blocker" gid="70" x="80" y="352"/> + <object name="blocker" gid="70" x="80" y="368"/> + <object name="blocker" gid="70" x="80" y="384"/> + <object name="blocker" gid="70" x="80" y="400"/> + <object name="blocker" gid="70" x="96" y="416"/> + <object name="blocker" gid="70" x="112" y="416"/> + <object name="blocker" gid="70" x="128" y="416"/> + <object name="blocker" gid="70" x="144" y="416"/> + <object name="blocker" gid="70" x="240" y="416"/> + <object name="blocker" gid="70" x="256" y="416"/> + <object name="blocker" gid="70" x="272" y="416"/> + <object name="blocker" gid="70" x="288" y="416"/> + <object name="blocker" gid="70" x="304" y="400"/> + <object name="blocker" gid="70" x="304" y="368"/> + <object name="blocker" gid="70" x="304" y="384"/> + <object name="blocker" gid="70" x="304" y="352"/> + <object name="blocker" gid="70" x="304" y="320"/> + <object name="blocker" gid="70" x="304" y="336"/> + <object name="blocker" gid="70" x="304" y="288"/> + <object name="blocker" gid="70" x="304" y="304"/> + <object name="blocker" gid="70" x="304" y="272"/> + <object name="blocker" gid="70" x="304" y="256"/> + <object name="blocker" gid="70" x="304" y="224"/> + <object name="blocker" gid="70" x="304" y="240"/> + <object name="blocker" gid="70" x="304" y="208"/> + <object name="blocker" gid="70" x="304" y="176"/> + <object name="blocker" gid="70" x="304" y="192"/> + <object name="blocker" gid="70" x="304" y="160"/> + </objectgroup> + <layer name="Tile Layer 2" width="25" height="27"> + <data encoding="base64" compression="zlib"> + eJxjYKAP6EHj9yKx+3CoI0YNsvh0NDtmILFn4lBHjBpk8VEwCkbBKBgFo2AUjIJRQD0AAG1HCSk= + </data> + </layer> +</map>
M
resources/tmx/overworld.tmx
→
resources/tmx/overworld.tmx
@@ -168,5 +168,12 @@ <properties>
<property name="state" value="brotherhouse"/> </properties> </object> + <object name="start point" gid="123" x="80" y="128"> + <properties> + <property name="state" value="dungeon"/> + </properties> + </object> + <object name="portal" type="dungeon" gid="139" x="80" y="112"/> + <object name="portal" type="dungeon" gid="139" x="64" y="112"/> </objectgroup> </map>