Mercurial > touhou
annotate pytouhou/games/sample/interface.py @ 760:eba9a3d0c484
formats: Fix the tests.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 05 Jan 2021 04:28:45 +0100 |
parents | d1f0bb0b7a17 |
children |
rev | line source |
---|---|
549
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 # -*- encoding: utf-8 -*- |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 ## |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 ## Copyright (C) 2014 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 ## |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 ## This program is free software; you can redistribute it and/or modify |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 ## it under the terms of the GNU General Public License as published |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 ## by the Free Software Foundation; version 3 only. |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 ## |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 ## This program is distributed in the hope that it will be useful, |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 ## GNU General Public License for more details. |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 ## |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 |
615
d1f0bb0b7a17
Don’t inherit explicitely from object, we are not on Python 2.7 anymore. :)
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
597
diff
changeset
|
15 class Interface: |
596
ab131d04987d
Fix a regression introduced in the previous commit when the interface has a different resolution than 640×480 and framebuffer_blit is enabled.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
549
diff
changeset
|
16 width = 384 |
ab131d04987d
Fix a regression introduced in the previous commit when the interface has a different resolution than 640×480 and framebuffer_blit is enabled.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
549
diff
changeset
|
17 height = 448 |
ab131d04987d
Fix a regression introduced in the previous commit when the interface has a different resolution than 640×480 and framebuffer_blit is enabled.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
549
diff
changeset
|
18 game_pos = (0, 0) |
ab131d04987d
Fix a regression introduced in the previous commit when the interface has a different resolution than 640×480 and framebuffer_blit is enabled.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
549
diff
changeset
|
19 |
549
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 def __init__(self, resource_loader, player_state): |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
21 self.game = None |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 self.player_state = player_state |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 self.ascii_anm = resource_loader.get_single_anm('ascii.anm') #XXX |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
24 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
25 self.items = [] |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
26 self.level_start = [] |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
27 self.labels = {} |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
28 self.boss_items = [] |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
29 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
30 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
31 def start_stage(self, game, stage): |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
32 self.game = game |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
33 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
34 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
35 def set_song_name(self, name): |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
36 pass |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
37 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
38 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
39 def set_boss_life(self): |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
40 pass |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
41 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
42 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
43 def set_spell_life(self): |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
44 pass |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
45 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
46 |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
47 def update(self): |
56bca8ce4b68
Add a very simple sample interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
48 pass |