Yet again doc modification
This commit is contained in:
		
							parent
							
								
									66c39a7fa9
								
							
						
					
					
						commit
						0c84486628
					
				| @ -135,7 +135,7 @@ $(document).ready(function(){initNavTree('d1/de4/game_managers_8cpp_source.html' | ||||
| <div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span> </div> | ||||
| <div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>        <span class="keywordtype">unsigned</span> rdCol = grid.<a class="code hl_function" href="../../d0/d8d/class_invaders_grid.html#ac184c30c8a60fdbe8abed9b9455d35d2">randomValidCol</a>();</div> | ||||
| <div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>        <span class="comment">// fire !</span></div> | ||||
| <div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>        missiles.push_back(basePos + <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(</div> | ||||
| <div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>        missiles.push_back(baseInvPos + <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(</div> | ||||
| <div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>                confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> * rdCol + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a> * (rdCol + 0.5),</div> | ||||
| <div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>                confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> * (grid[rdCol].size() - 1) + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a> * (grid[rdCol].size() - 1)</div> | ||||
| <div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>        ));</div> | ||||
| @ -145,7 +145,7 @@ $(document).ready(function(){initNavTree('d1/de4/game_managers_8cpp_source.html' | ||||
| <div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>    <span class="comment">// TODO fix this lol</span></div> | ||||
| <div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>    </div> | ||||
| <div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>    <span class="keywordflow">if</span>(direction){ <span class="comment">// go to the right</span></div> | ||||
| <div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>        <span class="keywordtype">int</span> end = basePos.getX(); <span class="comment">// start Position</span></div> | ||||
| <div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>        <span class="keywordtype">int</span> end = baseInvPos.getX(); <span class="comment">// start Position</span></div> | ||||
| <div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>        end+= grid.size() * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a>; <span class="comment">// add the invaders</span></div> | ||||
| <div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>        end+= (grid.size()-1) * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>; <span class="comment">// add the invadersDistance between invaders</span></div> | ||||
| <div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div> | ||||
| @ -158,26 +158,26 @@ $(document).ready(function(){initNavTree('d1/de4/game_managers_8cpp_source.html' | ||||
| <div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>        }</div> | ||||
| <div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span> </div> | ||||
| <div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>        <span class="keywordflow">if</span>(end + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ad057123e1f1b7283b873eed8a07ead3f">invadersSpeed</a> < relativeScreenWidth){</div> | ||||
| <div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>            basePos.setX(basePos.getX() + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ad057123e1f1b7283b873eed8a07ead3f">invadersSpeed</a>);</div> | ||||
| <div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>            baseInvPos.setX(baseInvPos.getX() + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ad057123e1f1b7283b873eed8a07ead3f">invadersSpeed</a>);</div> | ||||
| <div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>        }</div> | ||||
| <div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>        <span class="keywordflow">else</span>{</div> | ||||
| <div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>            basePos.setY(basePos.getY() + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>);</div> | ||||
| <div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>            baseInvPos.setY(baseInvPos.getY() + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>);</div> | ||||
| <div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>            direction = !direction;</div> | ||||
| <div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div> | ||||
| <div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>        }</div> | ||||
| <div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    }</div> | ||||
| <div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    <span class="keywordflow">else</span>{</div> | ||||
| <div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>        <span class="keywordtype">size_t</span> i = 0;</div> | ||||
| <div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>        <span class="keywordtype">unsigned</span> relativeBasePos = basePos.getX();</div> | ||||
| <div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>        <span class="keywordtype">unsigned</span> relativeBasePos = baseInvPos.getX();</div> | ||||
| <div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>        <span class="keywordflow">while</span> (grid[i].hasNoValid()){</div> | ||||
| <div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>            relativeBasePos += confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>;</div> | ||||
| <div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>            ++i;</div> | ||||
| <div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>        }</div> | ||||
| <div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span> </div> | ||||
| <div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>        <span class="keywordflow">if</span>(relativeBasePos >= confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ad057123e1f1b7283b873eed8a07ead3f">invadersSpeed</a>){</div> | ||||
| <div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>            basePos.setX(basePos.getX() - confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ad057123e1f1b7283b873eed8a07ead3f">invadersSpeed</a>);</div> | ||||
| <div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>            baseInvPos.setX(baseInvPos.getX() - confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ad057123e1f1b7283b873eed8a07ead3f">invadersSpeed</a>);</div> | ||||
| <div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>        }<span class="keywordflow">else</span>{</div> | ||||
| <div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>            basePos.setY(basePos.getY() + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>);</div> | ||||
| <div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>            baseInvPos.setY(baseInvPos.getY() + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>);</div> | ||||
| <div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>            direction = !direction;</div> | ||||
| <div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div> | ||||
| <div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>        }</div> | ||||
| @ -269,7 +269,7 @@ $(document).ready(function(){initNavTree('d1/de4/game_managers_8cpp_source.html' | ||||
| <div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>            <span class="keywordtype">unsigned</span> alienIndex = grid[i].getOutterInvader();</div> | ||||
| <div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>            <span class="keywordflow">if</span>(alienIndex==grid[i].size())<span class="keywordflow">continue</span>;</div> | ||||
| <div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>            <span class="comment">// calculate top-left Position of invader</span></div> | ||||
| <div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>            <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a> pos = basePos + <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(</div> | ||||
| <div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>            <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a> pos = baseInvPos + <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(</div> | ||||
| <div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>                    confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a>*i+confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>*i,</div> | ||||
| <div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>                    confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a>*alienIndex+confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>*alienIndex</div> | ||||
| <div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>            );</div> | ||||
| @ -301,7 +301,7 @@ $(document).ready(function(){initNavTree('d1/de4/game_managers_8cpp_source.html' | ||||
| <div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span><span class="keywordtype">bool</span> Game::invadersTouchPlayer()<span class="keyword"> const </span>{</div> | ||||
| <div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span>    <span class="keywordflow">return</span> any_of(grid.begin(), grid.end(), [<span class="keyword">this</span>](<span class="keyword">const</span> <a class="code hl_class" href="../../d1/dd8/class_invaders_column.html">InvadersColumn</a>& line) -> <span class="keywordtype">bool</span> {</div> | ||||
| <div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>        unsigned outter = line.getOutterInvader();</div> | ||||
| <div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>        return this->basePos.getY()+confData.invadersSize*(outter+1)</div> | ||||
| <div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>        return this->baseInvPos.getY()+confData.invadersSize*(outter+1)</div> | ||||
| <div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span>            +confData.invadersDistance*outter</div> | ||||
| <div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span>            >= pm->getScreenHeight() - PLAYER_HEIGHT;</div> | ||||
| <div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span>    });</div> | ||||
|  | ||||
| @ -118,7 +118,7 @@ $(document).ready(function(){initNavTree('d2/dd5/game_8h_source.html','../../'); | ||||
| <div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    </div> | ||||
| <div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    <a class="code hl_class" href="../../d0/d2f/class_god.html">God</a> god;</div> | ||||
| <div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>    </div> | ||||
| <div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>    <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a> basePos;</div> | ||||
| <div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>    <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a> baseInvPos;</div> | ||||
| <div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>    </div> | ||||
| <div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>    <a class="code hl_class" href="../../d0/d8d/class_invaders_grid.html">InvadersGrid</a> grid;</div> | ||||
| <div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    </div> | ||||
| @ -154,7 +154,7 @@ $(document).ready(function(){initNavTree('d2/dd5/game_8h_source.html','../../'); | ||||
| <div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>    </div> | ||||
| <div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>    <span class="keywordtype">void</span> displayGod() <span class="keyword">const</span>;</div> | ||||
| <div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>    </div> | ||||
| <div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>    <span class="keywordtype">void</span> displayInvader(<span class="keyword">const</span> <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>& basePos, <a class="code hl_enumeration" href="../../d6/def/invaders_grid_8h.html#a28be5c0c3bae3518d94b2ede3633e018">InvaderType</a> type) <span class="keyword">const</span>;</div> | ||||
| <div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>    <span class="keywordtype">void</span> displayInvader(<span class="keyword">const</span> <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>& baseInvPos, <a class="code hl_enumeration" href="../../d6/def/invaders_grid_8h.html#a28be5c0c3bae3518d94b2ede3633e018">InvaderType</a> type) <span class="keyword">const</span>;</div> | ||||
| <div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>    </div> | ||||
| <div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>    <span class="keywordtype">void</span> displayHearts(<a class="code hl_typedef" href="../../d5/d60/utils_8h.html#a19f2f2312637b6ed67b6d24598b6f470">playerID</a>) <span class="keyword">const</span>;</div> | ||||
| <div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span> </div> | ||||
|  | ||||
| @ -91,7 +91,7 @@ $(document).ready(function(){initNavTree('d9/d15/god_manager_8cpp_source.html',' | ||||
| <div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include "<a class="code" href="../../d2/dd5/game_8h.html">game.h</a>"</span></div> | ||||
| <div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div> | ||||
| <div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="keywordtype">void</span> Game::tryAwakeGod() {</div> | ||||
| <div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span>    <span class="keywordflow">if</span> (basePos.getY() > 100 <span class="comment">/*lambda value*/</span> && god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#aa509fa274d956215aa439de1c8e2e290">state</a>==<a class="code hl_enumvalue" href="../../d4/d57/god_8h.html#af1459ba6e17d6a2aef2bf5f4f56f6355ab50339a10e1de285ac99d4c3990b8693">GodState::NONE</a>) {</div> | ||||
| <div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span>    <span class="keywordflow">if</span> (baseInvPos.getY() > 100 <span class="comment">/*lambda value*/</span> && god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#aa509fa274d956215aa439de1c8e2e290">state</a>==<a class="code hl_enumvalue" href="../../d4/d57/god_8h.html#af1459ba6e17d6a2aef2bf5f4f56f6355ab50339a10e1de285ac99d4c3990b8693">GodState::NONE</a>) {</div> | ||||
| <div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span>        god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#a1000165e05f6719539b7702ab3f09a66">counter</a> = 0;</div> | ||||
| <div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>        god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#aa509fa274d956215aa439de1c8e2e290">state</a> = <a class="code hl_enumvalue" href="../../d4/d57/god_8h.html#af1459ba6e17d6a2aef2bf5f4f56f6355afca549f3541c801906abc34b45e8953e">GodState::AWAKE</a>;</div> | ||||
| <div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>    }</div> | ||||
| @ -125,7 +125,7 @@ $(document).ready(function(){initNavTree('d9/d15/god_manager_8cpp_source.html',' | ||||
| <div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>            god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#ad41071cd3e9f51419411e4fd1a0c63c5">thrownInvType</a> = <a class="code hl_enumvalue" href="../../d6/def/invaders_grid_8h.html#a28be5c0c3bae3518d94b2ede3633e018ab50339a10e1de285ac99d4c3990b8693">InvaderType::NONE</a>;</div> | ||||
| <div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span> </div> | ||||
| <div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>            god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#a41b9ceec78e403a54cf8afaf6e50519a">thrownTransition</a>.setX(pm->getScreenWidth() - <a class="code hl_define" href="../../d4/d57/god_8h.html#a0b3ad1c15e80936f3ee35f4ff91f243c">GOD_HAND_DISTANCE</a> - <a class="code hl_define" href="../../d4/d57/god_8h.html#a59e44f12d6c2f40c10bb249db0a3b3d6">GOD_HAND_SIZE</a>);</div> | ||||
| <div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>            god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#a41b9ceec78e403a54cf8afaf6e50519a">thrownTransition</a>.setY(basePos.getY() + <a class="code hl_define" href="../../d5/d60/utils_8h.html#a815cc3532f834befd1c85e0e8d3bc9f7">INV_GET_POS</a>(god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#a26fbb775dff480eaa6a19d4a3ef9731c">thrownInvPosY</a>));</div> | ||||
| <div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>            god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#a41b9ceec78e403a54cf8afaf6e50519a">thrownTransition</a>.setY(baseInvPos.getY() + <a class="code hl_define" href="../../d5/d60/utils_8h.html#a815cc3532f834befd1c85e0e8d3bc9f7">INV_GET_POS</a>(god.<a class="code hl_variable" href="../../d0/d2f/class_god.html#a26fbb775dff480eaa6a19d4a3ef9731c">thrownInvPosY</a>));</div> | ||||
| <div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> | ||||
| <div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>        }</div> | ||||
| <div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="../../d4/d57/god_8h.html#af1459ba6e17d6a2aef2bf5f4f56f6355a478d22fab8e360f3af57895f113f1f0f">GodState::RETRIEVE1</a>: {</div> | ||||
|  | ||||
| @ -96,8 +96,8 @@ $(document).ready(function(){initNavTree('db/d86/display_8cpp_source.html','../. | ||||
| <div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i < this->grid.size(); ++i){</div> | ||||
| <div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>        <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> j = 0; j < this->grid[i].size(); ++j){</div> | ||||
| <div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>            <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a> vec(</div> | ||||
| <div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>                    basePos.getX() + i * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + i * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>,</div> | ||||
| <div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>                    basePos.getY() + j * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + j * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a></div> | ||||
| <div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>                    baseInvPos.getX() + i * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + i * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a>,</div> | ||||
| <div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>                    baseInvPos.getY() + j * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#ada929ea4a462c0bde376adf9fa3f4810">invadersSize</a> + j * confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#aadc245edaf3b28d82f9ce7b17c655943">invadersDistance</a></div> | ||||
| <div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>            );</div> | ||||
| <div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>            displayInvader(vec, grid[i][j]);</div> | ||||
| <div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>        }</div> | ||||
|  | ||||
| @ -184,7 +184,7 @@ $(document).ready(function(){initNavTree('de/db0/game_basics_8cpp_source.html',' | ||||
| <div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>        players[i].lives = confData.<a class="code hl_variable" href="../../da/da7/struct_config_data.html#a09170415d0a4c525e546d6fd0ecb354c">playersLives</a>;</div> | ||||
| <div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span>    }</div> | ||||
| <div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span> </div> | ||||
| <div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>    basePos = <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(200, 0);</div> | ||||
| <div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>    baseInvPos = <a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(200, 0);</div> | ||||
| <div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>    direction = <span class="keyword">true</span>;</div> | ||||
| <div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span> </div> | ||||
| <div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>}</div> | ||||
| @ -249,7 +249,7 @@ $(document).ready(function(){initNavTree('de/db0/game_basics_8cpp_source.html',' | ||||
| <div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>}</div> | ||||
| <div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span> </div> | ||||
| <div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span><a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a> Game::invIndexToPos(<span class="keywordtype">unsigned</span> x, <span class="keywordtype">unsigned</span> y)<span class="keyword"> const </span>{</div> | ||||
| <div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>    <span class="keywordflow">return</span> basePos+<a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(<a class="code hl_define" href="../../d5/d60/utils_8h.html#a815cc3532f834befd1c85e0e8d3bc9f7">INV_GET_POS</a>(x), <a class="code hl_define" href="../../d5/d60/utils_8h.html#a815cc3532f834befd1c85e0e8d3bc9f7">INV_GET_POS</a>(y));</div> | ||||
| <div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>    <span class="keywordflow">return</span> baseInvPos+<a class="code hl_typedef" href="../../d5/d60/utils_8h.html#aaa06d516441b519f8892f37adafeade2">Position</a>(<a class="code hl_define" href="../../d5/d60/utils_8h.html#a815cc3532f834befd1c85e0e8d3bc9f7">INV_GET_POS</a>(x), <a class="code hl_define" href="../../d5/d60/utils_8h.html#a815cc3532f834befd1c85e0e8d3bc9f7">INV_GET_POS</a>(y));</div> | ||||
| <div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>}</div> | ||||
| <div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span> </div> | ||||
| <div class="line"><a id="l00176" name="l00176"></a><span class="lineno"><a class="line" href="../../dd/d1f/class_game.html#aef8202b79983c3b0f8d6db6c01d17fa6">  176</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../dd/d1f/class_game.html#aef8202b79983c3b0f8d6db6c01d17fa6">Game::arePlayersDead</a>() {</div> | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00055}00055 } | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00056}00056         \textcolor{keywordtype}{unsigned} rdCol = grid.\mbox{\hyperlink{class_invaders_grid_ac184c30c8a60fdbe8abed9b9455d35d2}{randomValidCol}}();} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00057}00057         \textcolor{comment}{// fire !}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00058}00058         missiles.push\_back(basePos + \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00058}00058         missiles.push\_back(baseInvPos + \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00059}00059                 confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} * rdCol + confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}} * (rdCol + 0.5),} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00060}00060                 confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} * (grid[rdCol].size() -\/ 1) + confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}} * (grid[rdCol].size() -\/ 1)} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00061}00061         ));} | ||||
| @ -60,7 +60,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00065}00065     \textcolor{comment}{// TODO fix this lol}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00066}00066     } | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00067}00067     \textcolor{keywordflow}{if}(direction)\{ \textcolor{comment}{// go to the right}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00068}00068         \textcolor{keywordtype}{int} end = basePos.getX(); \textcolor{comment}{// start Position}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00068}00068         \textcolor{keywordtype}{int} end = baseInvPos.getX(); \textcolor{comment}{// start Position}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00069}00069         end+= grid.size() * confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}}; \textcolor{comment}{// add the invaders}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00070}00070         end+= (grid.size()-\/1) * confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}}; \textcolor{comment}{// add the invadersDistance between invaders}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00071}00071 } | ||||
| @ -73,26 +73,26 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00078}00078         \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00079}00079 } | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00080}00080         \textcolor{keywordflow}{if}(end + confData.\mbox{\hyperlink{struct_config_data_ad057123e1f1b7283b873eed8a07ead3f}{invadersSpeed}} < relativeScreenWidth)\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00081}00081             basePos.setX(basePos.getX() + confData.\mbox{\hyperlink{struct_config_data_ad057123e1f1b7283b873eed8a07ead3f}{invadersSpeed}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00081}00081             baseInvPos.setX(baseInvPos.getX() + confData.\mbox{\hyperlink{struct_config_data_ad057123e1f1b7283b873eed8a07ead3f}{invadersSpeed}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00082}00082         \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00083}00083         \textcolor{keywordflow}{else}\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00084}00084             basePos.setY(basePos.getY() + confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00084}00084             baseInvPos.setY(baseInvPos.getY() + confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00085}00085             direction = !direction;} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00086}00086             \textcolor{keywordflow}{return} \textcolor{keyword}{true};} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00087}00087         \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00088}00088     \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00089}00089     \textcolor{keywordflow}{else}\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00090}00090         \textcolor{keywordtype}{size\_t} i = 0;} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00091}00091         \textcolor{keywordtype}{unsigned} relativeBasePos = basePos.getX();} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00091}00091         \textcolor{keywordtype}{unsigned} relativeBasePos = baseInvPos.getX();} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00092}00092         \textcolor{keywordflow}{while} (grid[i].hasNoValid())\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00093}00093             relativeBasePos += confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}};} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00094}00094             ++i;} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00095}00095         \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00096}00096 } | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00097}00097         \textcolor{keywordflow}{if}(relativeBasePos >= confData.\mbox{\hyperlink{struct_config_data_ad057123e1f1b7283b873eed8a07ead3f}{invadersSpeed}})\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00098}00098             basePos.setX(basePos.getX() -\/ confData.\mbox{\hyperlink{struct_config_data_ad057123e1f1b7283b873eed8a07ead3f}{invadersSpeed}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00098}00098             baseInvPos.setX(baseInvPos.getX() -\/ confData.\mbox{\hyperlink{struct_config_data_ad057123e1f1b7283b873eed8a07ead3f}{invadersSpeed}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00099}00099         \}\textcolor{keywordflow}{else}\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00100}00100             basePos.setY(basePos.getY() + confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00100}00100             baseInvPos.setY(baseInvPos.getY() + confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}});} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00101}00101             direction = !direction;} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00102}00102             \textcolor{keywordflow}{return} \textcolor{keyword}{true};} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00103}00103         \}} | ||||
| @ -184,7 +184,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00189}00189             \textcolor{keywordtype}{unsigned} alienIndex = grid[i].getOutterInvader();} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00190}00190             \textcolor{keywordflow}{if}(alienIndex==grid[i].size())\textcolor{keywordflow}{continue};} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00191}00191             \textcolor{comment}{// calculate top-\/left Position of invader}} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00192}00192             \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} pos = basePos + \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00192}00192             \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} pos = baseInvPos + \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00193}00193                     confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}}*i+confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}}*i,} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00194}00194                     confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}}*alienIndex+confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}}*alienIndex} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00195}00195             );} | ||||
| @ -216,7 +216,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00221}00221 \textcolor{keywordtype}{bool} Game::invadersTouchPlayer()\textcolor{keyword}{ const }\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00222}00222     \textcolor{keywordflow}{return} any\_of(grid.begin(), grid.end(), [\textcolor{keyword}{this}](\textcolor{keyword}{const} \mbox{\hyperlink{class_invaders_column}{InvadersColumn}}\& line) -\/> \textcolor{keywordtype}{bool} \{} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00223}00223         unsigned outter = line.getOutterInvader();} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00224}00224         return this-\/>basePos.getY()+confData.invadersSize*(outter+1)} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00224}00224         return this-\/>baseInvPos.getY()+confData.invadersSize*(outter+1)} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00225}00225             +confData.invadersDistance*outter} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00226}00226             >= pm-\/>getScreenHeight() -\/ PLAYER\_HEIGHT;} | ||||
| \DoxyCodeLine{\Hypertarget{game_managers_8cpp_source_l00227}00227     \});} | ||||
|  | ||||
| @ -33,7 +33,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00057}00057     } | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00061}00061     \mbox{\hyperlink{class_god}{God}} god;} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00062}00062     } | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00066}00066     \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} basePos;} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00066}00066     \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} baseInvPos;} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00067}00067     } | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00071}00071     \mbox{\hyperlink{class_invaders_grid}{InvadersGrid}} grid;} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00072}00072     } | ||||
| @ -69,7 +69,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00147}00147     } | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00152}00152     \textcolor{keywordtype}{void} displayGod() \textcolor{keyword}{const};} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00153}00153     } | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00160}00160     \textcolor{keywordtype}{void} displayInvader(\textcolor{keyword}{const} \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}\& basePos, \mbox{\hyperlink{invaders_grid_8h_a28be5c0c3bae3518d94b2ede3633e018}{InvaderType}} type) \textcolor{keyword}{const};} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00160}00160     \textcolor{keywordtype}{void} displayInvader(\textcolor{keyword}{const} \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}\& baseInvPos, \mbox{\hyperlink{invaders_grid_8h_a28be5c0c3bae3518d94b2ede3633e018}{InvaderType}} type) \textcolor{keyword}{const};} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00161}00161     } | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00166}00166     \textcolor{keywordtype}{void} displayHearts(\mbox{\hyperlink{utils_8h_a19f2f2312637b6ed67b6d24598b6f470}{playerID}}) \textcolor{keyword}{const};} | ||||
| \DoxyCodeLine{\Hypertarget{game_8h_source_l00167}00167 } | ||||
|  | ||||
| @ -6,7 +6,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00011}00011 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{game_8h}{game.h}}"{}}} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00012}00012 } | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00013}00013 \textcolor{keywordtype}{void} Game::tryAwakeGod() \{} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00014}00014     \textcolor{keywordflow}{if} (basePos.getY() > 100 \textcolor{comment}{/*lambda value*/} \&\& god.\mbox{\hyperlink{class_god_aa509fa274d956215aa439de1c8e2e290}{state}}==\mbox{\hyperlink{god_8h_af1459ba6e17d6a2aef2bf5f4f56f6355ab50339a10e1de285ac99d4c3990b8693}{GodState::NONE}}) \{} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00014}00014     \textcolor{keywordflow}{if} (baseInvPos.getY() > 100 \textcolor{comment}{/*lambda value*/} \&\& god.\mbox{\hyperlink{class_god_aa509fa274d956215aa439de1c8e2e290}{state}}==\mbox{\hyperlink{god_8h_af1459ba6e17d6a2aef2bf5f4f56f6355ab50339a10e1de285ac99d4c3990b8693}{GodState::NONE}}) \{} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00015}00015         god.\mbox{\hyperlink{class_god_a1000165e05f6719539b7702ab3f09a66}{counter}} = 0;} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00016}00016         god.\mbox{\hyperlink{class_god_aa509fa274d956215aa439de1c8e2e290}{state}} = \mbox{\hyperlink{god_8h_af1459ba6e17d6a2aef2bf5f4f56f6355afca549f3541c801906abc34b45e8953e}{GodState::AWAKE}};} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00017}00017     \}} | ||||
| @ -40,7 +40,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00049}00049             god.\mbox{\hyperlink{class_god_ad41071cd3e9f51419411e4fd1a0c63c5}{thrownInvType}} = \mbox{\hyperlink{invaders_grid_8h_a28be5c0c3bae3518d94b2ede3633e018ab50339a10e1de285ac99d4c3990b8693}{InvaderType::NONE}};} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00050}00050 } | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00051}00051             god.\mbox{\hyperlink{class_god_a41b9ceec78e403a54cf8afaf6e50519a}{thrownTransition}}.setX(pm-\/>getScreenWidth() -\/ \mbox{\hyperlink{god_8h_a0b3ad1c15e80936f3ee35f4ff91f243c}{GOD\_HAND\_DISTANCE}} -\/ \mbox{\hyperlink{god_8h_a59e44f12d6c2f40c10bb249db0a3b3d6}{GOD\_HAND\_SIZE}});} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00052}00052             god.\mbox{\hyperlink{class_god_a41b9ceec78e403a54cf8afaf6e50519a}{thrownTransition}}.setY(basePos.getY() + \mbox{\hyperlink{utils_8h_a815cc3532f834befd1c85e0e8d3bc9f7}{INV\_GET\_POS}}(god.\mbox{\hyperlink{class_god_a26fbb775dff480eaa6a19d4a3ef9731c}{thrownInvPosY}}));} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00052}00052             god.\mbox{\hyperlink{class_god_a41b9ceec78e403a54cf8afaf6e50519a}{thrownTransition}}.setY(baseInvPos.getY() + \mbox{\hyperlink{utils_8h_a815cc3532f834befd1c85e0e8d3bc9f7}{INV\_GET\_POS}}(god.\mbox{\hyperlink{class_god_a26fbb775dff480eaa6a19d4a3ef9731c}{thrownInvPosY}}));} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00053}00053             \textcolor{keywordflow}{return} \textcolor{keyword}{false};} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00054}00054         \}} | ||||
| \DoxyCodeLine{\Hypertarget{god_manager_8cpp_source_l00055}00055         \textcolor{keywordflow}{case} \mbox{\hyperlink{god_8h_af1459ba6e17d6a2aef2bf5f4f56f6355a478d22fab8e360f3af57895f113f1f0f}{GodState::RETRIEVE1}}: \{} | ||||
|  | ||||
| @ -11,8 +11,8 @@ | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00020}00020     \textcolor{keywordflow}{for} (\textcolor{keywordtype}{unsigned} i = 0; i < this-\/>grid.size(); ++i)\{} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00021}00021         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{unsigned} j = 0; j < this-\/>grid[i].size(); ++j)\{} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00022}00022             \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} vec(} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00023}00023                     basePos.getX() + i * confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + i * confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}},} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00024}00024                     basePos.getY() + j * confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + j * confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}}} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00023}00023                     baseInvPos.getX() + i * confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + i * confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}},} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00024}00024                     baseInvPos.getY() + j * confData.\mbox{\hyperlink{struct_config_data_ada929ea4a462c0bde376adf9fa3f4810}{invadersSize}} + j * confData.\mbox{\hyperlink{struct_config_data_aadc245edaf3b28d82f9ce7b17c655943}{invadersDistance}}} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00025}00025             );} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00026}00026             displayInvader(vec, grid[i][j]);} | ||||
| \DoxyCodeLine{\Hypertarget{display_8cpp_source_l00027}00027         \}} | ||||
|  | ||||
| @ -99,7 +99,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00105}00105         players[i].lives = confData.\mbox{\hyperlink{struct_config_data_a09170415d0a4c525e546d6fd0ecb354c}{playersLives}};} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00106}00106     \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00107}00107 } | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00108}00108     basePos = \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(200, 0);} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00108}00108     baseInvPos = \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(200, 0);} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00109}00109     direction = \textcolor{keyword}{true};} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00110}00110 } | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00111}00111 \}} | ||||
| @ -164,7 +164,7 @@ | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00170}00170 \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00171}00171 } | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00172}00172 \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} Game::invIndexToPos(\textcolor{keywordtype}{unsigned} x, \textcolor{keywordtype}{unsigned} y)\textcolor{keyword}{ const }\{} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00173}00173     \textcolor{keywordflow}{return} basePos+\mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(\mbox{\hyperlink{utils_8h_a815cc3532f834befd1c85e0e8d3bc9f7}{INV\_GET\_POS}}(x), \mbox{\hyperlink{utils_8h_a815cc3532f834befd1c85e0e8d3bc9f7}{INV\_GET\_POS}}(y));} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00173}00173     \textcolor{keywordflow}{return} baseInvPos+\mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}(\mbox{\hyperlink{utils_8h_a815cc3532f834befd1c85e0e8d3bc9f7}{INV\_GET\_POS}}(x), \mbox{\hyperlink{utils_8h_a815cc3532f834befd1c85e0e8d3bc9f7}{INV\_GET\_POS}}(y));} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00174}00174 \}} | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00175}00175 } | ||||
| \DoxyCodeLine{\Hypertarget{game_basics_8cpp_source_l00176}\mbox{\hyperlink{class_game_aef8202b79983c3b0f8d6db6c01d17fa6}{00176}} \textcolor{keywordtype}{bool} \mbox{\hyperlink{class_game_aef8202b79983c3b0f8d6db6c01d17fa6}{Game::arePlayersDead}}() \{} | ||||
|  | ||||
| @ -67,7 +67,7 @@ struct ConfigData { | ||||
| 	unsigned playersLives; | ||||
| 
 | ||||
| 	/*!
 | ||||
| 	 * @brief player key configuration | ||||
| 	 * @brief players configuration | ||||
| 	 */ | ||||
| 	vector<PlayerDef> playerDefs; | ||||
| 
 | ||||
| @ -102,7 +102,7 @@ struct ConfigData { | ||||
| 	unsigned missilesWidth; | ||||
| 	 | ||||
| 	/*!
 | ||||
| 	 * @brief invaders missiles length in pixel - auto defined from width | ||||
| 	 * @brief virtual value : invaders missiles length in pixel - auto defined from width | ||||
| 	 */ | ||||
| 	unsigned missilesLength; | ||||
| 	 | ||||
| @ -122,7 +122,7 @@ struct ConfigData { | ||||
| 	unsigned torpedosWidth; | ||||
| 
 | ||||
| 	/*!
 | ||||
| 	 * @brief players torpedos length in pixel // auto defined from width
 | ||||
| 	 * @brief virtual value : players torpedos length in pixel - auto defined from width | ||||
| 	 */ | ||||
| 	unsigned torpedosLength;  | ||||
| 
 | ||||
|  | ||||
| @ -16,7 +16,10 @@ | ||||
| 
 | ||||
| using namespace std; | ||||
| 
 | ||||
| // We keep the same case
 | ||||
| /*!
 | ||||
|  * @class config_error | ||||
|  * @brief Simple clone of runtime_error to help us handle errors in config management. | ||||
|  */ | ||||
| class config_error : public runtime_error { | ||||
| public: | ||||
| 	explicit config_error(const string& msg); | ||||
|  | ||||
| @ -61,9 +61,9 @@ private: | ||||
| 	God god; | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief base position for game display | ||||
|  	* @brief base position for the invader crowd | ||||
|  	*/ | ||||
| 	Position basePos; | ||||
| 	Position baseInvPos; | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief Invader position and type matrix | ||||
| @ -71,17 +71,17 @@ private: | ||||
| 	InvadersGrid grid; | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief Invader scroll direction - True = right , False = left | ||||
|  	* @brief Invader scroll direction - true = right , false = left | ||||
|  	*/ | ||||
| 	bool direction; | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief list of postion of all missiles shot by the invaders | ||||
|  	* @brief list of positions of all missiles shot by the invaders | ||||
|  	*/ | ||||
|     vector<missile> missiles; | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief list of postion of all torpedos shot by the player(s) | ||||
|  	* @brief list of positions of all torpedoes shot by the player(s) | ||||
|  	*/ | ||||
|     vector<Torpedo> torpedos; | ||||
| 	 | ||||
| @ -105,8 +105,8 @@ private: | ||||
| 	// basic methods
 | ||||
| 
 | ||||
| 	/*!
 | ||||
|  	* @brief | ||||
| 	* @return true if there are no more invaders in the grid | ||||
|  	* @brief check if there are invaders left in the grid | ||||
| 	* @return true if there are no more invaders in the grid, else false | ||||
| 	* @fn bool updateColumns(); | ||||
|  	*/ | ||||
| 	bool areThereInvadersLeft(); | ||||
| @ -126,12 +126,6 @@ private: | ||||
|  	*/ | ||||
| 	Position invIndexToPos(unsigned x, unsigned y) const; | ||||
| 
 | ||||
| 	/*!
 | ||||
|  	* @brief display players score on the screen | ||||
|  	* @fn void displayScore(); | ||||
| 	*/ | ||||
| 	void displayScore() const; | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief main display function, clear the window and calls sub display functions | ||||
| 	* @param[in] fps : current screen refresh rate | ||||
| @ -149,7 +143,7 @@ private: | ||||
|  	* @brief display a singular invader | ||||
| 	* @param[in] basePos : invader's pixel coordinates | ||||
| 	* @param[in] type : invader's type | ||||
| 	* @fn void displayInvader(const Position& basePos, InvaderType type) const  | ||||
| 	* @fn void displayInvader(const Position& baseInvPos, InvaderType type) const | ||||
|  	*/ | ||||
| 	void displayInvader(const Position& basePos, InvaderType type) const; | ||||
| 	 | ||||
| @ -163,14 +157,14 @@ private: | ||||
| 	// managers
 | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief Calls the function 'ManageOnePlayer' for all players in player list  | ||||
|  	* @brief Calls the function 'manageOnePlayer' for all players in player list | ||||
| 	* @fn void managePlayers();  | ||||
|  	*/ | ||||
| 	void managePlayers(); | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief Handles a player keystrokes, makes them move or make them shoot a torpedo | ||||
| 	* @param[in] pID : Player id | ||||
|  	* @brief Handles a player keystrokes, makes them move and shoot a torpedo | ||||
| 	* @param[in] pID : Player id to manage | ||||
| 	* @fn void manageOnePlayer(playerID pID);  | ||||
|  	*/ | ||||
| 	void manageOnePlayer(playerID pID); | ||||
| @ -210,14 +204,14 @@ private: | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief check if a torpedo collides with an invader | ||||
| 	* @return true if there is a collision, false elsewise | ||||
| 	* @return true if there is a collision, false otherwise | ||||
| 	* @fn bool checkTorpedosAndInvaders();  | ||||
|  	*/ | ||||
| 	bool checkTorpedosAndInvaders(); | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief check if the invaders have reach the players | ||||
| 	* @return true if they have reach the player, false elsewise | ||||
|  	* @brief check if the invaders have reached the players | ||||
| 	* @return true if they have reached the player, false otherwise | ||||
| 	* @fn bool invadersTouchPlayer() const; | ||||
|  	*/ | ||||
| 	bool invadersTouchPlayer() const; | ||||
| @ -230,7 +224,7 @@ private: | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief make god behave | ||||
| 	* @return true if theres no invader left, false elsewise | ||||
| 	* @return true if theres no invader left, false otherwise | ||||
| 	* @fn bool manageGod(); | ||||
|  	*/ | ||||
| 	bool manageGod(); | ||||
| @ -257,15 +251,15 @@ public: | ||||
| 	void initGame(); | ||||
| 
 | ||||
| 	/*!
 | ||||
|  	* @brief enter the main gameplay game loop | ||||
|  	* @brief enter the main gameplay game loop. Will block until the game ends | ||||
| 	* @return the value of the winners can be the players, the invaders or god  | ||||
| 	* @fn WinValue enterGameLoop();  | ||||
|  	*/ | ||||
| 	WinValue enterGameLoop(); | ||||
| 
 | ||||
| 	/*!
 | ||||
|  	* @brief reload the configuration file for a new game | ||||
| 	* @return false if an error occured, true elsewise | ||||
|  	* @brief reload the configuration file (not dynamically used currently, but it was planned to be) | ||||
| 	* @return false if an error occurred, true otherwise | ||||
| 	* @fn bool reloadConfig(); | ||||
|  	*/ | ||||
| 	bool reloadConfig(); | ||||
|  | ||||
| @ -53,7 +53,7 @@ public: | ||||
| 	GodState state; | ||||
| 	 | ||||
| 	/*!
 | ||||
|  	* @brief manage all sorts of things, gods secrets remains unknown | ||||
|  	* @brief timer used differently in all states | ||||
|  	*/ | ||||
| 	unsigned counter; | ||||
| 
 | ||||
|  | ||||
| @ -32,11 +32,9 @@ enum class InvaderType { | ||||
|  */ | ||||
| class InvadersColumn : public vector<InvaderType>{ | ||||
| public: | ||||
| 	// idk why CLion says this is not implemented, but it is
 | ||||
| 	 | ||||
| 	/*!
 | ||||
| 	 * @brief tells if the column contains no non type NONE invader | ||||
| 	 * @return True if there's only type NONE invader, False elsewise | ||||
| 	 * @return True if there's only type NONE invader, False otherwise | ||||
| 	 * @fn bool hasNoValid() const;  | ||||
| 	 */ | ||||
| 	bool hasNoValid() const; | ||||
|  | ||||
| @ -20,8 +20,8 @@ void Game::displayAll(unsigned fps) const { | ||||
| 	for (unsigned i = 0; i < this->grid.size(); ++i){ | ||||
| 		for (unsigned j = 0; j < this->grid[i].size(); ++j){ | ||||
| 			Position vec( | ||||
| 					basePos.getX() + i * confData.invadersSize + i * confData.invadersDistance, | ||||
| 					basePos.getY() + j * confData.invadersSize + j * confData.invadersDistance | ||||
| 					baseInvPos.getX() + i * confData.invadersSize + i * confData.invadersDistance, | ||||
| 					baseInvPos.getY() + j * confData.invadersSize + j * confData.invadersDistance | ||||
| 			); | ||||
| 			displayInvader(vec, grid[i][j]); | ||||
| 		} | ||||
| @ -36,13 +36,17 @@ void Game::displayAll(unsigned fps) const { | ||||
| 
 | ||||
| 	 | ||||
| 	displayGod(); | ||||
| 	displayScore(); | ||||
| 
 | ||||
| 	DEBUG_INSTR( | ||||
| 		pm->drawText(Position(pm->getScreenWidth()-200, 20), "FPS : "+to_string(fps), nsGraphics::KWhite, Font::BITMAP_8_BY_13); | ||||
| 	) | ||||
| 
 | ||||
| 	unsigned margin = 0; | ||||
| 	for(unsigned i=0;i<players.size();++i){ | ||||
| 		pm->drawText(Position(0,10+margin),"player "+to_string(i+1)+" :",nsGraphics::KWhite,Font::BITMAP_8_BY_13); | ||||
| 		pm->drawText(Position(100,10+margin),to_string(players[i].score) ,nsGraphics::KWhite,Font::BITMAP_8_BY_13); | ||||
| 		margin +=15; | ||||
| 
 | ||||
| 		if(!players[i].isEliminated()){ | ||||
| 			if(players[i].deathAnimCounter%2==0){ | ||||
| 				pm->drawPlayer(players[i].x, confData.playersWidth, confData.playerDefs[i].color); | ||||
| @ -70,17 +74,6 @@ void Game::displayHearts(playerID pID) const { | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| void Game::displayScore() const{ | ||||
| 	unsigned margin = 0; | ||||
| 	unsigned playerNumber = 1; | ||||
| 	for (auto& player: players){ | ||||
| 		pm->drawText(Position(0,10+margin),"player "+to_string(playerNumber)+" :",nsGraphics::KWhite,Font::BITMAP_8_BY_13); | ||||
| 		pm->drawText(Position(100,10+margin),to_string(player.score) ,nsGraphics::KWhite,Font::BITMAP_8_BY_13); | ||||
| 		++playerNumber; | ||||
| 		margin +=15; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| void Game::displayInvader(const Position& pos, InvaderType type) const { | ||||
| 	if(type==InvaderType::NONE)return; | ||||
| 	const InvaderTypeDef& invDef = confData.invadersDef.at(type); | ||||
|  | ||||
| @ -104,7 +104,7 @@ void Game::initGame(){ | ||||
| 		players[i].lives = confData.playersLives; | ||||
| 	} | ||||
| 
 | ||||
| 	basePos = Position(200, 0); | ||||
| 	baseInvPos = Position(200, 0); | ||||
| 	direction = true; | ||||
| 
 | ||||
| } | ||||
| @ -169,7 +169,7 @@ WinValue Game::enterGameLoop(){ // returns when game is finished | ||||
| } | ||||
| 
 | ||||
| Position Game::invIndexToPos(unsigned x, unsigned y) const { | ||||
| 	return basePos+Position(INV_GET_SINGLE_POS(x), INV_GET_SINGLE_POS(y)); | ||||
| 	return baseInvPos + Position(INV_GET_SINGLE_POS(x), INV_GET_SINGLE_POS(y)); | ||||
| } | ||||
| 
 | ||||
| bool Game::arePlayersDead() { | ||||
|  | ||||
| @ -55,7 +55,7 @@ bool Game::manageInvaders(){ | ||||
| 
 | ||||
| 		unsigned rdCol = grid.randomValidCol(); | ||||
| 		// fire !
 | ||||
| 		missiles.push_back(basePos + Position( | ||||
| 		missiles.push_back(baseInvPos + Position( | ||||
| 				confData.invadersSize * rdCol + confData.invadersDistance * (rdCol + 0.5), | ||||
| 				confData.invadersSize * (grid[rdCol].size() - 1) + confData.invadersDistance * (grid[rdCol].size() - 1) | ||||
| 		)); | ||||
| @ -63,7 +63,7 @@ bool Game::manageInvaders(){ | ||||
| 
 | ||||
| 	 | ||||
| 	if(direction){ // go to the right
 | ||||
| 		int end = basePos.getX(); // start Position
 | ||||
| 		int end = baseInvPos.getX(); // start Position
 | ||||
| 		end+= grid.size() * confData.invadersSize; // add the invaders
 | ||||
| 		end+= (grid.size()-1) * confData.invadersDistance; // add the invadersDistance between invaders
 | ||||
| 		// you got the end position of the invader crowd !
 | ||||
| @ -75,26 +75,26 @@ bool Game::manageInvaders(){ | ||||
| 		} | ||||
| 
 | ||||
| 		if(end + confData.invadersSpeed < pm->getScreenWidth()){ | ||||
| 			basePos.setX(basePos.getX() + confData.invadersSpeed); | ||||
| 			baseInvPos.setX(baseInvPos.getX() + confData.invadersSpeed); | ||||
| 		} | ||||
| 		else{ | ||||
| 			basePos.setY(basePos.getY() + confData.invadersSize + confData.invadersDistance); | ||||
| 			baseInvPos.setY(baseInvPos.getY() + confData.invadersSize + confData.invadersDistance); | ||||
| 			direction = !direction; | ||||
| 			return true; | ||||
| 		} | ||||
| 	} | ||||
| 	else{ | ||||
| 		size_t i = 0; | ||||
| 		unsigned relativeBasePos = basePos.getX(); | ||||
| 		unsigned relativeBasePos = baseInvPos.getX(); | ||||
| 		while (grid[i].hasNoValid()){ | ||||
| 			relativeBasePos += confData.invadersSize + confData.invadersDistance; | ||||
| 			++i; | ||||
| 		} | ||||
| 
 | ||||
| 		if(relativeBasePos >= confData.invadersSpeed){ | ||||
| 			basePos.setX(basePos.getX() - confData.invadersSpeed); | ||||
| 			baseInvPos.setX(baseInvPos.getX() - confData.invadersSpeed); | ||||
| 		}else{ | ||||
| 			basePos.setY(basePos.getY() + confData.invadersSize + confData.invadersDistance); | ||||
| 			baseInvPos.setY(baseInvPos.getY() + confData.invadersSize + confData.invadersDistance); | ||||
| 			direction = !direction; | ||||
| 			return true; | ||||
| 		} | ||||
| @ -186,7 +186,7 @@ bool Game::checkTorpedosAndInvaders() { | ||||
| 			unsigned alienIndex = grid[i].getOutterInvader(); | ||||
| 			if(alienIndex==grid[i].size())continue; | ||||
| 			// calculate top-left Position of invader
 | ||||
| 			Position pos = basePos + Position( | ||||
| 			Position pos = baseInvPos + Position( | ||||
| 					confData.invadersSize*i+confData.invadersDistance*i, | ||||
| 					confData.invadersSize*alienIndex+confData.invadersDistance*alienIndex | ||||
| 			); | ||||
| @ -218,7 +218,7 @@ bool Game::checkTorpedosAndInvaders() { | ||||
| bool Game::invadersTouchPlayer() const { | ||||
| 	return any_of(grid.begin(), grid.end(), [this](const InvadersColumn& line) -> bool { | ||||
| 		unsigned outter = line.getOutterInvader(); | ||||
| 		return this->basePos.getY()+confData.invadersSize*(outter+1) | ||||
| 		return this->baseInvPos.getY() + confData.invadersSize * (outter + 1) | ||||
| 			   +confData.invadersDistance*outter | ||||
| 			>= pm->getScreenHeight() - PLAYER_HEIGHT; | ||||
| 	}); | ||||
|  | ||||
| @ -11,7 +11,7 @@ | ||||
| #include "game.h" | ||||
| 
 | ||||
| void Game::tryAwakeGod() { | ||||
| 	if (basePos.getY() > 100 /*lambda value*/ && god.state==GodState::NONE) { | ||||
| 	if (baseInvPos.getY() > 100 /*lambda value*/ && god.state == GodState::NONE) { | ||||
| 		god.counter = 0; | ||||
| 		god.state = GodState::AWAKE; | ||||
| 	} | ||||
| @ -50,7 +50,7 @@ bool Game::manageGod() { | ||||
| 			god.thrownInvType = InvaderType::NONE; | ||||
| 
 | ||||
| 			god.thrownTransition.setX(pm->getScreenWidth() - GOD_HAND_DISTANCE - GOD_HAND_SIZE); | ||||
| 			god.thrownTransition.setY(basePos.getY() + INV_GET_SINGLE_POS(god.thrownInvPosY)); | ||||
| 			god.thrownTransition.setY(baseInvPos.getY() + INV_GET_SINGLE_POS(god.thrownInvPosY)); | ||||
| 			return false; | ||||
| 		} | ||||
| 		case GodState::RETRIEVE1: { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user