diff options
Diffstat (limited to 'html/tower/docs/module-path.html')
-rw-r--r-- | html/tower/docs/module-path.html | 531 |
1 files changed, 531 insertions, 0 deletions
diff --git a/html/tower/docs/module-path.html b/html/tower/docs/module-path.html new file mode 100644 index 0000000..42b3180 --- /dev/null +++ b/html/tower/docs/module-path.html @@ -0,0 +1,531 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Module: path</title> + + <script src="scripts/prettify/prettify.js"> </script> + <script src="scripts/prettify/lang-css.js"> </script> + <!--[if lt IE 9]> + <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> + <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> +</head> + +<body> + +<div id="main"> + + <h1 class="page-title">Module: path</h1> + + + + + + +<section> + +<header> + + + + + +</header> + +<article> + <div class="container-overview"> + + + <div class="description">Path Generation Module + +This module demonstrates several advanced game development concepts: +1. Procedural Content Generation (PCG) +2. Pathfinding algorithms +3. Constraint-based generation</div> + + + + + + + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="path.js.html">path.js</a>, <a href="path.js.html#line1">line 1</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + </div> + + + + + + + + + + + + + + + + + <h3 class="subsection-title">Methods</h3> + + + + + + + + <h4 class="name" id="~generatePath"><span class="type-signature">(inner) </span>generatePath<span class="signature">(grid)</span><span class="type-signature"> → {Promise.<Array.<{x: number, y: number}>>}</span></h4> + + + + + + +<div class="description"> + Generates a valid path through the game grid using a modified depth-first search. +This algorithm ensures: +- Path always moves from left to right +- No diagonal movements +- No path segments touch each other (except at turns) +- Path is always completable +</div> + + + + + + + + + + <h5>Parameters:</h5> + + +<table class="params"> + <thead> + <tr> + + <th>Name</th> + + + <th>Type</th> + + + + + + <th class="last">Description</th> + </tr> + </thead> + + <tbody> + + + <tr> + + <td class="name"><code>grid</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Array.<string>></span> + + + + </td> + + + + + + <td class="description last">2D array representing the game grid</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="path.js.html">path.js</a>, <a href="path.js.html#line28">line 28</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + Promise resolving to array of path coordinates + +Implementation uses: +- Backtracking algorithm pattern +- Constraint satisfaction +- Random selection for variety +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Promise.<Array.<{x: number, y: number}>></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="~getPathPosition"><span class="type-signature">(inner) </span>getPathPosition<span class="signature">(progress, path)</span><span class="type-signature"> → {Object}</span></h4> + + + + + + +<div class="description"> + Calculates a position along the path based on a progress value +Implements smooth entity movement along path segments +</div> + + + + + + + + + + <h5>Parameters:</h5> + + +<table class="params"> + <thead> + <tr> + + <th>Name</th> + + + <th>Type</th> + + + + + + <th class="last">Description</th> + </tr> + </thead> + + <tbody> + + + <tr> + + <td class="name"><code>progress</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Progress along path (0-1)</td> + </tr> + + + + <tr> + + <td class="name"><code>path</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<{x: number, y: number}></span> + + + + </td> + + + + + + <td class="description last">Array of path coordinates</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="path.js.html">path.js</a>, <a href="path.js.html#line140">line 140</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + Interpolated position along path + +Uses: +- Linear interpolation (lerp) +- Path segment traversal +- Normalized progress tracking +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Object</span> + + + </dd> +</dl> + + + + + + + + + + + + + +</article> + +</section> + + + + +</div> + +<nav> + <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-game.html">game</a></li><li><a href="module-gameState.html">gameState</a></li><li><a href="module-mechanics.html">mechanics</a></li><li><a href="module-path.html">path</a></li><li><a href="module-renderer.html">renderer</a></li><li><a href="module-uiHandlers.html">uiHandlers</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a> on Mon Feb 17 2025 09:19:19 GMT-0500 (Eastern Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> \ No newline at end of file |