~robert-ancell/quickly/drop-lpi

« back to all changes in this revision

Viewing changes to data/templates/ubuntu-pygame/help/po/ga.po

  • Committer: Rick Spencer
  • Date: 2012-04-19 11:13:31 UTC
  • Revision ID: rick.spencer@canonical.com-20120419111331-b6thksokdaxys4s0
deleted pygame template, depends on desktopcouch, users should rather embed pygame into a ubuntu-application

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
msgid ""
2
 
msgstr ""
3
 
"Project-Id-Version: PACKAGE VERSION\n"
4
 
"Report-Msgid-Bugs-To: \n"
5
 
"POT-Creation-Date: 2011-04-04 08:43-0400\n"
6
 
"PO-Revision-Date: 2011-04-05 03:53+0000\n"
7
 
"Last-Translator: Michael Terry <michael.terry@canonical.com>\n"
8
 
"Language-Team: LANGUAGE <LL@li.org>\n"
9
 
"MIME-Version: 1.0\n"
10
 
"Content-Type: text/plain; charset=UTF-8\n"
11
 
"Content-Transfer-Encoding: 8bit\n"
12
 
"X-Launchpad-Export-Date: 2011-04-06 04:42+0000\n"
13
 
"X-Generator: Launchpad (build 12559)\n"
14
 
 
15
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:13(firstname)
16
 
msgid "Rick"
17
 
msgstr ""
18
 
 
19
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:14(surname)
20
 
msgid "Spencer"
21
 
msgstr ""
22
 
 
23
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:16(corpauthor)
24
 
msgid "Canonical ltd"
25
 
msgstr ""
26
 
 
27
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:20(date) data/templates/ubuntu-pygame/help/tutorial.xml:25(invpartnumber)
28
 
msgid "2010"
29
 
msgstr ""
30
 
 
31
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:0(application)
32
 
msgid "Quickly PyGame Template"
33
 
msgstr ""
34
 
 
35
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:24(productnumber)
36
 
msgid "0.6.1"
37
 
msgstr ""
38
 
 
39
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:26(title)
40
 
msgid "<application>Quickly PyGame Template</application> 0.6.1 Tutorial"
41
 
msgstr ""
42
 
 
43
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:31(title)
44
 
msgid "About This Guide"
45
 
msgstr "Maidir leis an treoir"
46
 
 
47
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:32(para)
48
 
msgid ""
49
 
"Use <application>The Quickly Pygame Template</application> to write old "
50
 
"school arcade games for running on Ubuntu. PyGame is a framework that "
51
 
"handles sprites, collisons, sounds, and everything you need to make a game. "
52
 
"You just need to add the game play. The Quickly template creates a starter "
53
 
"game for you and comes ready for you to turn into your fun game, and then "
54
 
"easily package and share it with other Ubuntu users."
55
 
msgstr ""
56
 
 
57
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:35(para)
58
 
msgid ""
59
 
"The Quickly Pygame Template inherits from the Quickly Application template. "
60
 
"So you get all the commands that you get from the that template, except "
61
 
"\"design\"."
62
 
msgstr ""
63
 
 
64
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:41(title)
65
 
msgid "Creating and Running Your Game"
66
 
msgstr ""
67
 
 
68
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:44(para)
69
 
msgid ""
70
 
"In this tutorial we will start making a top down shooter reminiscent of the "
71
 
"space arcade shooters of the 1980s."
72
 
msgstr ""
73
 
 
74
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:50(para)
75
 
msgid ""
76
 
"We'll do this by creating a default game, editing some of the generated "
77
 
"code, writing some new code, and adding our images for sprits."
78
 
msgstr ""
79
 
 
80
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:53(para)
81
 
msgid ""
82
 
"Creating a default working game couldn't be simpler. First, open a terminal "
83
 
"window to type commands into. When it's open, type the command:"
84
 
msgstr ""
85
 
 
86
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:56(programlisting)
87
 
#, no-wrap
88
 
msgid ""
89
 
"\n"
90
 
"$quickly create ubuntu-pygame shooter\n"
91
 
" "
92
 
msgstr ""
93
 
 
94
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:60(para)
95
 
msgid ""
96
 
"This will create a shooter sub directory containing a complete directory "
97
 
"tree and files for an empty python application. The command finishes by "
98
 
"running the newly created game. The game is played by using the \"s\" and "
99
 
"\"f\" keys to rotate the guy, the \"j\" key to shoot, and the \"l\" key to "
100
 
"thrust."
101
 
msgstr ""
102
 
 
103
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:63(para)
104
 
msgid ""
105
 
"You can play the newly created game. Notice that the <application>Quickly "
106
 
"PyGame Template</application> inferred that the game title is \"Shooter\". "
107
 
"Also note that there is a guy that you can control with the s,f,j, and l "
108
 
"keys. There is an enemy and a homing missle. You also get a \"Game Over\" "
109
 
"screen, scoring, and levels build in for free."
110
 
msgstr ""
111
 
 
112
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:66(para)
113
 
msgid ""
114
 
"Close the game by closing the window or using the Esc key. Since the game "
115
 
"isn't installed into Ubuntu yet, you can't start the game from the "
116
 
"application menu yet. To start the game, use the terminal to first cd into "
117
 
"the new subdirectory, and then use \"quickly run\" to start the program."
118
 
msgstr ""
119
 
 
120
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:69(programlisting)
121
 
#, no-wrap
122
 
msgid ""
123
 
"\n"
124
 
"$cd shooter\n"
125
 
"$quickly run\n"
126
 
" "
127
 
msgstr ""
128
 
 
129
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:75(title)
130
 
msgid "Creating your own Sprites"
131
 
msgstr ""
132
 
 
133
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:79(listitem)
134
 
msgid ""
135
 
"Ink Scape is a great and free tool for creating your sprites. It's in the "
136
 
"Featured Applications section of the Software Center."
137
 
msgstr ""
138
 
 
139
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:80(listitem)
140
 
msgid ""
141
 
"If you use Ink Scape, you'll want to export the images as PNGs. But keep the "
142
 
"Ink Scape files around in case you want to edit the sprites later."
143
 
msgstr ""
144
 
 
145
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:81(listitem)
146
 
msgid ""
147
 
"Whatever size you make the sprites, that's the size they will be in the game."
148
 
msgstr ""
149
 
 
150
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:82(listitem)
151
 
msgid ""
152
 
"The game will look for sprites in the data/media folder, so make sure you "
153
 
"put them there."
154
 
msgstr ""
155
 
 
156
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:76(para)
157
 
msgid ""
158
 
"The first think you probably noticed about the game is that the graphics are "
159
 
"so blah! Let's start by adding our own sprites. We;ll do a compbination of "
160
 
"replacing sprites with our own images, and also add a new sprite which we'll "
161
 
"use later. Here's a few things to keep in mind: <placeholder-1/>"
162
 
msgstr ""
163
 
 
164
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:85(para)
165
 
msgid ""
166
 
"I made new images for the guy (the sprite the player controls), enemies, "
167
 
"bullets, and the game background. I also made a new sprite called "
168
 
"\"enemy_bullet.png\" which we'll add into the game later. <placeholder-1/> "
169
 
"Just drag your new sprite images into the shooter/data/media and tell it to "
170
 
"replace the images. Now when you run the game, you'll see your new sprites "
171
 
"at work. <placeholder-2/> Oops. As you can see, the background image I "
172
 
"created was for a game of different dimensions. It's for a game that's 400 "
173
 
"pixels wide by 500 pixels high. In the next section, we'll make the game "
174
 
"that size."
175
 
msgstr ""
176
 
 
177
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:98(title)
178
 
msgid "Changing the Screen Dimensions"
179
 
msgstr ""
180
 
 
181
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:99(para)
182
 
msgid ""
183
 
"The first change we'll make is to change the screen dimensions to be "
184
 
"oriented from top to bottom. We do this by changing a little code. So let's "
185
 
"fire up the code editor first. Run the edit command to fire up the editor."
186
 
msgstr ""
187
 
 
188
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:102(programlisting)
189
 
#, no-wrap
190
 
msgid "$quickly edit"
191
 
msgstr ""
192
 
 
193
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:104(programlisting)
194
 
#, no-wrap
195
 
msgid ""
196
 
"\n"
197
 
"#screen dimensions\n"
198
 
"screen_width = 400\n"
199
 
"screen_height = 500\n"
200
 
msgstr ""
201
 
 
202
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:103(para)
203
 
msgid ""
204
 
"This command should open your code in Gedit. The screen dimensions are set "
205
 
"in the file \"shooterconfig.py\". So just go to that file and change the "
206
 
"width to 400 and the height to 500. <placeholder-1/> Save the file and run "
207
 
"the game again. Notice that the screen wrapping and centering and everything "
208
 
"was taken care of for you. That's because you made the change in the "
209
 
"shooterconfig.py file. This is the right place to add and change variables "
210
 
"that should be availble throughout the game. We'll be make a few more "
211
 
"changes here later."
212
 
msgstr ""
213
 
 
214
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:114(title)
215
 
msgid "Programming the Guy"
216
 
msgstr ""
217
 
 
218
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:115(para)
219
 
msgid ""
220
 
"For this game, what we want is the guy to move left and right across the "
221
 
"bottom and not wrap through the screen. Also, we want to make the bullets "
222
 
"look like they are coming out of the guy's front."
223
 
msgstr ""
224
 
 
225
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:121(listitem)
226
 
msgid ""
227
 
"Place the guy at the beginning of each level at the middle and bottom of the "
228
 
"screen."
229
 
msgstr ""
230
 
 
231
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:122(listitem)
232
 
msgid ""
233
 
"Add functions to guy.py for moving and stop movig right and left, and remove "
234
 
"the rotate functions."
235
 
msgstr ""
236
 
 
237
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:123(listitem)
238
 
msgid ""
239
 
"Change the keyboard input in the bin/shooter file to call these new "
240
 
"functions."
241
 
msgstr ""
242
 
 
243
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:118(para)
244
 
msgid "To make the guy move just left and right we need to: <placeholder-1/>"
245
 
msgstr ""
246
 
 
247
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:128(programlisting)
248
 
#, no-wrap
249
 
msgid ""
250
 
"\n"
251
 
"     def init_position(self):\n"
252
 
"        \"\"\"init_position - resets the Guy's position near the\n"
253
 
"        bottom of the screen\n"
254
 
"        \n"
255
 
"        \"\"\"\n"
256
 
"        sw = shooterconfig.screen_width\n"
257
 
"        sh = shooterconfig.screen_height\n"
258
 
"\n"
259
 
"        self.x = sw/2\n"
260
 
"        self.y = sh - 80\n"
261
 
msgstr ""
262
 
 
263
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:143(listitem)
264
 
msgid "start_moving_left: the user pressed the \"s\" key"
265
 
msgstr ""
266
 
 
267
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:144(listitem)
268
 
msgid "stop_moving_left: the user released the \"s\" key"
269
 
msgstr ""
270
 
 
271
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:145(listitem)
272
 
msgid "start_moving_right: the user pressed the \"f\" key"
273
 
msgstr ""
274
 
 
275
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:146(listitem)
276
 
msgid "stop_moving_right: the user released the \"f\" key"
277
 
msgstr ""
278
 
 
279
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:150(listitem)
280
 
msgid "Create two tracking variables, _moving_left and _moving_right"
281
 
msgstr ""
282
 
 
283
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:151(listitem)
284
 
msgid ""
285
 
"Set these tracking variables to True or False in the "
286
 
"start/stop_moving_left/right functions"
287
 
msgstr ""
288
 
 
289
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:152(listitem)
290
 
msgid ""
291
 
"In the guy's update function, change the x coordinates of the guy based on "
292
 
"these variables"
293
 
msgstr ""
294
 
 
295
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:126(para)
296
 
msgid ""
297
 
"The functionaly that is specific to the player's sprite is in the guy.py "
298
 
"file. The first thing we will do is work on placing the guy properly. "
299
 
"Fortunately, the is an existing function that we can modify for this. The "
300
 
"function init_position is called to each time the guy needs to be placed on "
301
 
"the screen, like after he gets killed for instance . When created, the guy "
302
 
"calls the based class function center_on_screen. As you may guess, we will "
303
 
"want to change this function. so the guys is positionedhalfway down the "
304
 
"screen, and we want him to start a few pixels from the bottom. Fortunaately "
305
 
"we know how to get the screen dimensions, so it's easy make the change to "
306
 
"init_position. <placeholder-1/> Now when you run the game, the guy starts at "
307
 
"the bottom, which is what we want, but he also rotates when we use the s and "
308
 
"the d button, which we do not want. So let's change that next by "
309
 
"implementing four new functions: <placeholder-2/> Here's how we will "
310
 
"implement these functions: <placeholder-3/>"
311
 
msgstr ""
312
 
 
313
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:158(programlisting)
314
 
#, no-wrap
315
 
msgid ""
316
 
"\n"
317
 
"        self._moving_left = False\n"
318
 
"        self._moving_right = False\n"
319
 
msgstr ""
320
 
 
321
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:164(programlisting)
322
 
#, no-wrap
323
 
msgid ""
324
 
"\n"
325
 
"    def start_moving_right(self):\n"
326
 
"        self._moving_left = False\n"
327
 
"        self._moving_right = True\n"
328
 
"\n"
329
 
"    def start_moving_left(self):\n"
330
 
"        self._moving_left = True\n"
331
 
"        self._moving_right = False\n"
332
 
"\n"
333
 
"    def stop_moving_left(self):\n"
334
 
"        self._moving_left = False\n"
335
 
"\n"
336
 
"    def stop_moving_right(self):\n"
337
 
"        self._moving_right = False\n"
338
 
"\n"
339
 
msgstr ""
340
 
 
341
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:156(para)
342
 
msgid ""
343
 
"First, add the tracking variables to the Guy.__init__function. Add these "
344
 
"after the call to BaseSprite.__init__(). <placeholder-1/> Now the functions "
345
 
"for responding to keys simply set those tracking variables as appropriate. "
346
 
"So we add these four new functions to guy.py. <placeholder-2/>"
347
 
msgstr ""
348
 
 
349
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:181(para)
350
 
msgid ""
351
 
"Now we need change the guy's coordinates based on the tracking variable. "
352
 
"Every sprite has an update function. This function is called for every "
353
 
"\"tick\" in the game, and the sprite looks at it's internal data, and "
354
 
"updates itself appropriately. By default, the guy's rotation is handled by "
355
 
"BaseSprite, so we can ignore that, especially since we won't be using "
356
 
"rotation anyway. We're also not using acceleration for the guy, so we can "
357
 
"delete a bit of code. Funally, we don't want the guy to \"wrap\" though the "
358
 
"screen, so we whould catch that condition."
359
 
msgstr ""
360
 
 
361
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:186(programlisting)
362
 
#, no-wrap
363
 
msgid ""
364
 
"\n"
365
 
"    def update(self):\n"
366
 
"        \"\"\"update - Update internal data for a game tick\"\"\" \n"
367
 
"    \n"
368
 
"        BaseSprite.update(self)\n"
369
 
"\n"
370
 
"        if self._moving_left:\n"
371
 
"            self.x -= 5\n"
372
 
"            if self.x &lt; 0:\n"
373
 
"                self.x = 0\n"
374
 
"        if self._moving_right:\n"
375
 
"            self.x += 5\n"
376
 
"            if self.x + self.rect.width &gt; shooterconfig.screen_width:\n"
377
 
"                self.x = shooterconfig.screen_width - self.rect.width\n"
378
 
msgstr ""
379
 
 
380
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:184(para)
381
 
msgid ""
382
 
"Let's start with moving the guy 5 pixels per tick. So we can change the top "
383
 
"of the update function to look like this: <placeholder-1/>"
384
 
msgstr ""
385
 
 
386
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:202(para)
387
 
msgid ""
388
 
"So the guy is ready. He starts in the right place, tracks whether he is "
389
 
"moving left or right, and updates his position as desired. Now we just need "
390
 
"to hook him up the keys."
391
 
msgstr ""
392
 
 
393
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:205(para)
394
 
msgid ""
395
 
"Keyboard contol is handled in the shoort file in the bin directory. For each "
396
 
"click of the clock, the controller_tick function is called. Detecting "
397
 
"keyboard input and directing it as appropriate is handled in this funciton. "
398
 
"So what we wante to do is find where the f and s key events are handled, and "
399
 
"call the guy's start/stop_moving_left/right functions there."
400
 
msgstr ""
401
 
 
402
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:211(listitem)
403
 
msgid "Call the start_moving functions instead of rotate functions."
404
 
msgstr ""
405
 
 
406
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:212(listitem)
407
 
msgid "Remove the call to the accelerate function."
408
 
msgstr ""
409
 
 
410
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:213(listitem)
411
 
msgid "Remve the call to the hyperspace function."
412
 
msgstr ""
413
 
 
414
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:216(programlisting)
415
 
#, no-wrap
416
 
msgid ""
417
 
"\n"
418
 
"            #control the guy\n"
419
 
"            if not game.paused: \n"
420
 
"                if event.key == pygame.K_f:\n"
421
 
"                    g.start_moving_right()\n"
422
 
"                if event.key == pygame.K_s:\n"
423
 
"                    g.start_moving_left()\n"
424
 
"                if event.key == pygame.K_j:\n"
425
 
"                    g.shoot()\n"
426
 
"\n"
427
 
msgstr ""
428
 
 
429
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:208(para)
430
 
msgid ""
431
 
"Key down events are handled first, in a section commented \"control\" the "
432
 
"guy. We want to make a few changes here. <placeholder-1/> These last two "
433
 
"functions aren't needed for our new game. So let's make the changes and this "
434
 
"part of the controller_tick function will change to this: <placeholder-2/>"
435
 
msgstr ""
436
 
 
437
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:230(programlisting)
438
 
#, no-wrap
439
 
msgid ""
440
 
"\n"
441
 
"        #key up events, typically stop actions\n"
442
 
"        if event.type == pygame.KEYUP:\n"
443
 
"            if event.key == pygame.K_F11:\n"
444
 
"                pygame.display.toggle_fullscreen() \n"
445
 
"            if event.key == pygame.K_f:\n"
446
 
"                g.stop_moving_right()\n"
447
 
"            if event.key == pygame.K_s:\n"
448
 
"                g.stop_moving_left()\n"
449
 
"\n"
450
 
msgstr ""
451
 
 
452
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:228(para)
453
 
msgid ""
454
 
"We'll handle the key up functions similarly. <placeholder-1/><placeholder-2/>"
455
 
msgstr ""
456
 
 
457
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:248(listitem)
458
 
msgid ""
459
 
"The bullets accelerate and go way to fast, they'll miss enemies by skipping "
460
 
"over them."
461
 
msgstr ""
462
 
 
463
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:249(listitem)
464
 
msgid ""
465
 
"The bullets should go to the top of the screen, and not stop before or wrap "
466
 
"around"
467
 
msgstr ""
468
 
 
469
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:250(listitem)
470
 
msgid ""
471
 
"The bullets should appear to come out of the middle of the guy, instead of "
472
 
"the side."
473
 
msgstr ""
474
 
 
475
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:253(programlisting)
476
 
#, no-wrap
477
 
msgid ""
478
 
"\n"
479
 
"        self.max_velocity = 20\n"
480
 
"        self.max_ticks = 20\n"
481
 
msgstr ""
482
 
 
483
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:258(programlisting)
484
 
#, no-wrap
485
 
msgid ""
486
 
"\n"
487
 
"    def update(self):\n"
488
 
"        \"\"\"update - update internal data and position.\n"
489
 
"        Typically called by the game controller each game\n"
490
 
"        tick.\n"
491
 
"\n"
492
 
"        \"\"\"\n"
493
 
"\n"
494
 
"        BaseSprite.update(self)\n"
495
 
"\n"
496
 
"        if self.y &lt; 1:\n"
497
 
"            self.kill()\n"
498
 
"        if self.y == shooterconfig.screen_height:\n"
499
 
"            self.kill()\n"
500
 
msgstr ""
501
 
 
502
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:282(programlisting)
503
 
#, no-wrap
504
 
msgid ""
505
 
"\n"
506
 
"    def shoot(self):\n"
507
 
"        \"\"\"shoot - fire a bullet. Adds the bullet to the bullet sprite "
508
 
"group.\n"
509
 
"        If the maximum number of bullets premitted would be exceeded, \n"
510
 
"        the bullet will not fire. If the guy is exploding, the guy will no\n"
511
 
"        fire.\n"
512
 
"\n"
513
 
"        \"\"\"\n"
514
 
"\n"
515
 
"        if self.alive:\n"
516
 
"            #only allow max numbe of  bullets on the screen at a time\n"
517
 
"            if len(self.bullets.sprites()) &lt; self.max_bullets:\n"
518
 
"                center_x = (self.x + self.rect.width / 2) - 3\n"
519
 
"                b = Bullet(center_x,self.y,self.orientation)\n"
520
 
"                self.bullets.add(b)\n"
521
 
msgstr ""
522
 
 
523
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:245(para)
524
 
msgid ""
525
 
"Now we've got the guy working the way we want, but we need to make a few "
526
 
"changes to to how the guy's bullets are working: <placeholder-1/> We'll "
527
 
"handle the first problem my changing the Bullet class in the bullet.py file. "
528
 
"The acceleration and speed of bullets in the game is configured in the "
529
 
"__init__ function of this file. The rate at whcih a bullet accelerates is "
530
 
"controlled by member variable acceleration_divisor. We won't need to change "
531
 
"that. However, the maximum speed a bullet will reach is defined ny "
532
 
"max_velocity, and the lifetme of the bullet is defined by max_ticks. Let's "
533
 
"make the bullets go slower, but last longer, by changing max_velocity to 20, "
534
 
"and max_ticks to 20 in the Bullet __init__ funciton. <placeholder-2/> This "
535
 
"simple change is all that is necessary to control the bullets throughout the "
536
 
"game. Note that making this change in the Bullet class means all bullets in "
537
 
"the game, including enemy bullets, will now work this way. So let's quickly "
538
 
"deal with stopping bullets from wrapping as well. We'll add to the Bullet "
539
 
"class's update function to see if the bullet is above or below the screen, "
540
 
"and if so, we'll remove it. So we'll change the to of the update function in "
541
 
"bullet.py to look like this: <placeholder-3/> Note that a Sprite's kill "
542
 
"function, removes it from the game immediately, and with no fanfare. "
543
 
"Finally, we need to adjust the bullet so it comes out from the guys the way "
544
 
"we want it to. Since this is only related to the way the guy shoots bullets "
545
 
"and won't have anything to do with enemy bullets, we'll configure how "
546
 
"bullets emerge in the guy.py file. Let's just tweak the shoot function a "
547
 
"bit. As you can see in this function, when you create a bullet, you provide "
548
 
"it x and y coordinates. We'll just calculate at better x coordinate to "
549
 
"start. We'll find the middle of the width of the guy's image, and offset it "
550
 
"a bit so the bullet sprite looks like it comes out correctly. "
551
 
"<progamlisting> center_x = (self.x + self.rect.width / 2) - 3 "
552
 
"</progamlisting> So we change change the ugy's shoot funciton to look like "
553
 
"this: <placeholder-4/>"
554
 
msgstr ""
555
 
 
556
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:299(para)
557
 
msgid ""
558
 
"<placeholder-1/> Now we have the guy working as desired. Moves back and "
559
 
"forth across the bottom and shoots bullets the way we want. Next we'll go on "
560
 
"to changing the way the enemies work."
561
 
msgstr ""
562
 
 
563
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:308(title)
564
 
msgid "Programming Enemies"
565
 
msgstr ""
566
 
 
567
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:309(para)
568
 
msgid ""
569
 
"The generated game always adds two enemies for each level, a homing missle "
570
 
"and a stock \"enemy\". The homing missle does pretty much what's it name "
571
 
"suggests, homes in on the guy and kills him. The Enemy doesn't do much of "
572
 
"anything. Just kind of plunks down and waits to get killed. First we're "
573
 
"going to remove the homing missle from the game, and then we'll customize "
574
 
"the enemies to be a bit more menancing."
575
 
msgstr ""
576
 
 
577
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:314(programlisting)
578
 
#, no-wrap
579
 
msgid ""
580
 
"\n"
581
 
"    #TODO: set up enemies here\n"
582
 
"    #You can add more enemies or use different enemies\n"
583
 
"    #depening on the level\n"
584
 
"    for i in xrange(0,game.level + 3):\n"
585
 
"        enemies.add(Enemy())\n"
586
 
msgstr ""
587
 
 
588
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:312(para)
589
 
msgid ""
590
 
"The bin/shooter fileset up a SpriteGroup already. It's called \"enemies\" "
591
 
"and gets populated each time a new level is created. New levels are created "
592
 
"in the next_level function in the bin/shooter file. The next_level function "
593
 
"is pretty simple, it increments the game level bu 1, removes any remaining "
594
 
"emenemities for the SpriteGroup and then repulates the enemies SpriteGroup. "
595
 
"Let's make a couple of basic chagnnges here. First, we'll change the xrange "
596
 
"so that it creates more enemies with each level, and second, we'll just "
597
 
"delete the line that creates the homing missle. Change the next_level "
598
 
"function to make the last few lines as below. <placeholder-1/> So for the "
599
 
"first level, there will by for enemies, and each time there is an new level "
600
 
"created the number of enemies will increase by 1. Aslo, no more homing "
601
 
"missles. <placeholder-2/>"
602
 
msgstr ""
603
 
 
604
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:326(para)
605
 
msgid ""
606
 
"However, there are two things we need to do to enhance the game play with "
607
 
"our enemies. First, as you can see, they can start quite close to the guy, "
608
 
"even under. We'll need to fix that. Also, we should put them in motion so "
609
 
"they are a bit more of a challenge to shoot. We'll do both of the things by "
610
 
"modifying the Enemy class in the enemy.py file. Specifically in the "
611
 
"init_postion function."
612
 
msgstr ""
613
 
 
614
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:329(para)
615
 
msgid ""
616
 
"If you open the enemy.py file and look for the init_position function, "
617
 
"you'll see there is a call to the function in __init__ but there is no "
618
 
"function for it. That's because enemy inherits from BaseSprite, which has a "
619
 
"default init_position implementation that randomly places it on the screen. "
620
 
"So we'll simply override the init_position function in the Enemy class in "
621
 
"enemy.py."
622
 
msgstr ""
623
 
 
624
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:334(programlisting)
625
 
#, no-wrap
626
 
msgid ""
627
 
"\n"
628
 
"        sh = shooterconfig.screen_height\n"
629
 
"        sw = shooterconfig.screen_width\n"
630
 
msgstr ""
631
 
 
632
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:339(programlisting)
633
 
#, no-wrap
634
 
msgid ""
635
 
"\n"
636
 
"import random\n"
637
 
msgstr ""
638
 
 
639
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:343(programlisting)
640
 
#, no-wrap
641
 
msgid ""
642
 
"\n"
643
 
"        self.x = random.randint(20,sw - self.rect.width - 20)\n"
644
 
"        self.y = random.randint(20,sh/2)\n"
645
 
msgstr ""
646
 
 
647
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:348(programlisting)
648
 
#, no-wrap
649
 
msgid ""
650
 
"\n"
651
 
"        self.velocity_x = random.randint(-30,30)\n"
652
 
msgstr ""
653
 
 
654
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:352(programlisting)
655
 
#, no-wrap
656
 
msgid ""
657
 
"\n"
658
 
"    def init_position(self):\n"
659
 
"        sh = shooterconfig.screen_height\n"
660
 
"        sw = shooterconfig.screen_width\n"
661
 
"\n"
662
 
"        self.x = random.randint(20,sw - self.rect.width - 20)\n"
663
 
"        self.y = random.randint(20,sh/2)\n"
664
 
"        self.velocity_x = random.randint(-30,30)\n"
665
 
msgstr ""
666
 
 
667
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:332(para)
668
 
msgid ""
669
 
"First, to make it a bitter easier to code, grab a reference to the screen "
670
 
"height and widgth that you configured and keep those in easier to use "
671
 
"variables. <placeholder-1/> Next, we want to choose random start position "
672
 
"along the X axis. But we don't want the enemy to start too close to either "
673
 
"side or it might get stuck in a spot where the guy can't shoot it. To "
674
 
"generate random integers, use the randome module, so you'll have to add an "
675
 
"import to the top of the file. <placeholder-2/> We can use the screenwidth "
676
 
"to and the enemies own width to determine the right most starting position. "
677
 
"For the Y axis, we want the enemies to be far enough away that they can't "
678
 
"too easily kill the guy. We'll also make sure they don't get out of reach of "
679
 
"the guy's bullets. So between 20 and half way down seems about right. "
680
 
"<placeholder-3/> Finally, let's put each enemy in motion by picking a random "
681
 
"velocity_x within some reasonable bounds. <placeholder-4/> Notice that one "
682
 
"in 60 of the enemies won't be moving. That's okay because we added padding "
683
 
"to keep the enemies from ending up too close to the sides. The full "
684
 
"init_position function you need to add looks like this: <placeholder-5/> "
685
 
"When you run the game, you can see that the enemies are moving and are good "
686
 
"targets to shoot at. But next we'll make the enemies fight back."
687
 
msgstr ""
688
 
 
689
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:366(listitem)
690
 
msgid "Figure out where to place the bullet on the screen"
691
 
msgstr ""
692
 
 
693
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:367(listitem)
694
 
msgid "Configure the bullet's velocity and maximum speed"
695
 
msgstr ""
696
 
 
697
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:368(listitem)
698
 
msgid "Create the bullet object and add it to a SpriteGroup"
699
 
msgstr ""
700
 
 
701
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:371(programlisting)
702
 
#, no-wrap
703
 
msgid ""
704
 
"\n"
705
 
"#create the player's guy and some enemies\n"
706
 
"bullets = pygame.sprite.RenderUpdates()\n"
707
 
"g = Guy(bullets)\n"
708
 
"enemies = pygame.sprite.RenderUpdates()\n"
709
 
"enemy_bullets = pygame.sprite.RenderUpdates()\n"
710
 
msgstr ""
711
 
 
712
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:380(listitem)
713
 
msgid ""
714
 
"Clear out all the sprites in the group when creating a new level or "
715
 
"resetting a level after the guy dies."
716
 
msgstr ""
717
 
 
718
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:381(listitem)
719
 
msgid ""
720
 
"Tell the bullets in the sprite group to update themselves at the right time."
721
 
msgstr ""
722
 
 
723
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:382(listitem)
724
 
msgid "Tell the bullets to draw themselves at the right time."
725
 
msgstr ""
726
 
 
727
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:383(listitem)
728
 
msgid ""
729
 
"Pass a reference to the sprite group to each enemy that is created, so it "
730
 
"can add it's bullets to the group."
731
 
msgstr ""
732
 
 
733
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:386(programlisting)
734
 
#, no-wrap
735
 
msgid ""
736
 
"\n"
737
 
"    enemies.empty()\n"
738
 
msgstr ""
739
 
 
740
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:390(programlisting)
741
 
#, no-wrap
742
 
msgid ""
743
 
"\n"
744
 
"def update_sprites():\n"
745
 
"    \"\"\"update_sprites - call update() for all sprites\"\"\"\n"
746
 
"    g.update()\n"
747
 
"    bullets.update()\n"
748
 
"    enemies.update() \n"
749
 
"    enemy_bullets.update()\n"
750
 
msgstr ""
751
 
 
752
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:399(programlisting)
753
 
#, no-wrap
754
 
msgid ""
755
 
"\n"
756
 
"    #draw enemies\n"
757
 
"    enemies.draw(screen)\n"
758
 
"    enemy_bullets.draw(screen)\n"
759
 
msgstr ""
760
 
 
761
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:405(programlisting)
762
 
#, no-wrap
763
 
msgid ""
764
 
"\n"
765
 
"    def __init__(self,enemy_bullets):\n"
766
 
"        \"\"\"Creates an Enemy \"\"\"\n"
767
 
"        self.enemy_bullets = enemy_bullets\n"
768
 
"\n"
769
 
msgstr ""
770
 
 
771
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:412(programlisting)
772
 
#, no-wrap
773
 
msgid ""
774
 
"\n"
775
 
"        enemies.add(Enemy(enemy_bullets))\n"
776
 
msgstr ""
777
 
 
778
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:416(programlisting)
779
 
#, no-wrap
780
 
msgid ""
781
 
"\n"
782
 
"from bullet import Bullet\n"
783
 
msgstr ""
784
 
 
785
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:421(programlisting)
786
 
#, no-wrap
787
 
msgid ""
788
 
"\n"
789
 
"    def shoot(self):\n"
790
 
"        if self.alive:\n"
791
 
"            b = Bullet(self.x,self.y, 180)\n"
792
 
"            b.max_velocity = 6\n"
793
 
"            b.max_ticks = 50\n"
794
 
"            self.enemy_bullets.add(b)\n"
795
 
msgstr ""
796
 
 
797
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:431(programlisting)
798
 
#, no-wrap
799
 
msgid ""
800
 
"\n"
801
 
"    if not game.paused:\n"
802
 
"        for e in enemies:\n"
803
 
"            if random.randint(0,20) == 1:\n"
804
 
"                e.shoot()\n"
805
 
msgstr ""
806
 
 
807
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:441(programlisting)
808
 
#, no-wrap
809
 
msgid ""
810
 
"\n"
811
 
"enemy_bullet_image = image_path + \"enemy_bullet.png\"\n"
812
 
msgstr ""
813
 
 
814
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:445(programlisting)
815
 
#, no-wrap
816
 
msgid ""
817
 
"\n"
818
 
"    def shoot(self):\n"
819
 
"        if self.alive:\n"
820
 
"            img = shooterconfig.enemy_bullet_image\n"
821
 
"            b = Bullet(self.x,self.y, 180, img)\n"
822
 
"            b.max_velocity = 6\n"
823
 
"            b.max_ticks = 50\n"
824
 
"            self.enemy_bullets.add(b)\n"
825
 
msgstr ""
826
 
 
827
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:363(para)
828
 
msgid ""
829
 
"Let's add the ability for an enemy to drop a bomb. By default, enemies can't "
830
 
"do anything like that, so we'll have to add a new function. The function "
831
 
"will need to do the following things: <placeholder-1/> We should probably "
832
 
"start with this last part. We'll want to create a special sprite group for "
833
 
"the bullets to go into. This is primarily so that we can use the "
834
 
"SpriteGroups collision detection capabilities later. Also it's easier to "
835
 
"manage updates of sprites when they are in a group. First things first, "
836
 
"we'll create the sprite group. There's a place in the bin/shooter for "
837
 
"setting up enemies and such, so create another sprite group there. You "
838
 
"create a sprite group by calling a function in the pygame.sprite module "
839
 
"called \"RenderUpdates\". Lookk for the code block below, and notice the new "
840
 
"line creating the new sprite group by calling RenderUpdates. <placeholder-"
841
 
"2/> Now that we have the sprite group called enemy_bullets we want to do "
842
 
"three more things with it for now. <placeholder-3/> So for the first part, "
843
 
"we'll call the sprite group's empty function in next_level and reset_level "
844
 
"This function simply removes each sprite in the sprite group from game play. "
845
 
"Do this as the first thing for each of these function. <placeholder-4/> For "
846
 
"the second point, we'll add to the function in bin/shooter called "
847
 
"update_sprites. As you may have guessed, this function is called each tick "
848
 
"and tells each sprite to update. For sprites in a sprite group, this is "
849
 
"easy, because the SpriteGroup class includes an update function that calls "
850
 
"update for each of it's sprites. So just add that to the end of the "
851
 
"update_sprites function in bin/shooter, so it looks like the listing here: "
852
 
"<placeholder-5/> The view_tick function is called once per tick as well. "
853
 
"This funciton updates the view on the screen. We'll add a line of code to "
854
 
"tell the bullets to draw themselves right under where the enemies draw "
855
 
"themselves. <placeholder-6/> Finally, we need to pass a reference to each "
856
 
"enemy as it is created and create a member variable to store that reference. "
857
 
"So we need to make a change in the enemy.py fil, to add an argument for the "
858
 
"SpriteGroup in the __init__ function, and also we need to pass the "
859
 
"SpriteGroup when creating enemies. So change the Enemy class in enemy.py so "
860
 
"the top of the __init__ function looks like so: <placeholder-7/> And then "
861
 
"back in the bin/shooter file in the next_level function when creating "
862
 
"enemies, pass in enemy_bullets. <placeholder-8/> Now we have a functioning "
863
 
"sprite group and the enemies have a reference to it, we are ready to start "
864
 
"actually adding some bullets to it. We'll do this by adding a member "
865
 
"function called \"shoot\" to the enemy. Don't forget to import the Bullet "
866
 
"class into the enemy.py file. <placeholder-9/> First thing is we'll check "
867
 
"that the enemy is alive. We don't have to do this, but for this game, we "
868
 
"don't want it to shoot if it's int the process of exploding. Then we'll just "
869
 
"create a bullet and add it to the SpriteGroup. The last argument we'll pass "
870
 
"in is to set the orientatin to 180. Orientation goes clockwise for 360 "
871
 
"degrees, with zero being directly up, and 180 being directly down. In code, "
872
 
"it looks like the listing below. <placeholder-10/> So now we just need to "
873
 
"tell the enemies to shoot. We'll do this back in the bin/shooter file, in "
874
 
"the\"controller_tick function. After the section where we respond to "
875
 
"keyboard input, we'll add a few lines to make the enemies shoot. First, "
876
 
"we'll make sure the game is not paused, not very fair to shoot in a paused "
877
 
"game, is it? Next we'll loop through the enemies and desider if we should "
878
 
"call shoot. using our friend random.randint, we'll do this say, one time "
879
 
"twenty. So if you add this code to the end of the controller_tick function, "
880
 
"your enemies will start dropping bombs. <placeholder-11/><placeholder-12/> "
881
 
"So if you run the game, you'll see that the enemies are dropping bulltes "
882
 
"like bombs. Nice. However, maybe it would be nicer if the sprites for the "
883
 
"enemy bullets were different than the sprites for the guy's bullets. "
884
 
"Remember at the beginning of the tutorial we added an image called "
885
 
"enemy_bullet.png to the data/media directory. Now we'll write a bit of code "
886
 
"to use that image. First thing, we should add a reference to it in the "
887
 
"shooterconfig.py file. In this way, the Enemy class will be able to find it. "
888
 
"Just add the following line along with the other image path setting code in "
889
 
"shooterconfig.py. <placeholder-13/> So now we need to tell the bullets in "
890
 
"the Enemy class to use that image. Fortunately the Bullet class takes an "
891
 
"optional parameter for the name of an image to use. So just modify the shoot "
892
 
"function in the Enemy class to include the path. <placeholder-14/> Now the "
893
 
"enemies are dropping bombs with our new image. <placeholder-15/>"
894
 
msgstr ""
895
 
 
896
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:459(para)
897
 
msgid ""
898
 
"But of course, you many notice the bombs aren't too menancing. In the next "
899
 
"chapter we'll add collision detection to make the bombs kill the guy."
900
 
msgstr ""
901
 
 
902
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:464(title)
903
 
msgid "Collision Detection"
904
 
msgstr ""
905
 
 
906
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:465(para)
907
 
msgid ""
908
 
"Collision detection is when you check for sprites that are overlapping, and "
909
 
"run code based on what happened. PyGame makes this very easy by providing "
910
 
"some functions to check for overlapping sprites for you. As you will see, it "
911
 
"works for individual sprites as well as sprite groups."
912
 
msgstr ""
913
 
 
914
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:470(programlisting)
915
 
#, no-wrap
916
 
msgid ""
917
 
"\n"
918
 
"        b = pygame.sprite.spritecollideany(g, enemy_bullets)\n"
919
 
"        if b != None:\n"
920
 
"            g.explode()\n"
921
 
"            b.kill()\n"
922
 
msgstr ""
923
 
 
924
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:481(programlisting)
925
 
#, no-wrap
926
 
msgid ""
927
 
"\n"
928
 
"    hits_dict = pygame.sprite.groupcollide(bullets, enemy_bullets, True, "
929
 
"False)\n"
930
 
msgstr ""
931
 
 
932
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:468(para)
933
 
msgid ""
934
 
"Ok, so let's start by making the bombs that the enemies drop actually kill "
935
 
"the guy. To do this, we want to check if the bombs ever collide with the "
936
 
"guy, and if they do, we'll tell the guy to explode, and then we'll remove "
937
 
"the bomb from the screen. So the logic is \"tell me if the guy collides with "
938
 
"any enemy_bullets\". There is a funciton for this called, "
939
 
"pygame.sprite.spritecollideany, which takes a single sprite and a sprite "
940
 
"group and returns a reference to any sprite in the sprite group that "
941
 
"collided with the single sprite. If there were no collisions, than e will be "
942
 
"None. Otherwise, we'll want to tell the guy to explode and tell the bullet "
943
 
"to just \"kill\", which will remove it from play. So we can call it like "
944
 
"this: <placeholder-1/> There is a function in bin/shooter called "
945
 
"check_collisions which is called once per tick, and is the perfect place to "
946
 
"add this code. Add it right under the similar test for the guy colliding "
947
 
"with enemies. Now those bombs can kill the guys. <placeholder-2/> If you "
948
 
"play for a bit, you may notice that the bullets and the bombs just kind of "
949
 
"pass by each other. We can ramp up the game play by making the enemy bullets "
950
 
"destroy the guy's bullets, but not visa versa. So that logic here is, have "
951
 
"any of the sprites in the bullets sprite group collided with the bullets in "
952
 
"the enemy bullets sprite group. There is function for this as well, "
953
 
"pygame.sprite.groupcollide. groupcollide takes two sprite lists and returns "
954
 
"a dictionary. The keys in the dictionary are any sprites from the first "
955
 
"group that are involved in a collision, and the values are the sprites from "
956
 
"the second group that collided with the sprite that for key. It's a bit hard "
957
 
"to explain, but I bet the code is pretty readable. Add this line to the "
958
 
"check_collisions function. <placeholder-3/> Now if you run the game, it's a "
959
 
"bit more challenging as the enemies are a bit more offensive. This code just "
960
 
"kills the bullets involed in any collisions. Notice that I passed in True "
961
 
"False at the end of this function. These paramaters determine whether to "
962
 
"kill sprites form either group involved in the collusion. The True tells the "
963
 
"function to kill any bullets involved in collisions, so this was simple to "
964
 
"code."
965
 
msgstr ""
966
 
 
967
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:488(title)
968
 
msgid "Playing Sounds"
969
 
msgstr ""
970
 
 
971
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:491(programlisting)
972
 
#, no-wrap
973
 
msgid ""
974
 
"\n"
975
 
"tink_sound = sound_path + \"tink.wav\" \n"
976
 
" "
977
 
msgstr ""
978
 
 
979
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:495(programlisting)
980
 
#, no-wrap
981
 
msgid ""
982
 
"\n"
983
 
"#set up some objects and models\n"
984
 
"tink_sound = pygame.mixer.Sound(shooter.shooterconfig.tink_sound) \n"
985
 
" "
986
 
msgstr ""
987
 
 
988
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:500(programlisting)
989
 
#, no-wrap
990
 
msgid ""
991
 
"\n"
992
 
"    hits_dict = pygame.sprite.groupcollide(bullets, enemy_bullets, True, "
993
 
"False)\n"
994
 
"    if len(hits_dict) &gt; 0:\n"
995
 
"        tink_sound.play() \n"
996
 
" "
997
 
msgstr ""
998
 
 
999
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:506(programlisting)
1000
 
#, no-wrap
1001
 
msgid ""
1002
 
"\n"
1003
 
"        self.launch_sound = "
1004
 
"pygame.mixer.Sound(shooterconfig.guy_shoot_sound)\n"
1005
 
"        self.launch_sound.set_volume(.2)\n"
1006
 
"        self.launch_sound.play() \n"
1007
 
" "
1008
 
msgstr ""
1009
 
 
1010
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:489(para)
1011
 
msgid ""
1012
 
"The game is pretty much done in terms of game play, but I want to make one "
1013
 
"small enhancement. When the enemy bullets kill one of the guy's bullets, I'd "
1014
 
"like to play a little sound to signify this. So first, I added a little "
1015
 
"\"tink\" sound to the data/media directory. After you add your sound, you "
1016
 
"need to add a reference to it in the shootercongif.py file. <placeholder-1/> "
1017
 
"Now, I want to add a little code after the collision detection between the "
1018
 
"bullets to play that sound if they collided. I can't just hop straight to "
1019
 
"that though, first I have to create a sound object.In pygame you manage "
1020
 
"sounds with the \"mixer\" module. I don't want to create this object over "
1021
 
"and over again. So I'll add it to the bin/shooter file where the other "
1022
 
"objects and such for the game are set up. <placeholder-2/> Now that I've "
1023
 
"told the mixer module to give me a sound, I can go ahead and check if there "
1024
 
"were any collisions between bullets, and play my sound. <placeholder-3/> So "
1025
 
"it seems to be working well, but what if you are finding that one of the "
1026
 
"sounds is too quiet or too loud? Or perhpas you want a certain sound to be "
1027
 
"loud sometimes and queit other times, for example to simulate distance. This "
1028
 
"is easy to do because each sound object has a set_volume function that you "
1029
 
"can use to set the sound between 0 (for slient) and 1 (for normal volume). "
1030
 
"The bullet launch sound I used was a bit loud, so in the bullet.py file, "
1031
 
"I'll adjust the Bullet class to play the sound a bit more quietly. "
1032
 
"<placeholder-4/>"
1033
 
msgstr ""
1034
 
 
1035
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:514(title)
1036
 
msgid "Conclusion"
1037
 
msgstr ""
1038
 
 
1039
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:518(listitem)
1040
 
msgid "Creating a game using $quickly create ubuntu-pygame"
1041
 
msgstr ""
1042
 
 
1043
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:519(listitem)
1044
 
msgid "Adding your own sprites to the game"
1045
 
msgstr ""
1046
 
 
1047
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:520(listitem)
1048
 
msgid "Setting the screen size and other info in the config file"
1049
 
msgstr ""
1050
 
 
1051
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:521(listitem)
1052
 
msgid "Programming a player's guy to respond to keyboard input and to shoot"
1053
 
msgstr ""
1054
 
 
1055
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:522(listitem)
1056
 
msgid "Programming enemies to move and shoot"
1057
 
msgstr ""
1058
 
 
1059
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:523(listitem)
1060
 
msgid "Using collision detection to blow up Sprites"
1061
 
msgstr ""
1062
 
 
1063
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:524(listitem)
1064
 
msgid "Playing and adjusting sounds"
1065
 
msgstr ""
1066
 
 
1067
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:528(listitem)
1068
 
msgid ""
1069
 
"The bullets that the guy shoots and the bombs that the enemies drop make the "
1070
 
"same sound, it would probably be nicer if they each made a different sounds."
1071
 
msgstr ""
1072
 
 
1073
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:529(listitem)
1074
 
msgid ""
1075
 
"The default explosions are crayon drawings, they don't fit in much with the "
1076
 
"look of the game. Perhaps some new images for the explosion stages would be "
1077
 
"good."
1078
 
msgstr ""
1079
 
 
1080
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:530(listitem)
1081
 
msgid ""
1082
 
"There are no power ups! You could create power up classes the derive from "
1083
 
"BaseSprite to give the guy extra powers, like bigger bullets, more bullets, "
1084
 
"or extra lives."
1085
 
msgstr ""
1086
 
 
1087
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:531(listitem)
1088
 
msgid ""
1089
 
"More special enemies, for example you could use the HomingMissle class to "
1090
 
"create harder to kill enemies."
1091
 
msgstr ""
1092
 
 
1093
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:532(listitem)
1094
 
msgid ""
1095
 
"The high score list is stored in desktopcouch, so it will sync with your "
1096
 
"other computers. But it will have to be adjusted to the size we set for the "
1097
 
"window, and perhaps you can also let the player choose the name that's "
1098
 
"stored."
1099
 
msgstr ""
1100
 
 
1101
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:515(para)
1102
 
msgid ""
1103
 
"So now you have a working game! This tutorial introduced the following key "
1104
 
"concepts for using the Quickly PyGame Template. <placeholder-1/> But there "
1105
 
"is still a lot to do to have a propper game. For example: <placeholder-2/>"
1106
 
msgstr ""
1107
 
 
1108
 
#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2
1109
 
#: data/templates/ubuntu-pygame/help/tutorial.xml:0(None)
1110
 
msgid "translator-credits"
1111
 
msgstr ""
1112
 
"Launchpad Contributions:\n"
1113
 
"  Michael Terry https://launchpad.net/~mterry"