all repos — Legends-RPG @ 3b7c7c72ba6ca35b3f03d001e978c5539f8a0ebe

A fantasy mini-RPG built with Python and Pygame.

tweaked the map, added a crown symbol when you beat the wizard.
Justin Armstrong justinmeister@gmail.com
Mon, 16 Jun 2014 11:56:49 -0700
commit

3b7c7c72ba6ca35b3f03d001e978c5539f8a0ebe

parent

03e23956af527301293a4f59072dddf0e341df8b

M data/collision.pydata/collision.py

@@ -58,8 +58,8 @@ """

portal = pg.sprite.spritecollideany(self.player, self.portals) if portal: - self.level.next = portal.name self.level.use_portal = True + self.level.portal = portal.name def check_for_blockers(self): """

@@ -108,7 +108,6 @@ Switch scene to battle 1/5 times if battles are allowed.

""" if self.level.allow_battles: self.level.game_data['battle counter'] -= 5 - if self.level.game_data['battle counter'] <= 0: self.level.switch_to_battle = True
M data/menugui.pydata/menugui.py

@@ -144,6 +144,11 @@ y = 45 + (i*30)

text_rect = render.get_rect(x=x, centery=y) surface.blit(render, text_rect) + + if self.game_data['crown quest']: + crown = setup.GFX['crown'] + crown_rect = crown.get_rect(x=178, y=40) + surface.blit(crown, crown_rect) return surface, rect
M data/states/battle.pydata/states/battle.py

@@ -149,9 +149,15 @@ enemy = person.Enemy('evilwizard', 0, 0,

'down', 'battle resting') enemy_group.add(enemy) else: - for enemy in range(random.randint(1, 6)): - enemy_group.add(person.Enemy('devil', 0, 0, - 'down', 'battle resting')) + if self.game_data['start of game']: + for enemy in range(3): + enemy_group.add(person.Enemy('devil', 0, 0, + 'down', 'battle resting')) + self.game_data['start of game'] = False + else: + for enemy in range(random.randint(1, 6)): + enemy_group.add(person.Enemy('devil', 0, 0, + 'down', 'battle resting')) for i, enemy in enumerate(enemy_group): enemy.rect.topleft = pos_list[i]
M data/states/levels.pydata/states/levels.py

@@ -29,6 +29,7 @@ self.allow_battles = battles

self.music_title = None self.previous_music = None self.music, self.volume = self.set_music() + self.portal = None def set_music(self): """

@@ -337,8 +338,8 @@ self.check_for_dialogue()

self.player.update(keys, current_time) self.sprites.update(current_time) self.collision_handler.update(keys, current_time) - self.check_for_portals() self.check_for_battle() + self.check_for_portals() self.dialogue_handler.update(keys, current_time) self.check_for_menu(keys) self.viewport_update()

@@ -351,6 +352,7 @@ """

if self.use_portal and not self.done: self.player.location = self.player.get_tile_location() self.update_game_data() + self.next = self.portal self.state = 'transition_out' def check_for_battle(self):
M data/tools.pydata/tools.py

@@ -207,7 +207,7 @@ ('power', 9)]),

'equipped weapon': 'Rapier', 'equipped armor': []} - player_health = {'current': 0, + player_health = {'current': 70, 'maximum': 70} player_magic = {'current': 70,

@@ -229,12 +229,13 @@ 'old man item': {'ELIXIR': dict([('value',1000),

('quantity',1)])}, 'player inventory': player_items, 'player stats': player_stats, - 'battle counter': random.randint(50, 255), + 'battle counter': 50, 'treasure1': True, 'treasure2': True, 'treasure3': True, 'treasure4': True, 'treasure5': True, + 'start of game': True, 'talked to king': False, 'brother quest complete': False, 'talked to sick brother': False,
M resources/tmx/dungeon3.tmxresources/tmx/dungeon3.tmx

@@ -14,7 +14,7 @@ <image source="../graphics/stairs.png" trans="5e81a2" width="32" height="16"/>

</tileset> <layer name="Tile Layer 1" width="25" height="25"> <data encoding="base64" compression="zlib"> - eJztz80KgkAYheG5wmgZLaO9labYj5Z4F5Wl3kOzzivrXUwwiAuhiVC+Aw8z3+pwlPpvPKywxgY+AmwRIkL8ZccOexxwRIIUJ5yRIR9IxwuNeSeYWnfjqOMJbd4Z5tatHXXYOz4dsqO7Q3b075Ad/TvGuGOBpfrtDm243HHBFTcUuOOBEhVq85dI2nkD3Rtw5g== + eJztz80KgkAYheG5QnEZLsV9aWZkZRbehfZ/D7rOK+tdTDCIiwEHQvgOPMx8q8NR6r9ZYoUYCdZIsUGGLXYTO3LsccARBU4occYF1Uw6Puj168E37t5RR4tOvwsExt056jB3/Dpkx3iH7LDvkB32HbLDvsPcESJSbnfUaHDFDXc88MQLb/2XSIb5AvThcCo= </data> </layer> <layer name="Tile Layer 2" width="25" height="25">
M resources/tmx/overworld.tmxresources/tmx/overworld.tmx

@@ -17,7 +17,7 @@ <image source="../graphics/house1.png" width="16" height="16"/>

</tileset> <layer name="Tile Layer 1" width="30" height="37"> <data encoding="base64" compression="zlib"> - eJztltEKwjAMRftRVmUoQx9E3f//jylMKCGNzZbbF/NwWBmDu3uTlEwppenPmIkX8Vyfb3a+gnRvxKIQumN0l0bt63e8J6TzeYOuB3dB90Bk4riC0OV+JfIAv5p2nYNVh2fY41fi4pxpLw9ApuE3/FruNU+/lpw9/Vpy9vRryTn6OfoZkbP3TtazD6D2QC1vS11nxp6899SV/wfHy++W/sqNWnv2sYY00/Uuj/Sv3SdI/0X31NBFzdQvz8icC6XH6z39ex7RZ625k779AFX2Eqc= + eJztltEKgzAMRftRcw5xiHuQTf//fxahhSzErFkSX9aHg6WIt/cmlQwppeHPmIAX8MzPlazvQbozsAk03XN0t4Pa4z3aE9z69oOuBw9G9wJ0wDUToUv9cnQn+JW0cQ5aHZphjV+O0TnTWpaATJvf5lfzX/P0q8nZ068mZ0+/mpxbP7d+jsjZeyarmQei5kApb01dJ4Ilb0td6TkoWr94prWca8l15mpNv7sa6iDB3Wk8y+P93ui3RpvirVl0e0EvQvOb512zzNERumP6nNPLOson5ujece++AX1UE2k= </data> </layer> <layer name="Tile Layer 2" width="30" height="37">

@@ -158,7 +158,7 @@ <property name="direction" value="down"/>

<property name="state" value="town"/> </properties> </object> - <object name="start point" gid="123" x="368" y="560"> + <object name="start point" gid="123" x="432" y="496"> <properties> <property name="direction" value="down"/> <property name="state" value="instructions"/>

@@ -188,16 +188,24 @@ <object name="blocker" gid="120" x="368" y="592"/>

<object name="blocker" gid="120" x="384" y="592"/> <object name="blocker" gid="120" x="368" y="496"/> <object name="blocker" gid="120" x="384" y="496"/> - <object name="blocker" gid="120" x="400" y="512"/> - <object name="blocker" gid="120" x="400" y="528"/> - <object name="blocker" gid="120" x="400" y="544"/> - <object name="blocker" gid="120" x="400" y="560"/> + <object name="blocker" gid="120" x="400" y="464"/> + <object name="blocker" gid="120" x="416" y="464"/> + <object name="blocker" gid="120" x="432" y="464"/> + <object name="blocker" gid="120" x="416" y="576"/> <object name="blocker" gid="120" x="400" y="576"/> - <object name="start point" gid="123" x="368" y="560"> + <object name="start point" gid="123" x="432" y="496"> <properties> <property name="direction" value="down"/> <property name="state" value="load game"/> </properties> </object> + <object name="blocker" gid="120" x="432" y="560"/> + <object name="blocker" gid="120" x="432" y="544"/> + <object name="blocker" gid="120" x="448" y="528"/> + <object name="blocker" gid="120" x="464" y="512"/> + <object name="blocker" gid="120" x="464" y="480"/> + <object name="blocker" gid="120" x="464" y="496"/> + <object name="blocker" gid="120" x="448" y="464"/> + <object name="blocker" gid="120" x="384" y="480"/> </objectgroup> </map>