PyRobbo 0.5.0__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. pyrobbo-1.1.0/PKG-INFO +204 -0
  2. pyrobbo-1.1.0/README.md +179 -0
  3. pyrobbo-1.1.0/pyproject.toml +57 -0
  4. pyrobbo-1.1.0/robbo/__init__.py +163 -0
  5. pyrobbo-1.1.0/robbo/editor.py +560 -0
  6. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/game.py +41 -53
  7. pyrobbo-1.1.0/robbo/i18n.py +44 -0
  8. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/images.py +8 -1
  9. pyrobbo-1.1.0/robbo/levels.py +318 -0
  10. pyrobbo-1.1.0/robbo/locale/pl/LC_MESSAGES/pyrobbo.mo +0 -0
  11. pyrobbo-1.1.0/robbo/locale/pl/LC_MESSAGES/pyrobbo.po +539 -0
  12. pyrobbo-1.1.0/robbo/locale/pyrobbo.pot +540 -0
  13. pyrobbo-1.1.0/robbo/menu.py +265 -0
  14. pyrobbo-0.5.0/.github/workflows/main.yml +0 -31
  15. pyrobbo-0.5.0/.gitignore +0 -36
  16. pyrobbo-0.5.0/.idea/encodings.xml +0 -4
  17. pyrobbo-0.5.0/.idea/fileColors.xml +0 -7
  18. pyrobbo-0.5.0/.idea/fileTemplates/internal/Python Script.py +0 -12
  19. pyrobbo-0.5.0/.idea/inspectionProfiles/Project_Default.xml +0 -16
  20. pyrobbo-0.5.0/.idea/markdown-exported-files.xml +0 -8
  21. pyrobbo-0.5.0/.idea/markdown-navigator/profiles_settings.xml +0 -3
  22. pyrobbo-0.5.0/.idea/markdown-navigator.xml +0 -83
  23. pyrobbo-0.5.0/.idea/misc.xml +0 -10
  24. pyrobbo-0.5.0/.idea/modules.xml +0 -8
  25. pyrobbo-0.5.0/.idea/runConfigurations/pyrobbo.xml +0 -24
  26. pyrobbo-0.5.0/.idea/scopes/robbo.xml +0 -3
  27. pyrobbo-0.5.0/.idea/scopes/sprites.xml +0 -3
  28. pyrobbo-0.5.0/.idea/vcs.xml +0 -6
  29. pyrobbo-0.5.0/.vscode/launch.json +0 -15
  30. pyrobbo-0.5.0/.vscode/settings.json +0 -3
  31. pyrobbo-0.5.0/PKG-INFO +0 -35
  32. pyrobbo-0.5.0/PyRobbo.egg-info/PKG-INFO +0 -35
  33. pyrobbo-0.5.0/PyRobbo.egg-info/SOURCES.txt +0 -71
  34. pyrobbo-0.5.0/PyRobbo.egg-info/dependency_links.txt +0 -1
  35. pyrobbo-0.5.0/PyRobbo.egg-info/entry_points.txt +0 -2
  36. pyrobbo-0.5.0/PyRobbo.egg-info/requires.txt +0 -3
  37. pyrobbo-0.5.0/PyRobbo.egg-info/top_level.txt +0 -1
  38. pyrobbo-0.5.0/README.md +0 -13
  39. pyrobbo-0.5.0/pyproject.toml +0 -42
  40. pyrobbo-0.5.0/pyrobbo.py +0 -17
  41. pyrobbo-0.5.0/robbo/__init__.py +0 -200
  42. pyrobbo-0.5.0/robbo/__version__.py +0 -16
  43. pyrobbo-0.5.0/robbo/levels.py +0 -97
  44. pyrobbo-0.5.0/robbo.ico +0 -0
  45. pyrobbo-0.5.0/robbo.svg +0 -144
  46. pyrobbo-0.5.0/setup.cfg +0 -4
  47. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/LICENSE +0 -0
  48. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/board.py +0 -0
  49. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/defs.py +0 -0
  50. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/levels/ala.dat +0 -0
  51. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/levels/forever.dat +0 -0
  52. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/levels/original.dat +0 -0
  53. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/levels/test.dat +0 -0
  54. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/skins/default/digits.png +0 -0
  55. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/skins/default/icons.png +0 -0
  56. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/skins/oily/digits.png +0 -0
  57. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/skins/oily/icons.png +0 -0
  58. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/skins/tronic/ciphers32.bmp +0 -0
  59. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/skins/tronic/digits.png +0 -0
  60. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/skins/tronic/icons.png +0 -0
  61. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/blaster.wav +0 -0
  62. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/bomb.wav +0 -0
  63. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/bullet.wav +0 -0
  64. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/die.wav +0 -0
  65. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/door.wav +0 -0
  66. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/finish.wav +0 -0
  67. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/key.wav +0 -0
  68. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/lastscrew.wav +0 -0
  69. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/life.wav +0 -0
  70. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/push.wav +0 -0
  71. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/screw.wav +0 -0
  72. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/shoot.wav +0 -0
  73. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/spawn.wav +0 -0
  74. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/teleport.wav +0 -0
  75. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds/wallshoot.wav +0 -0
  76. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sounds.py +0 -0
  77. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sprites/__init__.py +0 -0
  78. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sprites/guns.py +0 -0
  79. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sprites/items.py +0 -0
  80. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sprites/mobs.py +0 -0
  81. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sprites/robbo.py +0 -0
  82. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sprites/static.py +0 -0
  83. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/sprites/teleport.py +0 -0
  84. {pyrobbo-0.5.0 → pyrobbo-1.1.0}/robbo/status.py +0 -0
pyrobbo-1.1.0/PKG-INFO ADDED
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyRobbo
3
+ Version: 1.1.0
4
+ Summary: Clone of an old 8-bit Atari game Robbo
5
+ License: GPL3
6
+ License-File: LICENSE
7
+ Keywords: game,pygame,robbo,atari,clone
8
+ Author: Maciej Dems
9
+ Author-email: macdems@gmail.com
10
+ Requires-Python: >=3
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
+ Classifier: Natural Language :: English
15
+ Classifier: Natural Language :: Polish
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Games/Entertainment :: Arcade
18
+ Classifier: Topic :: Games/Entertainment :: Puzzle Games
19
+ Requires-Dist: PyYAML (>=5.3.1)
20
+ Requires-Dist: appdirs (>=1.4.4)
21
+ Requires-Dist: pygame (>=2.0.0)
22
+ Project-URL: Homepage, http://github.com/macdems/pyrobbo
23
+ Description-Content-Type: text/markdown
24
+
25
+ # PyRobbo
26
+
27
+ PyRobbo is a Pygame remake of *Robbo*, the puzzle game for 8-bit Atari
28
+ computers. Guide a small robot across hostile planets, collecting the screws
29
+ needed to repair its escape capsule. When the screw counter reaches zero, the
30
+ capsule starts to blink. Walk into it to reach the next planet.
31
+
32
+ ![Robbo on the first planet, with nine screws left to collect][first-planet]
33
+
34
+ ## Install and play
35
+
36
+ To play the version in this repository, clone it and create a Python 3 virtual
37
+ environment.
38
+
39
+ ```sh
40
+ git clone https://github.com/macdems/pyrobbo.git
41
+ cd pyrobbo
42
+ python -m venv .venv
43
+ ```
44
+
45
+ Activate the environment with `. .venv/bin/activate` on Linux or macOS, or
46
+ `.\.venv\Scripts\Activate.ps1` in Windows PowerShell. Then install and launch
47
+ the game in a window.
48
+
49
+ ```sh
50
+ python -m pip install "setuptools<81" .
51
+ pyrobbo --window
52
+ ```
53
+
54
+ The setuptools pin supplies `pkg_resources`, which the game uses to load its
55
+ assets. For published releases, see [PyRobbo on PyPI][pypi].
56
+
57
+ ## Language
58
+
59
+ PyRobbo opens in Polish when it detects a Polish language preference. It
60
+ reads `LANGUAGE`, `LC_ALL`, `LC_MESSAGES`, and `LANG` in that order. On
61
+ Windows it uses the user's Windows display language if none of those
62
+ variables are set. English is the fallback.
63
+
64
+ To override detection, run `pyrobbo --lang pl` for Polish or
65
+ `pyrobbo --lang en` for English. These commands also work in PowerShell.
66
+
67
+ ## Choose a planet
68
+
69
+ For a first game, select **original**, **level 1**, and press **Enter**. On this
70
+ board the ammunition clip is two squares to Robbo's right. Pick it up for nine
71
+ shots. The counters along the bottom show screws remaining, keys held,
72
+ ammunition, and the current level, from left to right.
73
+
74
+ | Level set | Levels | What to expect |
75
+ | --- | ---: | --- |
76
+ | `original` | 58 | The classic campaign. |
77
+ | `forever` | 59 | A longer, tougher set of puzzles. |
78
+
79
+ In the menu, use **Up/Down** to select a row and **Left/Right** to change its
80
+ value. The **Theme** row switches between `default`, `oily`, and `tronic`. The
81
+ robot and board preview update as you browse. You can also click the arrows
82
+ and **Start Level**, or navigate with a joystick's stick or D-pad and press its
83
+ first button to start.
84
+
85
+ PyRobbo remembers your theme and the last level played in each set. Returning
86
+ to a level starts the puzzle from its initial layout.
87
+
88
+ ## Controls
89
+
90
+ | During play | Keyboard |
91
+ | --- | --- |
92
+ | Move | Arrow keys or **WASD** |
93
+ | Fire | Hold **Shift** and press a direction |
94
+ | Scroll a tall board | Hold **Ctrl** and press **Up/Down** or **W/S** |
95
+ | Restart the level | **Ctrl+R** or **Ctrl+X** |
96
+ | Jump to a level in this set | **Ctrl+L**, then two digits, e.g. **07** |
97
+ | Adjust speed | **+** or **=** to speed up, **-** to slow down |
98
+ | Toggle sound | **Ctrl+M** |
99
+ | Toggle clever bear movement | **Ctrl+B** |
100
+ | Toggle fullscreen | **F** (also works in the menu) |
101
+ | Return to the menu | **Esc** |
102
+ | Quit | **Ctrl+Q**, or **Esc** from the menu |
103
+
104
+ With a joystick, move with the stick. Hold the first button and push the stick
105
+ in the direction you want to fire. Hold the second button and move the stick
106
+ up or down to look ahead on a tall board.
107
+
108
+ ## Make a level set
109
+
110
+ Choose a set and level in the front menu, then click **Level editor** or press
111
+ **E**. The editor opens that board. Click the set name to open another set,
112
+ or choose **New set** to start with a room containing Robbo, a screw, and an
113
+ escape capsule.
114
+
115
+ ![Editing a board with the tile palette alongside the map][editor]
116
+
117
+ | To | In the editor |
118
+ | --- | --- |
119
+ | Paint or erase | Left-drag to paint a tile. Right-drag to erase. |
120
+ | Pick a tile and its settings | Middle-click it on the board. |
121
+ | Scroll | Use the mouse wheel, arrow keys, or buttons below the map. |
122
+ | Configure a tile | Change **Tile options**, then paint. |
123
+ | Manage levels | Use **+ Level**, **Copy**, or **Remove**. |
124
+ | Reorder or resize | Set the position or dimensions in **Board settings**. |
125
+ | Undo an edit | Click **Undo** or press **Ctrl+Z**. |
126
+
127
+ Switch boards with the arrows beside the level number. In a dialog, use
128
+ **Tab** to move between fields and **Enter** to apply your changes.
129
+
130
+ For a teleport pair, paint two teleports with the same link group. The editor
131
+ assigns their endpoints automatically. Board settings also let you change the
132
+ background colour, author, and required screw count.
133
+
134
+ **Save** or **Ctrl+S** writes the whole set to your user level directory.
135
+ Saving edits to a bundled set creates a personal copy that takes precedence
136
+ in the game. Use **Save as** to give a copy its own entry in the menu. To play
137
+ the edited board, choose **Done** and then **Start Level**.
138
+
139
+ ### Edit the text format
140
+
141
+ A level set is a plain-text `.dat` file. To try a one-room puzzle, save this as
142
+ `first-orbit.dat`.
143
+
144
+ ```text
145
+ [level]
146
+ 1
147
+ [data]
148
+ OOOOOOOOO
149
+ OR.%D.T!O
150
+ OOOOOOOOO
151
+ [end]
152
+ ```
153
+
154
+ Move right from Robbo (`R`), collect the key (`%`), and use it to open the door
155
+ (`D`). The screw (`T`) activates the capsule (`!`). The outer walls are the
156
+ letter `O`, and dots mark empty squares.
157
+
158
+ ```sh
159
+ pyrobbo first-orbit.dat
160
+ ```
161
+
162
+ This copies the file into your user level directory and selects **first-orbit**
163
+ in the menu. Add another `[level]` through `[end]` block to extend the set.
164
+ For examples with teleports, enemies, and moving guns, see the
165
+ [bundled level files][level-files].
166
+
167
+ On Linux, the default locations are `~/.local/share/pyrobbo/levels/` for
168
+ installed sets and `~/.config/pyrobbo.yml` for settings. To start with a
169
+ particular theme or display mode, use a command such as
170
+ `pyrobbo --fullscreen --skin tronic`. Run `pyrobbo --help` for all options.
171
+
172
+ ## Maintain translations
173
+
174
+ The gettext template is `robbo/locale/pyrobbo.pot`. Install Babel in the
175
+ development environment with `python -m pip install Babel`, then run the
176
+ following commands from the repository root.
177
+
178
+ ```sh
179
+ pybabel extract -k N_ --project PyRobbo -o robbo/locale/pyrobbo.pot robbo
180
+ pybabel update -D pyrobbo -i robbo/locale/pyrobbo.pot -d robbo/locale
181
+ pybabel compile -D pyrobbo -d robbo/locale --statistics
182
+ ```
183
+
184
+ Edit the `.po` catalog after updating it and before compiling. To add a
185
+ language, use `pybabel init` with the same paths and `-l` followed by the
186
+ language code. Commit the source and compiled catalogs. Installed copies of
187
+ the game read the bundled `.mo` files through Python's standard library.
188
+
189
+ ## Credits and license
190
+
191
+ Janusz Pelc wrote the original *Robbo* for the Atari XE/XL, published by
192
+ L.K. Avalon. Maciej Dems developed this Pygame remake. Graphics and level data
193
+ come from [GNU Robbo][gnu-robbo].
194
+
195
+ PyRobbo is free software under the [GNU General Public License][license],
196
+ version 3 or later.
197
+
198
+ [editor]: docs/images/level-editor.png
199
+ [first-planet]: docs/images/original-level-01.png
200
+ [pypi]: https://pypi.org/project/PyRobbo/
201
+ [level-files]: robbo/levels/
202
+ [gnu-robbo]: https://sourceforge.net/projects/gnurobbo/
203
+ [license]: LICENSE
204
+
@@ -0,0 +1,179 @@
1
+ # PyRobbo
2
+
3
+ PyRobbo is a Pygame remake of *Robbo*, the puzzle game for 8-bit Atari
4
+ computers. Guide a small robot across hostile planets, collecting the screws
5
+ needed to repair its escape capsule. When the screw counter reaches zero, the
6
+ capsule starts to blink. Walk into it to reach the next planet.
7
+
8
+ ![Robbo on the first planet, with nine screws left to collect][first-planet]
9
+
10
+ ## Install and play
11
+
12
+ To play the version in this repository, clone it and create a Python 3 virtual
13
+ environment.
14
+
15
+ ```sh
16
+ git clone https://github.com/macdems/pyrobbo.git
17
+ cd pyrobbo
18
+ python -m venv .venv
19
+ ```
20
+
21
+ Activate the environment with `. .venv/bin/activate` on Linux or macOS, or
22
+ `.\.venv\Scripts\Activate.ps1` in Windows PowerShell. Then install and launch
23
+ the game in a window.
24
+
25
+ ```sh
26
+ python -m pip install "setuptools<81" .
27
+ pyrobbo --window
28
+ ```
29
+
30
+ The setuptools pin supplies `pkg_resources`, which the game uses to load its
31
+ assets. For published releases, see [PyRobbo on PyPI][pypi].
32
+
33
+ ## Language
34
+
35
+ PyRobbo opens in Polish when it detects a Polish language preference. It
36
+ reads `LANGUAGE`, `LC_ALL`, `LC_MESSAGES`, and `LANG` in that order. On
37
+ Windows it uses the user's Windows display language if none of those
38
+ variables are set. English is the fallback.
39
+
40
+ To override detection, run `pyrobbo --lang pl` for Polish or
41
+ `pyrobbo --lang en` for English. These commands also work in PowerShell.
42
+
43
+ ## Choose a planet
44
+
45
+ For a first game, select **original**, **level 1**, and press **Enter**. On this
46
+ board the ammunition clip is two squares to Robbo's right. Pick it up for nine
47
+ shots. The counters along the bottom show screws remaining, keys held,
48
+ ammunition, and the current level, from left to right.
49
+
50
+ | Level set | Levels | What to expect |
51
+ | --- | ---: | --- |
52
+ | `original` | 58 | The classic campaign. |
53
+ | `forever` | 59 | A longer, tougher set of puzzles. |
54
+
55
+ In the menu, use **Up/Down** to select a row and **Left/Right** to change its
56
+ value. The **Theme** row switches between `default`, `oily`, and `tronic`. The
57
+ robot and board preview update as you browse. You can also click the arrows
58
+ and **Start Level**, or navigate with a joystick's stick or D-pad and press its
59
+ first button to start.
60
+
61
+ PyRobbo remembers your theme and the last level played in each set. Returning
62
+ to a level starts the puzzle from its initial layout.
63
+
64
+ ## Controls
65
+
66
+ | During play | Keyboard |
67
+ | --- | --- |
68
+ | Move | Arrow keys or **WASD** |
69
+ | Fire | Hold **Shift** and press a direction |
70
+ | Scroll a tall board | Hold **Ctrl** and press **Up/Down** or **W/S** |
71
+ | Restart the level | **Ctrl+R** or **Ctrl+X** |
72
+ | Jump to a level in this set | **Ctrl+L**, then two digits, e.g. **07** |
73
+ | Adjust speed | **+** or **=** to speed up, **-** to slow down |
74
+ | Toggle sound | **Ctrl+M** |
75
+ | Toggle clever bear movement | **Ctrl+B** |
76
+ | Toggle fullscreen | **F** (also works in the menu) |
77
+ | Return to the menu | **Esc** |
78
+ | Quit | **Ctrl+Q**, or **Esc** from the menu |
79
+
80
+ With a joystick, move with the stick. Hold the first button and push the stick
81
+ in the direction you want to fire. Hold the second button and move the stick
82
+ up or down to look ahead on a tall board.
83
+
84
+ ## Make a level set
85
+
86
+ Choose a set and level in the front menu, then click **Level editor** or press
87
+ **E**. The editor opens that board. Click the set name to open another set,
88
+ or choose **New set** to start with a room containing Robbo, a screw, and an
89
+ escape capsule.
90
+
91
+ ![Editing a board with the tile palette alongside the map][editor]
92
+
93
+ | To | In the editor |
94
+ | --- | --- |
95
+ | Paint or erase | Left-drag to paint a tile. Right-drag to erase. |
96
+ | Pick a tile and its settings | Middle-click it on the board. |
97
+ | Scroll | Use the mouse wheel, arrow keys, or buttons below the map. |
98
+ | Configure a tile | Change **Tile options**, then paint. |
99
+ | Manage levels | Use **+ Level**, **Copy**, or **Remove**. |
100
+ | Reorder or resize | Set the position or dimensions in **Board settings**. |
101
+ | Undo an edit | Click **Undo** or press **Ctrl+Z**. |
102
+
103
+ Switch boards with the arrows beside the level number. In a dialog, use
104
+ **Tab** to move between fields and **Enter** to apply your changes.
105
+
106
+ For a teleport pair, paint two teleports with the same link group. The editor
107
+ assigns their endpoints automatically. Board settings also let you change the
108
+ background colour, author, and required screw count.
109
+
110
+ **Save** or **Ctrl+S** writes the whole set to your user level directory.
111
+ Saving edits to a bundled set creates a personal copy that takes precedence
112
+ in the game. Use **Save as** to give a copy its own entry in the menu. To play
113
+ the edited board, choose **Done** and then **Start Level**.
114
+
115
+ ### Edit the text format
116
+
117
+ A level set is a plain-text `.dat` file. To try a one-room puzzle, save this as
118
+ `first-orbit.dat`.
119
+
120
+ ```text
121
+ [level]
122
+ 1
123
+ [data]
124
+ OOOOOOOOO
125
+ OR.%D.T!O
126
+ OOOOOOOOO
127
+ [end]
128
+ ```
129
+
130
+ Move right from Robbo (`R`), collect the key (`%`), and use it to open the door
131
+ (`D`). The screw (`T`) activates the capsule (`!`). The outer walls are the
132
+ letter `O`, and dots mark empty squares.
133
+
134
+ ```sh
135
+ pyrobbo first-orbit.dat
136
+ ```
137
+
138
+ This copies the file into your user level directory and selects **first-orbit**
139
+ in the menu. Add another `[level]` through `[end]` block to extend the set.
140
+ For examples with teleports, enemies, and moving guns, see the
141
+ [bundled level files][level-files].
142
+
143
+ On Linux, the default locations are `~/.local/share/pyrobbo/levels/` for
144
+ installed sets and `~/.config/pyrobbo.yml` for settings. To start with a
145
+ particular theme or display mode, use a command such as
146
+ `pyrobbo --fullscreen --skin tronic`. Run `pyrobbo --help` for all options.
147
+
148
+ ## Maintain translations
149
+
150
+ The gettext template is `robbo/locale/pyrobbo.pot`. Install Babel in the
151
+ development environment with `python -m pip install Babel`, then run the
152
+ following commands from the repository root.
153
+
154
+ ```sh
155
+ pybabel extract -k N_ --project PyRobbo -o robbo/locale/pyrobbo.pot robbo
156
+ pybabel update -D pyrobbo -i robbo/locale/pyrobbo.pot -d robbo/locale
157
+ pybabel compile -D pyrobbo -d robbo/locale --statistics
158
+ ```
159
+
160
+ Edit the `.po` catalog after updating it and before compiling. To add a
161
+ language, use `pybabel init` with the same paths and `-l` followed by the
162
+ language code. Commit the source and compiled catalogs. Installed copies of
163
+ the game read the bundled `.mo` files through Python's standard library.
164
+
165
+ ## Credits and license
166
+
167
+ Janusz Pelc wrote the original *Robbo* for the Atari XE/XL, published by
168
+ L.K. Avalon. Maciej Dems developed this Pygame remake. Graphics and level data
169
+ come from [GNU Robbo][gnu-robbo].
170
+
171
+ PyRobbo is free software under the [GNU General Public License][license],
172
+ version 3 or later.
173
+
174
+ [editor]: docs/images/level-editor.png
175
+ [first-planet]: docs/images/original-level-01.png
176
+ [pypi]: https://pypi.org/project/PyRobbo/
177
+ [level-files]: robbo/levels/
178
+ [gnu-robbo]: https://sourceforge.net/projects/gnurobbo/
179
+ [license]: LICENSE
@@ -0,0 +1,57 @@
1
+ [project]
2
+ name = "PyRobbo"
3
+ authors = [{ name = "Maciej Dems", email = "macdems@gmail.com" }]
4
+ description = "Clone of an old 8-bit Atari game Robbo"
5
+ readme = "README.md"
6
+ requires-python = ">=3"
7
+ license = { text = "GPL3" }
8
+ keywords = ["game", "pygame", "robbo", "atari", "clone"]
9
+ classifiers = [
10
+ "Development Status :: 4 - Beta",
11
+ "Intended Audience :: End Users/Desktop",
12
+ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
13
+ "Natural Language :: English",
14
+ "Natural Language :: Polish",
15
+ "Operating System :: OS Independent",
16
+ "Topic :: Games/Entertainment :: Arcade",
17
+ "Topic :: Games/Entertainment :: Puzzle Games",
18
+ ]
19
+ dependencies = ["pygame>=2.0.0", "PyYAML>=5.3.1", "appdirs>=1.4.4"]
20
+ dynamic = []
21
+ version = "1.1.0"
22
+
23
+ [project.urls]
24
+ Homepage = "http://github.com/macdems/pyrobbo"
25
+
26
+ [build-system]
27
+ requires = [
28
+ "poetry-core>=2.0.0",
29
+ "poetry-dynamic-versioning>=1.0.0,<2.0.0"
30
+ ]
31
+ build-backend = "poetry_dynamic_versioning.backend"
32
+
33
+ [project.gui-scripts]
34
+ pyrobbo = "robbo:main"
35
+
36
+ [tool.poetry]
37
+ packages = [{ include = "robbo" }]
38
+ include = [
39
+ { path = "robbo/sounds/*.wav", format = ["sdist", "wheel"] },
40
+ { path = "robbo/levels/*.dat", format = ["sdist", "wheel"] },
41
+ { path = "robbo/skins/*/*.png", format = ["sdist", "wheel"] },
42
+ { path = "robbo/locale/*/LC_MESSAGES/pyrobbo.mo", format = ["sdist", "wheel"] },
43
+ { path = "robbo/locale/*/LC_MESSAGES/pyrobbo.po", format = ["sdist"] },
44
+ { path = "robbo/locale/pyrobbo.pot", format = ["sdist"] },
45
+ { path = "robbo/robbo.svg", format = ["sdist", "wheel"] },
46
+ { path = "robbo/robbo.ico", format = ["sdist", "wheel"] },
47
+ ]
48
+
49
+ [tool.poetry.requires-plugins]
50
+ poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
51
+
52
+ [tool.poetry-dynamic-versioning]
53
+ enable = false
54
+ vcs = "git"
55
+ style = "pep440"
56
+ pattern = "default-unprefixed"
57
+ bump = true
@@ -0,0 +1,163 @@
1
+ # coding: utf8
2
+ # Copyright (C) 2019 Maciej Dems <maciej.dems@p.lodz.pl>
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify it
5
+ # under the terms of GNU General Public License as published by the
6
+ # Free Software Foundation; either version 3 of the license, or (at your
7
+ # opinion) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ import sys
14
+ import shutil
15
+ import argparse
16
+ import yaml
17
+ import pygame
18
+
19
+ from .defs import *
20
+ from .i18n import _, select_language
21
+ from .images import available_skins
22
+ from .levels import load_level_sets
23
+
24
+ FLAGS_FULLSCREEN = pygame.FULLSCREEN | pygame.HWSURFACE | pygame.DOUBLEBUF
25
+ FLAGS_WINDOW = pygame.SCALED | pygame.RESIZABLE
26
+
27
+ clock = None
28
+ clock_speed = None
29
+ screen = None
30
+ screen_rect = None
31
+ skin = 'default'
32
+
33
+ levelset = 'original'
34
+
35
+ levels = {}
36
+
37
+
38
+ def save():
39
+ from . import game, sounds
40
+ config = {
41
+ 'levelset': levelset,
42
+ 'levels': levels,
43
+ 'cleverbears': game.clever_bears,
44
+ 'fullscreen': bool(screen.get_flags() & pygame.FULLSCREEN),
45
+ 'skin': skin,
46
+ 'mute': sounds.mute,
47
+ }
48
+ os.makedirs(os.path.dirname(CONFIG_FILE), exist_ok=True)
49
+ with open(CONFIG_FILE, 'w') as config_file:
50
+ yaml.dump(config, config_file, default_flow_style=False)
51
+
52
+
53
+ def quit():
54
+ save()
55
+ pygame.quit()
56
+ sys.exit(0)
57
+
58
+
59
+ def command_line():
60
+ language_parser = argparse.ArgumentParser(add_help=False)
61
+ language_parser.add_argument('--lang')
62
+ language_args, _remaining = language_parser.parse_known_args()
63
+ select_language(language_args.lang)
64
+
65
+ parser = argparse.ArgumentParser()
66
+ display = parser.add_mutually_exclusive_group()
67
+ display.add_argument('-f', '--fullscreen', help=_('start in fullscreen'), action='store_true')
68
+ display.add_argument('-w', '--window', help=_('start in a window'), action='store_true')
69
+ parser.add_argument('-s', '--skin', help=_('choose a visual theme'))
70
+ parser.add_argument('--lang', metavar='CODE', help=_('choose the UI language (for example, en or pl)'))
71
+ parser.add_argument('levelset', help=_('path to a level set to install'), nargs='*')
72
+ args = parser.parse_args()
73
+ select_language(args.lang)
74
+ return parser, args
75
+
76
+
77
+ def main():
78
+ parser, args = command_line()
79
+
80
+ try:
81
+ with open(CONFIG_FILE) as config_file:
82
+ config = yaml.safe_load(config_file) or {}
83
+ except FileNotFoundError:
84
+ config = {}
85
+
86
+ global skin, levelset, levels, clock, clock_speed, screen, screen_rect
87
+ skins = available_skins()
88
+ if not skins:
89
+ parser.exit(1, _('No themes found.') + '\n')
90
+ if args.skin is not None and args.skin not in skins:
91
+ parser.error(_("Unknown theme '{theme}'. Choose from {choices}.").format(
92
+ theme=args.skin, choices=', '.join(skins)))
93
+ skin = args.skin if args.skin is not None else config.get('skin', 'default')
94
+ if skin not in skins:
95
+ skin = 'default' if 'default' in skins else skins[0]
96
+
97
+ if args.fullscreen:
98
+ flags = FLAGS_FULLSCREEN
99
+ elif args.window:
100
+ flags = FLAGS_WINDOW
101
+ else:
102
+ flags = FLAGS_FULLSCREEN if config.get('fullscreen', True) else FLAGS_WINDOW
103
+
104
+ pygame.init()
105
+ pygame.mouse.set_visible(False)
106
+ pygame.display.set_caption('PyRobbo')
107
+ pygame.key.set_repeat(0,0)
108
+
109
+ clock = pygame.time.Clock()
110
+ clock_speed = 8
111
+ screen = pygame.display.set_mode((640, 480), flags)
112
+ screen_rect = pygame.Rect((64, 32), (512, 384))
113
+
114
+ if args.levelset:
115
+ install = [arg for arg in args.levelset if arg.endswith('.dat') and os.path.isfile(arg)]
116
+ if install:
117
+ try:
118
+ user_levels_dir = os.path.join(USER_DATA_DIR, 'levels')
119
+ os.makedirs(user_levels_dir, exist_ok=True)
120
+ except OSError:
121
+ pass
122
+ else:
123
+ for i in install:
124
+ try:
125
+ shutil.copy(i, user_levels_dir)
126
+ except (OSError, IOError):
127
+ pass
128
+ else:
129
+ config['levelset'] = os.path.basename(i)[:-4]
130
+
131
+ levels = config.get('levels', {})
132
+ packs = load_level_sets()
133
+ if not packs:
134
+ pygame.quit()
135
+ parser.exit(1, _('No playable level sets found.') + '\n')
136
+ levelset = config.get('levelset', levelset)
137
+ if levelset not in packs:
138
+ levelset = 'original' if 'original' in packs else next(iter(packs))
139
+
140
+ from . import game, sounds
141
+ from .menu import select_level
142
+ game.clever_bears = config.get('cleverbears', False)
143
+ sounds.mute = config.get('mute', sounds.mute)
144
+
145
+ while True:
146
+ levelset, level = select_level(screen, skins, packs, levelset, levels)
147
+ names = sorted(packs)
148
+ while True:
149
+ game.levels = packs[levelset]
150
+ levels[levelset] = level
151
+ save()
152
+ try:
153
+ game.play_level(level)
154
+ except game.SelectLevel as selected:
155
+ if 0 <= selected.level < len(game.levels):
156
+ level = selected.level
157
+ except game.ChangeLevelSet:
158
+ break
159
+ else:
160
+ level += 1
161
+ if level == len(game.levels):
162
+ levelset = names[(names.index(levelset) + 1) % len(names)]
163
+ level = 0