Mercurial > touhou
annotate pytouhou/games/pcb.py @ 277:219edad0f395
Fix initial laser offset.
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Mon, 06 Feb 2012 19:17:46 +0100 |
parents | f037bca24f2d |
children |
rev | line source |
---|---|
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 # -*- encoding: utf-8 -*- |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 ## |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 ## Copyright (C) 2011 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 ## |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 ## This program is free software; you can redistribute it and/or modify |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 ## it under the terms of the GNU General Public License as published |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 ## by the Free Software Foundation; version 3 only. |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 ## |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 ## This program is distributed in the hope that it will be useful, |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 ## GNU General Public License for more details. |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 ## |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 from pytouhou.utils.interpolator import Interpolator |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
17 from pytouhou.game.game import Game |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
18 from pytouhou.game.bullettype import BulletType |
274
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
19 from pytouhou.game.bullettype import LaserType |
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 from pytouhou.game.itemtype import ItemType |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
21 from pytouhou.game.player import Player |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 from pytouhou.game.orb import Orb |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
24 from math import pi |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
25 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
26 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
27 class PCBGame(Game): |
274
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
28 def __init__(self, resource_loader, player_states, stage, rank, difficulty, |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
29 bullet_types=None, laser_types=None, item_types=None, |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
30 nb_bullets_max=640, width=384, height=448, prng=None): |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
31 if not bullet_types: |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
32 etama3 = resource_loader.get_anm_wrapper(('etama3.anm',)) |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
33 etama4 = resource_loader.get_anm_wrapper(('etama4.anm',)) |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
34 bullet_types = [BulletType(etama3, 0, 11, 14, 15, 16, hitbox_size=4), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
35 BulletType(etama3, 1, 12, 17, 18, 19, hitbox_size=6), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
36 BulletType(etama3, 2, 12, 17, 18, 19, hitbox_size=4), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
37 BulletType(etama3, 3, 12, 17, 18, 19, hitbox_size=6), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
38 BulletType(etama3, 4, 12, 17, 18, 19, hitbox_size=5), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
39 BulletType(etama3, 5, 12, 17, 18, 19, hitbox_size=4), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
40 BulletType(etama3, 6, 13, 20, 20, 20, hitbox_size=16), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
41 BulletType(etama3, 7, 13, 20, 20, 20, hitbox_size=11), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
42 BulletType(etama3, 8, 13, 20, 20, 20, hitbox_size=9), |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
43 BulletType(etama4, 0, 1, 2, 2, 2, hitbox_size=32)] |
235
e59bd7979ddc
Do a little cleanup, and fix PCB SHT usage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
232
diff
changeset
|
44 |
274
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
45 if not laser_types: |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
46 laser_types = [] #TODO |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
47 |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
48 if not item_types: |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
49 item_types = [ItemType(etama3, 0, 7), #Power |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
50 ItemType(etama3, 1, 8), #Point |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
51 ItemType(etama3, 2, 9), #Big power |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
52 ItemType(etama3, 3, 10), #Bomb |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
53 ItemType(etama3, 4, 11), #Full power |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
54 ItemType(etama3, 5, 12), #1up |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
55 ItemType(etama3, 6, 13)] #Star |
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
56 |
235
e59bd7979ddc
Do a little cleanup, and fix PCB SHT usage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
232
diff
changeset
|
57 players = [PCBPlayer(state, self, resource_loader) for state in player_states] |
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
58 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
59 Game.__init__(self, resource_loader, players, stage, rank, difficulty, |
274
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
60 bullet_types, laser_types, item_types, nb_bullets_max, |
f037bca24f2d
Partially implement lasers.
Thibaut Girka <thib@sitedethib.com>
parents:
235
diff
changeset
|
61 width, height, prng) |
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
62 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
63 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
64 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
65 class PCBPlayer(Player): |
235
e59bd7979ddc
Do a little cleanup, and fix PCB SHT usage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
232
diff
changeset
|
66 def __init__(self, state, game, resource_loader): |
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
67 number = '%d%s' % (state.character // 2, 'b' if state.character % 2 else 'a') |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
68 self.sht = resource_loader.get_sht('ply0%s.sht' % number) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
69 self.focused_sht = resource_loader.get_sht('ply0%ss.sht' % number) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
70 anm_wrapper = resource_loader.get_anm_wrapper(('player0%d.anm' % (state.character // 2),)) |
235
e59bd7979ddc
Do a little cleanup, and fix PCB SHT usage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
232
diff
changeset
|
71 self.anm_wrapper = anm_wrapper |
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
72 |
235
e59bd7979ddc
Do a little cleanup, and fix PCB SHT usage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
232
diff
changeset
|
73 Player.__init__(self, state, game, anm_wrapper) |
220
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
74 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
75 self.orbs = [Orb(self.anm_wrapper, 128, self.state, None), |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
76 Orb(self.anm_wrapper, 129, self.state, None)] |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
77 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
78 self.orbs[0].offset_x = -24 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
79 self.orbs[1].offset_x = 24 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
80 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
81 self.orb_dx_interpolator = None |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
82 self.orb_dy_interpolator = None |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
83 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
84 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
85 def start_focusing(self): |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
86 self.orb_dx_interpolator = Interpolator((24,), self._game.frame, |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
87 (8,), self._game.frame + 8, |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
88 lambda x: x ** 2) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
89 self.orb_dy_interpolator = Interpolator((0,), self._game.frame, |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
90 (-32,), self._game.frame + 8) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
91 self.state.focused = True |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
92 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
93 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
94 def stop_focusing(self): |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
95 self.orb_dx_interpolator = Interpolator((8,), self._game.frame, |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
96 (24,), self._game.frame + 8, |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
97 lambda x: x ** 2) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
98 self.orb_dy_interpolator = Interpolator((-32,), self._game.frame, |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
99 (0,), self._game.frame + 8) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
100 self.state.focused = False |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
101 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
102 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
103 def objects(self): |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
104 return self.orbs |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
105 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
106 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
107 def update(self, keystate): |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
108 Player.update(self, keystate) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
109 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
110 if self.death_time == 0 or self._game.frame - self.death_time > 60: |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
111 if self.orb_dx_interpolator: |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
112 self.orb_dx_interpolator.update(self._game.frame) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
113 dx, = self.orb_dx_interpolator.values |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
114 self.orbs[0].offset_x = -dx |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
115 self.orbs[1].offset_x = dx |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
116 if self.orb_dy_interpolator: |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
117 self.orb_dy_interpolator.update(self._game.frame) |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
118 dy, = self.orb_dy_interpolator.values |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
119 self.orbs[0].offset_y = dy |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
120 self.orbs[1].offset_y = dy |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
121 |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
122 for orb in self.orbs: |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
123 orb.update() |
0595315d3880
Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
124 |