490 lines
23 KiB
HTML
Executable file
490 lines
23 KiB
HTML
Executable file
<!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"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.110 Software Development/Coursework/C/unr-Moon Lander/source/moonlander.c File Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">SCC.150 Assembler Emulator
|
|
</div>
|
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.6 -->
|
|
<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 Page</span></a></li>
|
|
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
|
<li class="current"><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="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>Globals</span></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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</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>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">moonlander.c File Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><code>#include "<a class="el" href="moonlander_8h_source.html">moonlander.h</a>"</code><br/>
|
|
</div><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
|
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a62c7d9da80c36528a8de3186d31d7ed8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#a62c7d9da80c36528a8de3186d31d7ed8">initialisencurses</a> ()</td></tr>
|
|
<tr class="separator:a62c7d9da80c36528a8de3186d31d7ed8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae0dc18298c3a72665f84d0904bc9d287"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#ae0dc18298c3a72665f84d0904bc9d287">initialiseShip</a> (<a class="el" href="struct__WIN__ship__struct.html">SHIP</a> *ship)</td></tr>
|
|
<tr class="separator:ae0dc18298c3a72665f84d0904bc9d287"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0ec45fe851ecdae5b09ff1f5235e2bf4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#a0ec45fe851ecdae5b09ff1f5235e2bf4">initialiseLandscape</a> (<a class="el" href="struct__WIN__landscape__struct.html">LANDSCAPE</a> *landscape)</td></tr>
|
|
<tr class="separator:a0ec45fe851ecdae5b09ff1f5235e2bf4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab7d9f8adcb580459033133fd49433a15"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#ab7d9f8adcb580459033133fd49433a15">createShip</a> (<a class="el" href="struct__WIN__ship__struct.html">SHIP</a> *ship)</td></tr>
|
|
<tr class="separator:ab7d9f8adcb580459033133fd49433a15"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2950dcda46229b12b3cd841832ed4a49"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#a2950dcda46229b12b3cd841832ed4a49">createLandscape</a> (<a class="el" href="struct__WIN__landscape__struct.html">LANDSCAPE</a> *landscape, unsigned int landscapeArray[], unsigned int safeArray[])</td></tr>
|
|
<tr class="separator:a2950dcda46229b12b3cd841832ed4a49"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8e5dee243eed13bb193a327212d1460b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#a8e5dee243eed13bb193a327212d1460b">applyJet</a> (<a class="el" href="struct__WIN__ship__struct.html">SHIP</a> *ship, unsigned int dir)</td></tr>
|
|
<tr class="separator:a8e5dee243eed13bb193a327212d1460b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a80d87b5874771eee0d24be7daa6cd187"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#a80d87b5874771eee0d24be7daa6cd187">applyGravity</a> (<a class="el" href="struct__WIN__ship__struct.html">SHIP</a> *ship)</td></tr>
|
|
<tr class="separator:a80d87b5874771eee0d24be7daa6cd187"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac6ac9217888e84291c290db745b67ce1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#ac6ac9217888e84291c290db745b67ce1">applyFriction</a> (<a class="el" href="struct__WIN__ship__struct.html">SHIP</a> *ship)</td></tr>
|
|
<tr class="separator:ac6ac9217888e84291c290db745b67ce1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a58ccd08e3de9a09607a7e15852f114b7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#a58ccd08e3de9a09607a7e15852f114b7">moveShip</a> (<a class="el" href="struct__WIN__ship__struct.html">SHIP</a> *ship, size_t lASize, unsigned int landscapeArray[], size_t sASize, unsigned int safeArray[])</td></tr>
|
|
<tr class="separator:a58ccd08e3de9a09607a7e15852f114b7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:abdd6a4d14501287a577ea668c521ef6b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#abdd6a4d14501287a577ea668c521ef6b">displayIntro</a> ()</td></tr>
|
|
<tr class="separator:abdd6a4d14501287a577ea668c521ef6b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a17d060768350e07c2f3d98b7d01cd0b6"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="moonlander_8c.html#a17d060768350e07c2f3d98b7d01cd0b6">getScore</a> (<a class="el" href="struct__WIN__ship__struct.html">SHIP</a> *ship, unsigned int time)</td></tr>
|
|
<tr class="separator:a17d060768350e07c2f3d98b7d01cd0b6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Ben Goldsworthy (rumps) <a href="#" onclick="location.href='mai'+'lto:'+'bgo'+'ld'+'swo'+'rt'+'hy9'+'6@'+'gma'+'il'+'.co'+'m'; return false;">bgold<span style="display: none;">.nosp@m.</span>swor<span style="display: none;">.nosp@m.</span>thy96<span style="display: none;">.nosp@m.</span>@gma<span style="display: none;">.nosp@m.</span>il.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
|
|
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
|
|
<h1><a class="anchor" id="LICENSE"></a>
|
|
LICENSE</h1>
|
|
<p>This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
|
|
<p>This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
|
|
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
|
|
<h1><a class="anchor" id="DESCRIPTION"></a>
|
|
DESCRIPTION</h1>
|
|
<p>This program attempts to emulate the 1979 Atari arcade classic 'Lunar Lander' in the *nix Terminal, using the ncurses library <a href="https://www.gnu.org/software/ncurses/ncurses.html">https://www.gnu.org/software/ncurses/ncurses.html</a>. This can seemingly only be because Joe Finney is sadistic.</p>
|
|
<p>Implemented features so far are:</p>
|
|
<ul>
|
|
<li>momentum & gravity</li>
|
|
<li>random landscape generation</li>
|
|
<li>crashing & (rarely) landing</li>
|
|
<li>cheats</li>
|
|
</ul>
|
|
<p>Features to implement by TOMORROW are:</p>
|
|
<ul>
|
|
<li>more cheats (or 'debug modes' as all the kids are calling them these days)</li>
|
|
<li>scoring</li>
|
|
<li>leaderboards</li>
|
|
<li>random gravity generation </li>
|
|
</ul>
|
|
</div><h2 class="groupheader">Function Documentation</h2>
|
|
<a class="anchor" id="ac6ac9217888e84291c290db745b67ce1"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void applyFriction </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__ship__struct.html">SHIP</a> * </td>
|
|
<td class="paramname"><em>ship</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Applies the equally relentless force of friction to the ship.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ship</td><td>the ship in question </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a80d87b5874771eee0d24be7daa6cd187"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void applyGravity </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__ship__struct.html">SHIP</a> * </td>
|
|
<td class="paramname"><em>ship</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Applies the relentless march of gravity to the ship.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ship</td><td>the ship in question </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a8e5dee243eed13bb193a327212d1460b"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void applyJet </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__ship__struct.html">SHIP</a> * </td>
|
|
<td class="paramname"><em>ship</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>dir</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Applies the thrust of the jet to the ship.</p>
|
|
<p>If the ship is out of fuel, the jets won't fire.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ship</td><td>the ship in question </td></tr>
|
|
<tr><td class="paramname">dir</td><td>the thrust direction </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a2950dcda46229b12b3cd841832ed4a49"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool createLandscape </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__landscape__struct.html">LANDSCAPE</a> * </td>
|
|
<td class="paramname"><em>landscape</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>landscapeArray</em>[], </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>safeArray</em>[] </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Creates the landscape in the game world.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">landscape</td><td>the landscape in question </td></tr>
|
|
<tr><td class="paramname">landscapeArray[]</td><td>the array of all the coordinates of the landscape components </td></tr>
|
|
<tr><td class="paramname">safeArray[]</td><td>the array of all the coordinates of the landing pad components </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>true if the landscape is valid (has at least one landing pad), false if not </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ab7d9f8adcb580459033133fd49433a15"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void createShip </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__ship__struct.html">SHIP</a> * </td>
|
|
<td class="paramname"><em>ship</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Creates the ship in the game world.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ship</td><td>the ship in question </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="abdd6a4d14501287a577ea668c521ef6b"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void displayIntro </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Displays the lovely ASCII lunar lander I nicked. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a17d060768350e07c2f3d98b7d01cd0b6"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double getScore </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__ship__struct.html">SHIP</a> * </td>
|
|
<td class="paramname"><em>ship</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>time</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Works out the player's score upon successful landing.</p>
|
|
<p>The specification states "score is calculated using some heuristic based on
|
|
time used and fuel remaining." Heuristic sounds fancy, and so is the method of working out the score.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ship</td><td>the ship in question </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>the score </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a0ec45fe851ecdae5b09ff1f5235e2bf4"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void initialiseLandscape </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__landscape__struct.html">LANDSCAPE</a> * </td>
|
|
<td class="paramname"><em>landscape</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Initialises the landscape's parameters.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">landscape</td><td>the landscape in question </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a62c7d9da80c36528a8de3186d31d7ed8"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void initialisencurses </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Initialises ncurses.</p>
|
|
<p>I couldn't decide whether it should be <code><a class="el" href="moonlander_8c.html#a62c7d9da80c36528a8de3186d31d7ed8">initialisencurses()</a></code>, <code>initialiseNCURSES()</code> or <code>initialiseNcurses()</code>. In the end I plumped for <code><a class="el" href="moonlander_8c.html#a62c7d9da80c36528a8de3186d31d7ed8">initialisencurses()</a></code> because, whilst it does break the camelCase rule I've used throughout for variables and functions, ncurses is one of those trendy uncapitalised names. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ae0dc18298c3a72665f84d0904bc9d287"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void initialiseShip </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__ship__struct.html">SHIP</a> * </td>
|
|
<td class="paramname"><em>ship</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Initialises the ship's parameters.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ship</td><td>the ship in question </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int main </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>The main function of the program.</p>
|
|
<p>Sets everything up initially, and then contains the game loop.</p>
|
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a58ccd08e3de9a09607a7e15852f114b7"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void moveShip </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="struct__WIN__ship__struct.html">SHIP</a> * </td>
|
|
<td class="paramname"><em>ship</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>lASize</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>landscapeArray</em>[], </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>sASize</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>safeArray</em>[] </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Moves the ship within the game world.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">ship</td><td>the ship in question </td></tr>
|
|
<tr><td class="paramname">lASize</td><td>the length of useful data in <code>landscapeArray</code> </td></tr>
|
|
<tr><td class="paramname">landscapeArray</td><td>the array of coordinates for the components of the landscape </td></tr>
|
|
<tr><td class="paramname">sASize</td><td>the length of useful data in <code>safeArray</code> </td></tr>
|
|
<tr><td class="paramname">safeArray</td><td>the array of coordinates for the components of the landing pad(s) </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Tue May 19 2015 20:33:41 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.6
|
|
</small></address>
|
|
</body>
|
|
</html>
|