all repos — Legends-RPG @ 61fca12ff6593e7b348fd6831f7f0323d1a3ac7c

A fantasy mini-RPG built with Python and Pygame.

Added a few more dungeon levels.
Justin Armstrong justinmeister@gmail.com
Mon, 05 May 2014 19:04:52 -0700
commit

61fca12ff6593e7b348fd6831f7f0323d1a3ac7c

parent

c5d70de66c1b6acc4456bef4e66bb278f0375c37

M data/collision.pydata/collision.py

@@ -95,7 +95,7 @@ def check_for_battle(self):

""" Switch scene to battle 1/5 times if battles are allowed. """ - random_number = random.randint(0, 10) + random_number = random.randint(0, 15) if random_number == 0: self.level.switch_to_battle = True
M data/main.pydata/main.py

@@ -18,6 +18,9 @@ OVERWORLD = 'overworld'

BROTHER_HOUSE = 'brotherhouse' BATTLE = 'battle' DUNGEON = 'dungeon' +DUNGEON2 = 'dungeon2' +DUNGEON3 = 'dungeon3' +DUNGEON4 = 'dungeon4' def main():

@@ -35,7 +38,10 @@ WEAPON_SHOP: shop.WeaponShop(),

MAGIC_SHOP: shop.MagicShop(), POTION_SHOP: shop.PotionShop(), BATTLE: battle.Battle(), - DUNGEON: levels.LevelState(DUNGEON, True) + DUNGEON: levels.LevelState(DUNGEON, True), + DUNGEON2: levels.LevelState(DUNGEON2, True), + DUNGEON3: levels.LevelState(DUNGEON3, True), + DUNGEON4: levels.LevelState(DUNGEON4, True) } run_it.setup_states(state_dict, c.MAIN_MENU)
M resources/tmx/dungeon.tmxresources/tmx/dungeon.tmx

@@ -105,6 +105,18 @@ <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"/> + <object name="portal" type="dungeon2" gid="89" x="48" y="96"/> + <object name="start point" gid="73" x="48" y="112"> + <properties> + <property name="state" value="dungeon2"/> + </properties> + </object> + <object name="portal" type="dungeon4" gid="89" x="336" y="96"/> + <object name="start point" gid="73" x="336" y="112"> + <properties> + <property name="state" value="dungeon4"/> + </properties> + </object> </objectgroup> <layer name="Tile Layer 2" width="25" height="27"> <data encoding="base64" compression="zlib">
A resources/tmx/dungeon2.tmx

@@ -0,0 +1,132 @@

+<?xml version="1.0" encoding="UTF-8"?> +<map version="1.0" orientation="orthogonal" width="25" height="25" 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="25"> + <data encoding="base64" compression="zlib"> + eJzdlFsKACAIBL3/gTxfvyIimrtRCUGQzvSQRP4LdYPBUJc3cVheZw8dR3YOtiPK3eGzalBvyOBXGAh+xkLyPXPae7c4/JzhYJ0j4rN7qrKG4CM8rL9kctfV2lMOKeRlDsuZ7AVd+0IsUh5T5Q== + </data> + </layer> + <objectgroup name="Object Layer 1" width="25" height="25"> + <object name="start point" gid="73" x="208" y="240"> + <properties> + <property name="state" value="dungeon"/> + </properties> + </object> + <object name="portal" type="dungeon" gid="89" x="208" y="224"/> + <object name="blocker" gid="70" x="256" y="224"/> + <object name="blocker" gid="70" x="256" y="192"/> + <object name="blocker" gid="70" x="256" y="208"/> + <object name="blocker" gid="70" x="272" y="176"/> + <object name="blocker" gid="70" x="288" y="160"/> + <object name="blocker" gid="70" x="304" y="144"/> + <object name="blocker" gid="70" x="320" y="128"/> + <object name="blocker" gid="70" x="336" y="112"/> + <object name="blocker" gid="70" x="352" y="112"/> + <object name="blocker" gid="70" x="368" y="112"/> + <object name="blocker" gid="70" x="384" y="96"/> + <object name="blocker" gid="70" x="384" y="80"/> + <object name="blocker" gid="70" x="384" y="48"/> + <object name="blocker" gid="70" x="384" y="64"/> + <object name="blocker" gid="70" x="368" y="32"/> + <object name="blocker" gid="70" x="352" y="32"/> + <object name="blocker" gid="70" x="336" y="32"/> + <object name="blocker" gid="70" x="320" y="32"/> + <object name="blocker" gid="70" x="304" y="48"/> + <object name="blocker" gid="70" x="304" y="64"/> + <object name="blocker" gid="70" x="304" y="80"/> + <object name="blocker" gid="70" x="304" y="96"/> + <object name="blocker" gid="70" x="288" y="112"/> + <object name="blocker" gid="70" x="272" y="128"/> + <object name="blocker" gid="70" x="256" y="144"/> + <object name="blocker" gid="70" x="240" y="160"/> + <object name="blocker" gid="70" x="224" y="176"/> + <object name="blocker" gid="70" x="208" y="176"/> + <object name="blocker" gid="70" x="192" y="176"/> + <object name="blocker" gid="70" x="176" y="160"/> + <object name="blocker" gid="70" x="160" y="144"/> + <object name="blocker" gid="70" x="144" y="128"/> + <object name="blocker" gid="70" x="128" y="112"/> + <object name="blocker" gid="70" x="112" y="96"/> + <object name="blocker" gid="70" x="112" y="80"/> + <object name="blocker" gid="70" x="112" y="64"/> + <object name="blocker" gid="70" x="112" y="48"/> + <object name="blocker" gid="70" x="96" y="32"/> + <object name="blocker" gid="70" x="80" y="32"/> + <object name="blocker" gid="70" x="64" y="32"/> + <object name="blocker" gid="70" x="48" y="32"/> + <object name="blocker" gid="70" x="32" y="48"/> + <object name="blocker" gid="70" x="32" y="64"/> + <object name="blocker" gid="70" x="32" y="80"/> + <object name="blocker" gid="70" x="32" y="96"/> + <object name="blocker" gid="70" x="48" y="112"/> + <object name="blocker" gid="70" x="64" y="112"/> + <object name="blocker" gid="70" x="80" y="112"/> + <object name="blocker" gid="70" x="96" y="128"/> + <object name="blocker" gid="70" x="112" y="144"/> + <object name="blocker" gid="70" x="128" y="160"/> + <object name="blocker" gid="70" x="144" y="176"/> + <object name="blocker" gid="70" x="160" y="192"/> + <object name="blocker" gid="70" x="160" y="208"/> + <object name="blocker" gid="70" x="160" y="224"/> + <object name="blocker" gid="70" x="160" y="240"/> + <object name="blocker" gid="70" x="144" y="256"/> + <object name="blocker" gid="70" x="128" y="272"/> + <object name="blocker" gid="70" x="112" y="288"/> + <object name="blocker" gid="70" x="96" y="304"/> + <object name="blocker" gid="70" x="80" y="304"/> + <object name="blocker" gid="70" x="64" y="304"/> + <object name="blocker" gid="70" x="48" y="320"/> + <object name="blocker" gid="70" x="48" y="336"/> + <object name="blocker" gid="70" x="48" y="352"/> + <object name="blocker" gid="70" x="48" y="368"/> + <object name="blocker" gid="70" x="64" y="384"/> + <object name="blocker" gid="70" x="80" y="384"/> + <object name="blocker" gid="70" x="96" y="384"/> + <object name="blocker" gid="70" x="112" y="384"/> + <object name="blocker" gid="70" x="128" y="352"/> + <object name="blocker" gid="70" x="128" y="368"/> + <object name="blocker" gid="70" x="128" y="336"/> + <object name="blocker" gid="70" x="128" y="320"/> + <object name="blocker" gid="70" x="144" y="304"/> + <object name="blocker" gid="70" x="176" y="272"/> + <object name="blocker" gid="70" x="160" y="288"/> + <object name="blocker" gid="70" x="192" y="272"/> + <object name="blocker" gid="70" x="208" y="272"/> + <object name="blocker" gid="70" x="224" y="272"/> + <object name="blocker" gid="70" x="240" y="272"/> + <object name="blocker" gid="70" x="256" y="288"/> + <object name="blocker" gid="70" x="272" y="304"/> + <object name="blocker" gid="70" x="288" y="320"/> + <object name="blocker" gid="70" x="288" y="336"/> + <object name="blocker" gid="70" x="288" y="352"/> + <object name="blocker" gid="70" x="288" y="368"/> + <object name="blocker" gid="70" x="304" y="384"/> + <object name="blocker" gid="70" x="320" y="384"/> + <object name="blocker" gid="70" x="336" y="384"/> + <object name="blocker" gid="70" x="352" y="384"/> + <object name="blocker" gid="70" x="368" y="368"/> + <object name="blocker" gid="70" x="368" y="352"/> + <object name="blocker" gid="70" x="368" y="336"/> + <object name="blocker" gid="70" x="368" y="320"/> + <object name="blocker" gid="70" x="352" y="304"/> + <object name="blocker" gid="70" x="336" y="304"/> + <object name="blocker" gid="70" x="320" y="304"/> + <object name="blocker" gid="70" x="304" y="288"/> + <object name="blocker" gid="70" x="288" y="272"/> + <object name="blocker" gid="70" x="272" y="256"/> + <object name="blocker" gid="70" x="256" y="224"/> + <object name="blocker" gid="70" x="256" y="224"/> + <object name="blocker" gid="70" x="256" y="240"/> + <object name="portal" type="dungeon3" gid="89" x="352" y="64"/> + <object name="start point" gid="73" x="352" y="80"> + <properties> + <property name="state" value="dungeon3"/> + </properties> + </object> + </objectgroup> +</map>
A resources/tmx/dungeon3.tmx

@@ -0,0 +1,80 @@

+<?xml version="1.0" encoding="UTF-8"?> +<map version="1.0" orientation="orthogonal" width="25" height="25" 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> + <tileset firstgid="243" name="castledoor" tilewidth="16" tileheight="16"> + <image source="../graphics/castledoor.png" width="32" height="48"/> + </tileset> + <layer name="Tile Layer 1" width="25" height="25"> + <data encoding="base64" compression="zlib"> + eJztz80KgkAYheG5wmgpLaN9plaklT94F1r2cw+51ivzXYwwiAuhiSi+Aw8z3+pwlPpu1nCxgQcfAbbYYY/Dmx0hIhxxwhkxEqTIkP9IR4NWvzPMjbu11PFCrV8HC+OuLXWYO/oO2THeITumd8iO6R3/uGOJlfrsjj42dxQoccEVFW6444Gn/kskw3Q16m94 + </data> + </layer> + <objectgroup name="Object Layer 1" width="25" height="25" visible="0"> + <object name="portal" type="dungeon2" gid="89" x="176" y="304"/> + <object name="portal" type="dungeon4" gid="89" x="192" y="304"/> + <object name="start point" gid="73" x="176" y="288"> + <properties> + <property name="state" value="dungeon2"/> + </properties> + </object> + <object name="start point" gid="73" x="192" y="288"> + <properties> + <property name="state" value="dungeon4"/> + </properties> + </object> + <object name="blocker" gid="70" x="256" y="144"/> + <object name="blocker" gid="70" x="224" y="320"/> + <object name="blocker" gid="70" x="160" y="64"/> + <object name="blocker" gid="70" x="256" y="304"/> + <object name="blocker" gid="70" x="256" y="240"/> + <object name="blocker" gid="70" x="256" y="176"/> + <object name="blocker" gid="70" x="256" y="192"/> + <object name="blocker" gid="70" x="240" y="320"/> + <object name="blocker" gid="70" x="256" y="224"/> + <object name="blocker" gid="70" x="256" y="256"/> + <object name="blocker" gid="70" x="256" y="272"/> + <object name="blocker" gid="70" x="256" y="288"/> + <object name="blocker" gid="70" x="256" y="208"/> + <object name="blocker" gid="70" x="208" y="320"/> + <object name="blocker" gid="70" x="224" y="64"/> + <object name="blocker" gid="70" x="208" y="64"/> + <object name="blocker" gid="70" x="256" y="80"/> + <object name="blocker" gid="70" x="256" y="96"/> + <object name="blocker" gid="70" x="240" y="64"/> + <object name="blocker" gid="70" x="192" y="320"/> + <object name="blocker" gid="70" x="176" y="320"/> + <object name="blocker" gid="70" x="256" y="112"/> + <object name="blocker" gid="70" x="256" y="128"/> + <object name="blocker" gid="70" x="256" y="160"/> + <object name="blocker" gid="70" x="112" y="208"/> + <object name="blocker" gid="70" x="112" y="240"/> + <object name="blocker" gid="70" x="112" y="272"/> + <object name="blocker" gid="70" x="144" y="320"/> + <object name="blocker" gid="70" x="160" y="320"/> + <object name="blocker" gid="70" x="128" y="320"/> + <object name="blocker" gid="70" x="112" y="288"/> + <object name="blocker" gid="70" x="112" y="224"/> + <object name="blocker" gid="70" x="112" y="176"/> + <object name="blocker" gid="70" x="112" y="192"/> + <object name="blocker" gid="70" x="112" y="144"/> + <object name="blocker" gid="70" x="112" y="128"/> + <object name="blocker" gid="70" x="112" y="160"/> + <object name="blocker" gid="70" x="112" y="256"/> + <object name="blocker" gid="70" x="112" y="304"/> + <object name="blocker" gid="70" x="128" y="64"/> + <object name="blocker" gid="70" x="112" y="80"/> + <object name="blocker" gid="70" x="144" y="64"/> + <object name="blocker" gid="70" x="112" y="112"/> + <object name="blocker" gid="70" x="112" y="96"/> + </objectgroup> + <layer name="Tile Layer 2" width="25" height="25"> + <data encoding="base64" compression="zlib"> + eJxjYBhc4DMQf6GxHV+B+BuN7fgOxD9obMcoGAWjYBSMglEwCkYuAACy2gXC + </data> + </layer> +</map>
A resources/tmx/dungeon4.tmx

@@ -0,0 +1,129 @@

+<?xml version="1.0" encoding="UTF-8"?> +<map version="1.0" orientation="orthogonal" width="25" height="25" 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="25"> + <data encoding="base64" compression="zlib"> + eJxjYBhcYBsSHrWDOHtoDQarHaSGMbl2kKKXUn8Q4x9qxMdA20Gt/IEt7NDNJkYNNezHp4ZSMNDxBZOnNOxIyUfDwQ5KwHCwY7jUtfSqz8kBAIuDOCs= + </data> + </layer> + <objectgroup name="Object Layer 1" width="25" height="25"> + <object name="portal" type="dungeon" gid="89" x="192" y="208"/> + <object name="start point" gid="73" x="192" y="224"> + <properties> + <property name="state" value="dungeon"/> + </properties> + </object> + <object name="portal" type="dungeon3" gid="89" x="16" y="144"/> + <object name="blocker" gid="70" x="336" y="208"/> + <object name="blocker" gid="70" x="272" y="192"/> + <object name="blocker" gid="70" x="336" y="240"/> + <object name="blocker" gid="70" x="352" y="240"/> + <object name="blocker" gid="70" x="320" y="192"/> + <object name="blocker" gid="70" x="288" y="192"/> + <object name="blocker" gid="70" x="256" y="192"/> + <object name="blocker" gid="70" x="240" y="192"/> + <object name="blocker" gid="70" x="224" y="192"/> + <object name="blocker" gid="70" x="336" y="224"/> + <object name="blocker" gid="70" x="304" y="192"/> + <object name="blocker" gid="70" x="384" y="240"/> + <object name="blocker" gid="70" x="368" y="240"/> + <object name="blocker" gid="70" x="384" y="304"/> + <object name="blocker" gid="70" x="368" y="304"/> + <object name="blocker" gid="70" x="352" y="304"/> + <object name="blocker" gid="70" x="336" y="288"/> + <object name="blocker" gid="70" x="336" y="272"/> + <object name="blocker" gid="70" x="320" y="272"/> + <object name="blocker" gid="70" x="304" y="256"/> + <object name="blocker" gid="70" x="304" y="240"/> + <object name="blocker" gid="70" x="304" y="224"/> + <object name="blocker" gid="70" x="288" y="224"/> + <object name="blocker" gid="70" x="272" y="224"/> + <object name="blocker" gid="70" x="256" y="224"/> + <object name="blocker" gid="70" x="240" y="224"/> + <object name="blocker" gid="70" x="224" y="224"/> + <object name="blocker" gid="70" x="208" y="240"/> + <object name="blocker" gid="70" x="208" y="256"/> + <object name="blocker" gid="70" x="208" y="272"/> + <object name="blocker" gid="70" x="208" y="288"/> + <object name="blocker" gid="70" x="208" y="304"/> + <object name="blocker" gid="70" x="208" y="320"/> + <object name="blocker" gid="70" x="208" y="336"/> + <object name="blocker" gid="70" x="224" y="352"/> + <object name="blocker" gid="70" x="224" y="368"/> + <object name="blocker" gid="70" x="224" y="384"/> + <object name="blocker" gid="70" x="208" y="400"/> + <object name="blocker" gid="70" x="192" y="400"/> + <object name="blocker" gid="70" x="176" y="400"/> + <object name="blocker" gid="70" x="160" y="384"/> + <object name="blocker" gid="70" x="160" y="368"/> + <object name="blocker" gid="70" x="160" y="352"/> + <object name="blocker" gid="70" x="176" y="336"/> + <object name="blocker" gid="70" x="176" y="320"/> + <object name="blocker" gid="70" x="176" y="304"/> + <object name="blocker" gid="70" x="176" y="288"/> + <object name="blocker" gid="70" x="176" y="256"/> + <object name="blocker" gid="70" x="176" y="272"/> + <object name="blocker" gid="70" x="176" y="240"/> + <object name="blocker" gid="70" x="160" y="224"/> + <object name="blocker" gid="70" x="144" y="224"/> + <object name="blocker" gid="70" x="128" y="224"/> + <object name="blocker" gid="70" x="112" y="224"/> + <object name="blocker" gid="70" x="96" y="224"/> + <object name="blocker" gid="70" x="80" y="224"/> + <object name="blocker" gid="70" x="64" y="224"/> + <object name="blocker" gid="70" x="48" y="208"/> + <object name="blocker" gid="70" x="48" y="192"/> + <object name="blocker" gid="70" x="48" y="176"/> + <object name="blocker" gid="70" x="32" y="176"/> + <object name="blocker" gid="70" x="16" y="176"/> + <object name="blocker" gid="70" x="0" y="176"/> + <object name="blocker" gid="70" x="-16" y="160"/> + <object name="blocker" gid="70" x="-16" y="144"/> + <object name="blocker" gid="70" x="-16" y="128"/> + <object name="blocker" gid="70" x="16" y="112"/> + <object name="blocker" gid="70" x="0" y="112"/> + <object name="blocker" gid="70" x="32" y="112"/> + <object name="blocker" gid="70" x="48" y="128"/> + <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="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="96" y="192"/> + <object name="blocker" gid="70" x="112" y="192"/> + <object name="blocker" gid="70" x="128" y="192"/> + <object name="blocker" gid="70" x="144" y="192"/> + <object name="blocker" gid="70" x="160" y="192"/> + <object name="blocker" gid="70" x="176" y="160"/> + <object name="blocker" gid="70" x="176" y="176"/> + <object name="blocker" gid="70" x="176" y="144"/> + <object name="blocker" gid="70" x="176" y="128"/> + <object name="blocker" gid="70" x="176" y="112"/> + <object name="blocker" gid="70" x="176" y="96"/> + <object name="blocker" gid="70" x="176" y="80"/> + <object name="blocker" gid="70" x="160" y="64"/> + <object name="blocker" gid="70" x="160" y="48"/> + <object name="blocker" gid="70" x="160" y="32"/> + <object name="blocker" gid="70" x="176" y="16"/> + <object name="blocker" gid="70" x="192" y="16"/> + <object name="blocker" gid="70" x="208" y="16"/> + <object name="blocker" gid="70" x="224" y="32"/> + <object name="blocker" gid="70" x="224" y="48"/> + <object name="blocker" gid="70" x="224" y="64"/> + <object name="blocker" gid="70" x="208" y="80"/> + <object name="blocker" gid="70" x="208" y="96"/> + <object name="blocker" gid="70" x="208" y="112"/> + <object name="blocker" gid="70" x="208" y="128"/> + <object name="blocker" gid="70" x="208" y="144"/> + <object name="blocker" gid="70" x="208" y="160"/> + <object name="blocker" gid="70" x="208" y="176"/> + <object name="blocker" gid="70" x="400" y="256"/> + <object name="blocker" gid="70" x="400" y="272"/> + <object name="blocker" gid="70" x="400" y="288"/> + </objectgroup> +</map>