summaryrefslogtreecommitdiff
path: root/docs/html/class_game.html
blob: f56b7df64ecf4bd68f2eee9a36380d4f874e40e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Rally X: Game Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="car.PNG"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Rally X
   
   </div>
   <div id="projectbrief">ELEN3009 Project by Justin Wernick and David Schneider</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">Game Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Game" -->
<p>The object that controls the flow of the game, and the launch point of the game.  
 <a href="class_game.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_game_8h_source.html">Game.h</a>&gt;</code></p>

<p><a href="class_game-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#ad59df6562a58a614fda24622d3715b65">Game</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor, that creates the relevant Allegro entities.  <a href="#ad59df6562a58a614fda24622d3715b65"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#ae3d112ca6e0e55150d2fdbc704474530">~Game</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor, that destroys the relevant Allegro entities.  <a href="#ae3d112ca6e0e55150d2fdbc704474530"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a3d9b98f7c4a96ecf578f75b96c9f0e90">start</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Entry point for the program. This should be called from main.  <a href="#a3d9b98f7c4a96ecf578f75b96c9f0e90"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a636d6897103fd12d230489d512bf2be1">FPS</a> = 30</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Frames per second, the number of times the gameloop is run every second.  <a href="#a636d6897103fd12d230489d512bf2be1"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a22c1dee02ec8e0050a66eb851f2cf212">Game</a> (const <a class="el" href="class_game.html">Game</a> &amp;ref)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Unimplemented copy constructor, prevents copying of <a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> objects.  <a href="#a22c1dee02ec8e0050a66eb851f2cf212"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_game.html">Game</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#abf375a1957b6fdb5cbe67ef70fa818f5">operator=</a> (const <a class="el" href="class_game.html">Game</a> &amp;rhs)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Unimplemented assignment operator.  <a href="#abf375a1957b6fdb5cbe67ef70fa818f5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a2bd8589c18470f644445d97c1c35d169">initLevel</a> (const string &amp;levelFile)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialises all of the <a class="el" href="class_game_object.html" title="Parent class for objects that are placed in the maze.">GameObject</a> lists using a file.  <a href="#a2bd8589c18470f644445d97c1c35d169"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a069837f5f3f3b91b581e41dd74667211">runloop</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Main part of the game, performs the actions in each frame FPS times per second until the game is over.  <a href="#a069837f5f3f3b91b581e41dd74667211"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a79df6376b332d63c9eca0dcee30305c3">update</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls the update method on each of the GameObjects in the game.  <a href="#a79df6376b332d63c9eca0dcee30305c3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a961f632fbe7f4ba08d23fe9edc7711be">cleanup</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes any GameObjects that have been destroyed from their lists.  <a href="#a961f632fbe7f4ba08d23fe9edc7711be"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a03cf795e9aaa4c5950b4b5e918ab9ab6">clearLists</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys all GameObjects in the game, resetting the lists for a new level to be loaded.  <a href="#a03cf795e9aaa4c5950b4b5e918ab9ab6"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_allegro_init.html">AllegroInit</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a3bbe8c0dadbdf9e9e1d499f10509ef4e">_allegro</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles dependencies on Allegro being installed.  <a href="#a3bbe8c0dadbdf9e9e1d499f10509ef4e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_config.html">Config</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#aa60fe2dc0d1d53ebf49c2d87af6ee2d5">_config</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads configuration from file on construction, used to set resolution of screen.  <a href="#aa60fe2dc0d1d53ebf49c2d87af6ee2d5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_screen.html">Screen</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a9bc904a37fe9b3e85a597b6b5c6a66d5">_screen</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles all drawing operations.  <a href="#a9bc904a37fe9b3e85a597b6b5c6a66d5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ALLEGRO_TIMER *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#af153fc1d94c473114cfbd63728d21f91">_timer</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates FPS events per second, that are put into _timerEvents.  <a href="#af153fc1d94c473114cfbd63728d21f91"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ALLEGRO_EVENT_QUEUE *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a2b7303df1b6d0163b78c2c306164859f">_timerEvents</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Catches events from _timer, used to regulate speed of runloop.  <a href="#a2b7303df1b6d0163b78c2c306164859f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_maze.html">Maze</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a33457b2c7fa4f43b89e54ce9c5ac6f83">_maze</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The environment that confines the movements of GameObjects, specifically Cars.  <a href="#a33457b2c7fa4f43b89e54ce9c5ac6f83"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">list&lt; <a class="el" href="class_player_car.html">PlayerCar</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a75bf3282da1519766a6b75e2d83293ac">_players</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Typically a single <a class="el" href="class_player_car.html" title="A GameObject that is controlled by the player.">PlayerCar</a>, controlled by the person playing the game.  <a href="#a75bf3282da1519766a6b75e2d83293ac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">list&lt; <a class="el" href="class_enemy_car.html">EnemyCar</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#afbd3e358076a6cf2e72faefe1c202df9">_enemies</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List of all EnemyCars chasing the player.  <a href="#afbd3e358076a6cf2e72faefe1c202df9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">list&lt; <a class="el" href="class_checkpoint.html">Checkpoint</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a856252e94c580f59b926affc7d45b4bf">_checkpoints</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List of checkpoints that the player needs to collect.  <a href="#a856252e94c580f59b926affc7d45b4bf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">list&lt; <a class="el" href="class_rock.html">Rock</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a9f14643bfc4d595dc7dfa3160a59d71b">_rocks</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List of rocks that the player and EnemyCars need to avoid.  <a href="#a9f14643bfc4d595dc7dfa3160a59d71b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">list&lt; <a class="el" href="class_smokescreen.html">Smokescreen</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a88916ad9e8095b99a9c870a053180c1c">_smokescreens</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List of <a class="el" href="class_smokescreen.html" title="GameObject that causes the EnemyCar to be delayed if they crash into it.">Smokescreen</a> objects that are currently able to delay EnemyCars.  <a href="#a88916ad9e8095b99a9c870a053180c1c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">list&lt; <a class="el" href="class_destroyed_object_popup.html">DestroyedObjectPopup</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a9bea5a0ee430443effa418d42a903f83">_popups</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List of purely visual DestroyedObjectPopups that need to be drawn.  <a href="#a9bea5a0ee430443effa418d42a903f83"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_collision_detector.html">CollisionDetector</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#ab88620fda0d1fa729dcab6013e8f1efc">_collisionDetector</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Object that checks for collisions each frame.  <a href="#ab88620fda0d1fa729dcab6013e8f1efc"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The object that controls the flow of the game, and the launch point of the game. </p>
<p><a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> contains the various components, including the screen, the maze, and all of the objects in the maze. The timing of the gameloop also falls under Game's control. Essencially, <a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> is the central point that everything connects to.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Justin Wernick </dd>
<dd>
David Schneider </dd></dl>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00036">36</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad59df6562a58a614fda24622d3715b65"></a><!-- doxytag: member="Game::Game" ref="ad59df6562a58a614fda24622d3715b65" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Game::Game </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor, that creates the relevant Allegro entities. </p>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00003">3</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ae3d112ca6e0e55150d2fdbc704474530"></a><!-- doxytag: member="Game::~Game" ref="ae3d112ca6e0e55150d2fdbc704474530" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Game::~Game </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor, that destroys the relevant Allegro entities. </p>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00012">12</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a22c1dee02ec8e0050a66eb851f2cf212"></a><!-- doxytag: member="Game::Game" ref="a22c1dee02ec8e0050a66eb851f2cf212" args="(const Game &amp;ref)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Game::Game </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_game.html">Game</a> &amp;&#160;</td>
          <td class="paramname"><em>ref</em></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Unimplemented copy constructor, prevents copying of <a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> objects. </p>
<p>Copying a <a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> is unneccesary as there should only be a single <a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> object. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a961f632fbe7f4ba08d23fe9edc7711be"></a><!-- doxytag: member="Game::cleanup" ref="a961f632fbe7f4ba08d23fe9edc7711be" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Game::cleanup </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Removes any GameObjects that have been destroyed from their lists. </p>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00104">104</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a03cf795e9aaa4c5950b4b5e918ab9ab6"></a><!-- doxytag: member="Game::clearLists" ref="a03cf795e9aaa4c5950b4b5e918ab9ab6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Game::clearLists </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destroys all GameObjects in the game, resetting the lists for a new level to be loaded. </p>
<p>This should always be called before a new level is loaded. </p>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00177">177</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a2bd8589c18470f644445d97c1c35d169"></a><!-- doxytag: member="Game::initLevel" ref="a2bd8589c18470f644445d97c1c35d169" args="(const string &amp;levelFile)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Game::initLevel </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>levelFile</em></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialises all of the <a class="el" href="class_game_object.html" title="Parent class for objects that are placed in the maze.">GameObject</a> lists using a file. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">levelFile</td><td>The path of the file that contains the level layout. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00032">32</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="abf375a1957b6fdb5cbe67ef70fa818f5"></a><!-- doxytag: member="Game::operator=" ref="abf375a1957b6fdb5cbe67ef70fa818f5" args="(const Game &amp;rhs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_game.html">Game</a>&amp; Game::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_game.html">Game</a> &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Unimplemented assignment operator. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_game.html#a22c1dee02ec8e0050a66eb851f2cf212" title="Unimplemented copy constructor, prevents copying of Game objects.">Game::Game(const Game&amp; ref)</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a069837f5f3f3b91b581e41dd74667211"></a><!-- doxytag: member="Game::runloop" ref="a069837f5f3f3b91b581e41dd74667211" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Game::runloop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Main part of the game, performs the actions in each frame FPS times per second until the game is over. </p>
<p>Each frame runs the update methods of each of the GameObjects in the lists. The <a class="el" href="class_collision_detector.html" title="Object for handling collisions between GameObjects.">CollisionDetector</a> then checks for collisions between objects. Any GameObjects that have been destroyed are then removed from their lists. Finally, the <a class="el" href="class_screen.html" title="Class for creating a window on the screen.">Screen</a> is called to draw all of the GameObjects that still exist in their new positions.</p>
<p>Before the next iteration begins, a check is done for the victory and loss conditions. The loop is ended if either of these are met, or if the player has quit the game. </p>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00039">39</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a3d9b98f7c4a96ecf578f75b96c9f0e90"></a><!-- doxytag: member="Game::start" ref="a3d9b98f7c4a96ecf578f75b96c9f0e90" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Game::start </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Entry point for the program. This should be called from main. </p>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00019">19</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a79df6376b332d63c9eca0dcee30305c3"></a><!-- doxytag: member="Game::update" ref="a79df6376b332d63c9eca0dcee30305c3" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Game::update </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Calls the update method on each of the GameObjects in the game. </p>

<p>Definition at line <a class="el" href="_game_8cpp_source.html#l00082">82</a> of file <a class="el" href="_game_8cpp_source.html">Game.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a3bbe8c0dadbdf9e9e1d499f10509ef4e"></a><!-- doxytag: member="Game::_allegro" ref="a3bbe8c0dadbdf9e9e1d499f10509ef4e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_allegro_init.html">AllegroInit</a> <a class="el" href="class_game.html#a3bbe8c0dadbdf9e9e1d499f10509ef4e">Game::_allegro</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Handles dependencies on Allegro being installed. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00106">106</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a856252e94c580f59b926affc7d45b4bf"></a><!-- doxytag: member="Game::_checkpoints" ref="a856252e94c580f59b926affc7d45b4bf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="class_checkpoint.html">Checkpoint</a>&gt; <a class="el" href="class_game.html#a856252e94c580f59b926affc7d45b4bf">Game::_checkpoints</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List of checkpoints that the player needs to collect. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00127">127</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab88620fda0d1fa729dcab6013e8f1efc"></a><!-- doxytag: member="Game::_collisionDetector" ref="ab88620fda0d1fa729dcab6013e8f1efc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_collision_detector.html">CollisionDetector</a> <a class="el" href="class_game.html#ab88620fda0d1fa729dcab6013e8f1efc">Game::_collisionDetector</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Object that checks for collisions each frame. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00132">132</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa60fe2dc0d1d53ebf49c2d87af6ee2d5"></a><!-- doxytag: member="Game::_config" ref="aa60fe2dc0d1d53ebf49c2d87af6ee2d5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_config.html">Config</a> <a class="el" href="class_game.html#aa60fe2dc0d1d53ebf49c2d87af6ee2d5">Game::_config</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Loads configuration from file on construction, used to set resolution of screen. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00108">108</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="afbd3e358076a6cf2e72faefe1c202df9"></a><!-- doxytag: member="Game::_enemies" ref="afbd3e358076a6cf2e72faefe1c202df9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="class_enemy_car.html">EnemyCar</a>&gt; <a class="el" href="class_game.html#afbd3e358076a6cf2e72faefe1c202df9">Game::_enemies</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List of all EnemyCars chasing the player. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00126">126</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a33457b2c7fa4f43b89e54ce9c5ac6f83"></a><!-- doxytag: member="Game::_maze" ref="a33457b2c7fa4f43b89e54ce9c5ac6f83" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_maze.html">Maze</a> <a class="el" href="class_game.html#a33457b2c7fa4f43b89e54ce9c5ac6f83">Game::_maze</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The environment that confines the movements of GameObjects, specifically Cars. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00113">113</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a75bf3282da1519766a6b75e2d83293ac"></a><!-- doxytag: member="Game::_players" ref="a75bf3282da1519766a6b75e2d83293ac" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="class_player_car.html">PlayerCar</a>&gt; <a class="el" href="class_game.html#a75bf3282da1519766a6b75e2d83293ac">Game::_players</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Typically a single <a class="el" href="class_player_car.html" title="A GameObject that is controlled by the player.">PlayerCar</a>, controlled by the person playing the game. </p>
<p>A list was used for _players to allow the <a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> object to be constructed without needing to initialise a meaningless <a class="el" href="class_player_car.html" title="A GameObject that is controlled by the player.">PlayerCar</a> object. This also allows the <a class="el" href="class_player_car.html" title="A GameObject that is controlled by the player.">PlayerCar</a> to be destroyed by Rocks or EnemyCars. An added benefit is that it adds the ease of extending the game to allow multiple players. To add multiplayer, the <a class="el" href="class_keyboard_handler.html" title="Class for handling keyboard related game inputs from the player.">KeyboardHandler</a> would need to be modified to allow different sets of input keys, and the <a class="el" href="class_screen.html" title="Class for creating a window on the screen.">Screen</a> would need to be modified to keep all players visible, but the <a class="el" href="class_game.html" title="The object that controls the flow of the game, and the launch point of the game.">Game</a> class would be able to remain largely unchanged. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00124">124</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9bea5a0ee430443effa418d42a903f83"></a><!-- doxytag: member="Game::_popups" ref="a9bea5a0ee430443effa418d42a903f83" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="class_destroyed_object_popup.html">DestroyedObjectPopup</a>&gt; <a class="el" href="class_game.html#a9bea5a0ee430443effa418d42a903f83">Game::_popups</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List of purely visual DestroyedObjectPopups that need to be drawn. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00130">130</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9f14643bfc4d595dc7dfa3160a59d71b"></a><!-- doxytag: member="Game::_rocks" ref="a9f14643bfc4d595dc7dfa3160a59d71b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="class_rock.html">Rock</a>&gt; <a class="el" href="class_game.html#a9f14643bfc4d595dc7dfa3160a59d71b">Game::_rocks</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List of rocks that the player and EnemyCars need to avoid. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00128">128</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9bc904a37fe9b3e85a597b6b5c6a66d5"></a><!-- doxytag: member="Game::_screen" ref="a9bc904a37fe9b3e85a597b6b5c6a66d5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_screen.html">Screen</a> <a class="el" href="class_game.html#a9bc904a37fe9b3e85a597b6b5c6a66d5">Game::_screen</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Handles all drawing operations. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00109">109</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a88916ad9e8095b99a9c870a053180c1c"></a><!-- doxytag: member="Game::_smokescreens" ref="a88916ad9e8095b99a9c870a053180c1c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="class_smokescreen.html">Smokescreen</a>&gt; <a class="el" href="class_game.html#a88916ad9e8095b99a9c870a053180c1c">Game::_smokescreens</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List of <a class="el" href="class_smokescreen.html" title="GameObject that causes the EnemyCar to be delayed if they crash into it.">Smokescreen</a> objects that are currently able to delay EnemyCars. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00129">129</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="af153fc1d94c473114cfbd63728d21f91"></a><!-- doxytag: member="Game::_timer" ref="af153fc1d94c473114cfbd63728d21f91" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ALLEGRO_TIMER* <a class="el" href="class_game.html#af153fc1d94c473114cfbd63728d21f91">Game::_timer</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates FPS events per second, that are put into _timerEvents. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00110">110</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a2b7303df1b6d0163b78c2c306164859f"></a><!-- doxytag: member="Game::_timerEvents" ref="a2b7303df1b6d0163b78c2c306164859f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ALLEGRO_EVENT_QUEUE* <a class="el" href="class_game.html#a2b7303df1b6d0163b78c2c306164859f">Game::_timerEvents</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Catches events from _timer, used to regulate speed of runloop. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00111">111</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<a class="anchor" id="a636d6897103fd12d230489d512bf2be1"></a><!-- doxytag: member="Game::FPS" ref="a636d6897103fd12d230489d512bf2be1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const unsigned int <a class="el" href="class_game.html#a636d6897103fd12d230489d512bf2be1">Game::FPS</a> = 30<code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Frames per second, the number of times the gameloop is run every second. </p>

<p>Definition at line <a class="el" href="_game_8h_source.html#l00039">39</a> of file <a class="el" href="_game_8h_source.html">Game.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>source/logic/<a class="el" href="_game_8h_source.html">Game.h</a></li>
<li>source/logic/<a class="el" href="_game_8cpp_source.html">Game.cpp</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 5 2011 20:08:31 for Rally X by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>