mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-04 02:36:31 +00:00
140 lines
6.5 KiB
HTML
140 lines
6.5 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Bomberman: Bot documentation</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/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></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 id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Bomberman
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.17 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</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><!-- top -->
|
|
<div class="PageDoc"><div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">Bot documentation </div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p>A bot in this bomberman is using a lua script as way to choose what to do So you can make your own with some helper functions given from C++</p>
|
|
<h1><a class="anchor" id="autotoc_md1"></a>
|
|
Update function</h1>
|
|
<p>Each frame, the game will call the "Update" function in the script. This is the same lua state as the last call so this means you can set global variables to keep data between frames</p>
|
|
<p>Update function should take no arguments.</p>
|
|
<h1><a class="anchor" id="autotoc_md2"></a>
|
|
Map Blocks</h1>
|
|
<div class="fragment"><div class="line">nothing = 0</div>
|
|
<div class="line">breakable = 1</div>
|
|
<div class="line">hole = 2</div>
|
|
<div class="line">bumper = 4</div>
|
|
<div class="line">unbreakable = 7</div>
|
|
<div class="line">bomb = 10</div>
|
|
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md3"></a>
|
|
Registered functions</h1>
|
|
<div class="fragment"><div class="line">-- getMap returns a table of the blocks of the map</div>
|
|
<div class="line">-- From 1 to 17 {{0, 1, 2 ..}, ..}</div>
|
|
<div class="line">function getMap();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getDanger returns a table of the danger zone on the map</div>
|
|
<div class="line">-- From 1 to 17 {{0, 1, 2 ..}, ..}</div>
|
|
<div class="line">-- value is number of seconds before explosion</div>
|
|
<div class="line">function getDanger();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getPath returns a table of nodes of a path from A to B {{x = X, y = Y}, ...}</div>
|
|
<div class="line">-- @param x1 should be int</div>
|
|
<div class="line">-- @param y1 should be int</div>
|
|
<div class="line">-- @param x2 should be int</div>
|
|
<div class="line">-- @param y2 should be int</div>
|
|
<div class="line">-- @param throughBreakable bool path is going through breakables blocks or not</div>
|
|
<div class="line">function getPath(x1, y1, x2, y2, throughBreakable);</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getPlayer returns player pos as {x = xPlayer, y = yPlayer}</div>
|
|
<div class="line">function getPlayer();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getPlayerRound returns player pos with rounded value {x = xPlayer, y = yPlayer}</div>
|
|
<div class="line">function getPlayerRound();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getDangerLevel returns danger level at [xpos, ypos]</div>
|
|
<div class="line">function getDangerLevel(xpos, ypos);</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getDangerLevelPlayer get danger level on the position of the player</div>
|
|
<div class="line">function getDangerLevelPlayer();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getBlockType returns block type at [xpos, ypos]</div>
|
|
<div class="line">function getBlockType(xpos, ypos);</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getClosestSafeSpace returns the block next to player where the player should go to to the closest safe space</div>
|
|
<div class="line">-- returns player pos if no path is found</div>
|
|
<div class="line">function getClosestSafeSpace();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- canPutBombSafe returns true if player can put a bomb and find a path to safe space if bomb is put</div>
|
|
<div class="line">function canPutBombSafe();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getRadius returns the explosion radius of the current player</div>
|
|
<div class="line">function getRadius();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getEnemies returns a table with enemies position {{x = X, y = Y}, ...}</div>
|
|
<div class="line">function getEnemies();</div>
|
|
<div class="line"> </div>
|
|
<div class="line">-- getEnemies returns a table with enemies position rounded {{x = X, y = Y}, ...}</div>
|
|
<div class="line">function getEnemiesRound();</div>
|
|
</div><!-- fragment --> </div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|