junglejourney
changeset 196:82a73a5987fe
Updated the keyboard/joystick instructions.
Made it possible to generate a single SVG for the cassette inlay.
| author | David Boddie <david@boddie.org.uk> |
|---|---|
| date | Sat Oct 01 13:15:56 2011 +0200 |
| parents | 095ccf30c42a |
| children | 8ff47d1667f7 |
| files | README.txt materials/make_packaging.py |
| diffstat | 2 files changed, 87 insertions(+), 29 deletions(-) [+] |
line diff
1.1 --- a/README.txt Sat Oct 01 00:20:05 2011 +0200 1.2 +++ b/README.txt Sat Oct 01 13:15:56 2011 +0200 1.3 @@ -73,9 +73,9 @@ 1.4 To fire a weapon, press the Return key. There are four different types of 1.5 weapon available in the game. 1.6 1.7 -Alternatively, you may may using an analogue joystick connected to a Plus 1 1.8 -expansion interface. Select joystick controls by pressing the J key on the 1.9 -title page. Press K to select keyboard controls. 1.10 +Alternatively, you may may using an analogue. Select joystick controls by 1.11 +pressing the Fire button on the title page to start the game. Press Space to 1.12 +start the game with keyboard controls. 1.13 1.14 Other keys can be used to control the game: 1.15
2.1 --- a/materials/make_packaging.py Sat Oct 01 00:20:05 2011 +0200 2.2 +++ b/materials/make_packaging.py Sat Oct 01 13:15:56 2011 +0200 2.3 @@ -61,12 +61,12 @@ 2.4 def open(self): 2.5 2.6 self.text = ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n' 2.7 - '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"\n') 2.8 + '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"\n' 2.9 + ' "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n') 2.10 2.11 def add_page(self, width, height): 2.12 2.13 - self.text += (' "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' 2.14 - '<svg version="1.1"\n' 2.15 + self.text += ('<svg version="1.1"\n' 2.16 ' xmlns="http://www.w3.org/2000/svg"\n' 2.17 ' xmlns:xlink="http://www.w3.org/1999/xlink"\n' 2.18 ' width="%fcm" height="%fcm"\n' 2.19 @@ -97,6 +97,45 @@ 2.20 codecs.open(self.path, "w", "utf-8").write(self.text) 2.21 2.22 2.23 +class Inlay(SVG): 2.24 + 2.25 + def __init__(self, path): 2.26 + 2.27 + SVG.__init__(self, path) 2.28 + 2.29 + self.page_offsets = [(0, 0), (650, 0), (2 * 650, 0), (3 * 650, 0)] 2.30 + self.page_number = 0 2.31 + 2.32 + def open(self): 2.33 + 2.34 + SVG.open(self) 2.35 + self.text += ('<svg version="1.1"\n' 2.36 + ' xmlns="http://www.w3.org/2000/svg"\n' 2.37 + ' xmlns:xlink="http://www.w3.org/1999/xlink"\n' 2.38 + ' width="33.5cm" height="10cm"\n' 2.39 + ' viewBox="0 0 3350 1000">\n') 2.40 + 2.41 + def add_page(self, width, height): 2.42 + 2.43 + self.ox, self.oy = self.page_offsets[self.page_number] 2.44 + self.page_number += 1 2.45 + 2.46 + def add_image(self, x, y, width, height, path): 2.47 + 2.48 + SVG.add_image(self, self.ox + x, self.oy + y, width, height, path) 2.49 + 2.50 + def add_text(self, x, y, font, text): 2.51 + 2.52 + SVG.add_text(self, self.ox + x, self.oy + y, font, text) 2.53 + 2.54 + def close(self): 2.55 + 2.56 + self.text += ('<rect x="2600" y="0" width="100" height="1000"\n' 2.57 + ' stroke="black" fill="none" stroke-width="1" />\n') 2.58 + 2.59 + SVG.close(self) 2.60 + 2.61 + 2.62 class Page: 2.63 2.64 def __init__(self, size, objects): 2.65 @@ -328,12 +367,17 @@ 2.66 2.67 app = QApplication(sys.argv) 2.68 2.69 - if len(app.arguments()) != 2: 2.70 + if not 2 <= len(app.arguments()) <= 3: 2.71 2.72 - sys.stderr.write("Usage: %s <output directory>\n" % app.arguments()[0]) 2.73 + sys.stderr.write("Usage: %s [--inlay] <output directory>\n" % app.arguments()[0]) 2.74 sys.exit(1) 2.75 2.76 - output_dir = sys.argv[1] 2.77 + if app.arguments()[1] == "--inlay": 2.78 + output_dir = sys.argv[2] 2.79 + inlay = True 2.80 + else: 2.81 + output_dir = sys.argv[1] 2.82 + inlay = False 2.83 2.84 if not os.path.exists(output_dir): 2.85 os.mkdir(output_dir) 2.86 @@ -393,7 +437,7 @@ 2.87 "align": "centre"} 2.88 2.89 pages = [ 2.90 - Page((650, 1020), 2.91 + Page((650, 1000), 2.92 [TextBox((25, 35, 600, 0), 2.93 [Text(title, "Jungle Journey\n"), 2.94 Text(regular, 2.95 @@ -452,13 +496,13 @@ 2.96 Text(regular, 2.97 "Your character can be moved around the screen by using four control keys:\n")], 2.98 follow = True), 2.99 - TextBox((25, 0, 600, 0), 2.100 + TextBox((25, -4, 600, 0), 2.101 [Text(keys_quote, 2.102 "Z\n" 2.103 "X\n" 2.104 ":\n" 2.105 "/")], follow = True), 2.106 - TextBox((25, 0, 600, 0), 2.107 + TextBox((25, -4, 600, 0), 2.108 [Text(key_descriptions_quote, 2.109 "left\n" 2.110 "right\n" 2.111 @@ -467,19 +511,19 @@ 2.112 Text(regular, 2.113 "To fire a weapon, press the Return key. There are four different types of " 2.114 "weapon available in the game.\n\n" 2.115 - "Alternatively, you may may using an analogue joystick connected to a Plus 1 " 2.116 - "expansion interface. Select joystick controls by pressing the J key on the " 2.117 - "title page. Press K to select keyboard controls.\n\n" 2.118 + "Alternatively, you may may using an analogue. Select joystick controls by " 2.119 + "pressing the Fire button on the title page to start the game. Press Space to " 2.120 + "start the game with keyboard controls.\n\n" 2.121 "Other keys can be used to control the game:\n")], 2.122 follow = True, index = -2), 2.123 - TextBox((25, 0, 600, 0), 2.124 + TextBox((25, -4, 600, 0), 2.125 [Text(keys_quote, 2.126 "S\n" 2.127 "Q\n" 2.128 "P\n" 2.129 "O\n" 2.130 "Escape")], follow = True), 2.131 - TextBox((25, 0, 600, 0), 2.132 + TextBox((25, -4, 600, 0), 2.133 [Text(key_descriptions_quote, 2.134 "enable sound effects\n" 2.135 "disable sound effects\n" 2.136 @@ -537,20 +581,20 @@ 2.137 TextBox((215, 48, 400, 0), 2.138 [Text(regular, "The final exit is hidden somewhere on the final level.")], 2.139 follow = True, index = -4), 2.140 - TextBox((25, 950, 600, 0), 2.141 + TextBox((25, 960, 600, 0), 2.142 [Text(exclamation, "Have a safe journey!")]) 2.143 ]), 2.144 Page((650, 1000), 2.145 [TextBox((25, 50, 600, 0), 2.146 [Text(back_cover_title, "Jungle Journey"), 2.147 Text(back_cover_subtitle, "for the Acorn Electron and BBC Model B")]), 2.148 - Image((101, 0, 450, 0), "screenshot1.png", scale = 0.7, follow = True), 2.149 - TextBox((25, 45, 600, 0), 2.150 + Image((101, 5, 450, 0), "screenshot1.png", scale = 0.7, follow = True), 2.151 + TextBox((25, 55, 600, 0), 2.152 [Text(back_cover_centred, 2.153 u"Copyright \u00a9 2011 David Boddie\n" 2.154 u"An Infukor production for Retro Software\n" 2.155 u"http://www.retrosoftware.co.uk/")], follow = True), 2.156 - TextBox((25, 20, 600, 0), 2.157 + TextBox((25, 25, 600, 0), 2.158 [Text(regular, 2.159 "This program is free software: you can redistribute it and/or modify " 2.160 "it under the terms of the GNU General Public License as published by " 2.161 @@ -568,14 +612,28 @@ 2.162 ]), 2.163 ] 2.164 2.165 - i = 0 2.166 - for page in pages: 2.167 + if inlay: 2.168 + path = os.path.join(output_dir, "inlay.svg") 2.169 + inlay = Inlay(path) 2.170 + inlay.open() 2.171 + 2.172 + i = 0 2.173 + for page in pages: 2.174 + 2.175 + page.render(inlay) 2.176 + i += 1 2.177 + 2.178 + inlay.close() 2.179 2.180 - path = os.path.join(output_dir, "page-%i.svg" % i) 2.181 - svg = SVG(path) 2.182 - svg.open() 2.183 - page.render(svg) 2.184 - svg.close() 2.185 - i += 1 2.186 + else: 2.187 + i = 0 2.188 + for page in pages: 2.189 + 2.190 + path = os.path.join(output_dir, "page-%i.svg" % i) 2.191 + svg = SVG(path) 2.192 + svg.open() 2.193 + page.render(svg) 2.194 + svg.close() 2.195 + i += 1 2.196 2.197 sys.exit()
