comparison pytouhou/games/sample/game.py @ 600:2a748aa29c3f

Add a sample character.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 25 Oct 2014 18:52:56 +0200
parents d471b07ce4fd
children 2cf518129725
comparison
equal deleted inserted replaced
599:d471b07ce4fd 600:2a748aa29c3f
21 from pytouhou.game.player import Player as PlayerBase 21 from pytouhou.game.player import Player as PlayerBase
22 from pytouhou.game.orb import Orb 22 from pytouhou.game.orb import Orb
23 from pytouhou.game.background import Background 23 from pytouhou.game.background import Background
24 24
25 from pytouhou.vm import PythonMainRunner 25 from pytouhou.vm import PythonMainRunner
26 from . import enemies 26 from . import enemies, shots
27 27
28 28
29 class Common(object): 29 class Common(object):
30 def __init__(self, resource_loader, player_characters, continues, stage, 30 def __init__(self, resource_loader, player_characters, continues, stage,
31 width=384, height=448): 31 width=384, height=448):
76 ('face09b.anm', 'face10a.anm', 'face10b.anm'), 76 ('face09b.anm', 'face10a.anm', 'face10b.anm'),
77 ('face08a.anm', 'face12a.anm', 'face12b.anm', 'face12c.anm')] 77 ('face08a.anm', 'face12a.anm', 'face12b.anm', 'face12c.anm')]
78 78
79 default_power = [0, 64, 128, 128, 128, 128, 0][stage] 79 default_power = [0, 64, 128, 128, 128, 128, 0][stage]
80 80
81 eosd_characters = resource_loader.get_eosd_characters() 81 sample_characters = shots.characters
82 self.first_character = player_characters[0] // 2 82 self.first_character = player_characters[0] // 2
83 self.player_anms = {} 83 self.player_anms = {}
84 self.players = [None] * len(player_characters) 84 self.players = [None] * len(player_characters)
85 for i, player_character in enumerate(player_characters): 85 for i, player_character in enumerate(player_characters):
86 character = player_character // 2 86 character = player_character // 2
90 'face0%dc.anm' % character)) 90 'face0%dc.anm' % character))
91 anm = resource_loader.get_single_anm('player0%d.anm' % character) 91 anm = resource_loader.get_single_anm('player0%d.anm' % character)
92 self.player_anms[character] = (anm, face) 92 self.player_anms[character] = (anm, face)
93 93
94 self.players[i] = Player(i, self.player_anms[character][0], 94 self.players[i] = Player(i, self.player_anms[character][0],
95 eosd_characters[player_character], 95 sample_characters[player_character],
96 character, default_power, continues) 96 character, default_power, continues)
97 97
98 98
99 99
100 class Game(GameBase): 100 class Game(GameBase):