diff options
Diffstat (limited to 'html/tower/docs/global.html')
-rw-r--r-- | html/tower/docs/global.html | 3447 |
1 files changed, 3447 insertions, 0 deletions
diff --git a/html/tower/docs/global.html b/html/tower/docs/global.html new file mode 100644 index 0000000..d21546f --- /dev/null +++ b/html/tower/docs/global.html @@ -0,0 +1,3447 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Global</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">Global</h1> + + + + + + +<section> + +<header> + + <h2></h2> + + +</header> + +<article> + <div class="container-overview"> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</dl> + + + + + </div> + + + + + + + + + + + + + + + + + <h3 class="subsection-title">Methods</h3> + + + + + + + + <h4 class="name" id="createDeathParticles"><span class="type-signature"></span>createDeathParticles<span class="signature">(target, cellSize)</span><span class="type-signature"> → {Array.<Object>}</span></h4> + + + + + + +<div class="description"> + Creates death effect particles for defeated entities +Implements visual feedback system +</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>target</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">The defeated entity</td> + </tr> + + + + <tr> + + <td class="name"><code>cellSize</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Size of grid cell for scaling</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line149">line 149</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + Array of particle objects +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Array.<Object></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="findTowersInRange"><span class="type-signature"></span>findTowersInRange<span class="signature">(enemy, towers)</span><span class="type-signature"> → {Array.<Object>}</span></h4> + + + + + + +<div class="description"> + Finds towers within enemy attack range +Implements targeting system for enemies +</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>enemy</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Enemy doing the targeting</td> + </tr> + + + + <tr> + + <td class="name"><code>towers</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of potential tower targets</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line304">line 304</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + Array of towers in range +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Array.<Object></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="generatePath"><span class="type-signature"></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#line26">line 26</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"></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#line138">line 138</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> + + + + + + + + + + + + + + <h4 class="name" id="handleAOEEffect"><span class="type-signature"></span>handleAOEEffect<span class="signature">(target, tower, enemies, particles, cellSize)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Handles AOE (Area of Effect) damage and visual effects +Implements area damage system +</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>target</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Primary target</td> + </tr> + + + + <tr> + + <td class="name"><code>tower</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Tower dealing AOE damage</td> + </tr> + + + + <tr> + + <td class="name"><code>enemies</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">All enemies for AOE calculation</td> + </tr> + + + + <tr> + + <td class="name"><code>particles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Particle array for effects</td> + </tr> + + + + <tr> + + <td class="name"><code>cellSize</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Grid cell size</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line399">line 399</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="handleEnemyAttack"><span class="type-signature"></span>handleEnemyAttack<span class="signature">(enemy, tower, particles, timestamp, cellSize)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Handles enemy attack execution and effects +Implements enemy combat mechanics +</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>enemy</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Attacking enemy</td> + </tr> + + + + <tr> + + <td class="name"><code>tower</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Target tower</td> + </tr> + + + + <tr> + + <td class="name"><code>particles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Particle array for effects</td> + </tr> + + + + <tr> + + <td class="name"><code>timestamp</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Current game timestamp</td> + </tr> + + + + <tr> + + <td class="name"><code>cellSize</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Grid cell size</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line322">line 322</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="handleSlowEffect"><span class="type-signature"></span>handleSlowEffect<span class="signature">(target, tower, timestamp, particles, cellSize)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Handles slow effect application and stacking +Implements status effect system +</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>target</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Enemy to apply slow to</td> + </tr> + + + + <tr> + + <td class="name"><code>tower</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Tower applying the effect</td> + </tr> + + + + <tr> + + <td class="name"><code>timestamp</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Current game timestamp</td> + </tr> + + + + <tr> + + <td class="name"><code>particles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Particle array for effects</td> + </tr> + + + + <tr> + + <td class="name"><code>cellSize</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Grid cell size</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line358">line 358</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="handleTowerAttack"><span class="type-signature"></span>handleTowerAttack<span class="signature">(tower, target, projectiles, particles, timestamp, cellSize)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Handles individual tower attack logic including special effects +Implements tower ability system +</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>tower</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Attacking tower</td> + </tr> + + + + <tr> + + <td class="name"><code>target</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Target enemy</td> + </tr> + + + + <tr> + + <td class="name"><code>projectiles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Projectile array</td> + </tr> + + + + <tr> + + <td class="name"><code>particles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Particle array</td> + </tr> + + + + <tr> + + <td class="name"><code>timestamp</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Current game timestamp</td> + </tr> + + + + <tr> + + <td class="name"><code>cellSize</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Grid cell size</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line244">line 244</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="initializeDragAndDrop"><span class="type-signature"></span>initializeDragAndDrop<span class="signature">(canvas, gameState)</span><span class="type-signature"> → {Object}</span></h4> + + + + + + +<div class="description"> + Initializes drag and drop functionality for tower placement +Implements HTML5 Drag and Drop API +</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>canvas</code></td> + + + <td class="type"> + + +<span class="param-type">HTMLCanvasElement</span> + + + + </td> + + + + + + <td class="description last">Game canvas element</td> + </tr> + + + + <tr> + + <td class="name"><code>gameState</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Current game state</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="uiHandlers.js.html">uiHandlers.js</a>, <a href="uiHandlers.js.html#line20">line 20</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + Drag handlers and state information +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Object</span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="placeTower"><span class="type-signature"></span>placeTower<span class="signature">(gameState, towerType, position)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Places a tower in the game grid +Implements tower placement validation and state updates +</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>gameState</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Current game state</td> + </tr> + + + + <tr> + + <td class="name"><code>towerType</code></td> + + + <td class="type"> + + +<span class="param-type">string</span> + + + + </td> + + + + + + <td class="description last">Type of tower to place</td> + </tr> + + + + <tr> + + <td class="name"><code>position</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Grid position for placement</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="uiHandlers.js.html">uiHandlers.js</a>, <a href="uiHandlers.js.html#line84">line 84</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="processEnemyAttacks"><span class="type-signature"></span>processEnemyAttacks<span class="signature">(enemies, towers, particles, timestamp, cellSize)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Processes enemy attack behaviors and targeting +Implements enemy combat AI +</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>enemies</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of enemy objects</td> + </tr> + + + + <tr> + + <td class="name"><code>towers</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of tower objects</td> + </tr> + + + + <tr> + + <td class="name"><code>particles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Particle effect array</td> + </tr> + + + + <tr> + + <td class="name"><code>timestamp</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Current game timestamp</td> + </tr> + + + + <tr> + + <td class="name"><code>cellSize</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Grid cell size</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line281">line 281</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="processTowerAttacks"><span class="type-signature"></span>processTowerAttacks<span class="signature">(towers, enemies, projectiles, particles, timestamp, cellSize)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Processes tower attacks and targeting +Implements combat mechanics and special abilities +</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>towers</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of tower objects</td> + </tr> + + + + <tr> + + <td class="name"><code>enemies</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of enemy objects</td> + </tr> + + + + <tr> + + <td class="name"><code>projectiles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of projectile objects</td> + </tr> + + + + <tr> + + <td class="name"><code>particles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of particle objects</td> + </tr> + + + + <tr> + + <td class="name"><code>timestamp</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Current game timestamp</td> + </tr> + + + + <tr> + + <td class="name"><code>cellSize</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Size of grid cell for scaling</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line188">line 188</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="renderEnemies"><span class="type-signature"></span>renderEnemies<span class="signature">(ctx, enemies)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Renders all enemies with health indicators and effects +Implements visual state representation +</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>ctx</code></td> + + + <td class="type"> + + +<span class="param-type">CanvasRenderingContext2D</span> + + + + </td> + + + + + + <td class="description last">Canvas rendering context</td> + </tr> + + + + <tr> + + <td class="name"><code>enemies</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of enemy objects</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="renderer.js.html">renderer.js</a>, <a href="renderer.js.html#line86">line 86</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="renderGrid"><span class="type-signature"></span>renderGrid<span class="signature">(ctx, grid)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Renders the game grid with path and hover previews +Implements visual feedback for player actions +</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>ctx</code></td> + + + <td class="type"> + + +<span class="param-type">CanvasRenderingContext2D</span> + + + + </td> + + + + + + <td class="description last">Canvas rendering context</td> + </tr> + + + + <tr> + + <td class="name"><code>grid</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Array.<string>></span> + + + + </td> + + + + + + <td class="description last">Game grid state</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="renderer.js.html">renderer.js</a>, <a href="renderer.js.html#line19">line 19</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="renderUI"><span class="type-signature"></span>renderUI<span class="signature">(ctx, gameState)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + Renders game UI elements with clean state management +Implements heads-up display (HUD) pattern +</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>ctx</code></td> + + + <td class="type"> + + +<span class="param-type">CanvasRenderingContext2D</span> + + + + </td> + + + + + + <td class="description last">Canvas rendering context</td> + </tr> + + + + <tr> + + <td class="name"><code>gameState</code></td> + + + <td class="type"> + + +<span class="param-type">Object</span> + + + + </td> + + + + + + <td class="description last">Current game state</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="renderer.js.html">renderer.js</a>, <a href="renderer.js.html#line140">line 140</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="updateEnemies"><span class="type-signature"></span>updateEnemies<span class="signature">()</span><span class="type-signature"> → {void}</span></h4> + + + + + + +<div class="description"> + Updates all enemy states including movement, health, and status effects +Implements core game loop mechanics for enemy behavior + +Key features: +- Path following +- Health management +- Status effect processing +- Collision detection +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line23">line 23</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + +<h5>Returns:</h5> + + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">void</span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="updateParticles"><span class="type-signature"></span>updateParticles<span class="signature">(particles, timestamp, deltaTime)</span><span class="type-signature"> → {Array.<Object>}</span></h4> + + + + + + +<div class="description"> + Updates particle effects with time-based animation +Implements particle system lifecycle management +</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>particles</code></td> + + + <td class="type"> + + +<span class="param-type">Array.<Object></span> + + + + </td> + + + + + + <td class="description last">Array of particle objects</td> + </tr> + + + + <tr> + + <td class="name"><code>timestamp</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Current game timestamp</td> + </tr> + + + + <tr> + + <td class="name"><code>deltaTime</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last">Time elapsed since last frame</td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="mechanics.js.html">mechanics.js</a>, <a href="mechanics.js.html#line127">line 127</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + Updated particles array +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Array.<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></ul><h3>Global</h3><ul><li><a href="global.html#createDeathParticles">createDeathParticles</a></li><li><a href="global.html#findTowersInRange">findTowersInRange</a></li><li><a href="global.html#generatePath">generatePath</a></li><li><a href="global.html#getPathPosition">getPathPosition</a></li><li><a href="global.html#handleAOEEffect">handleAOEEffect</a></li><li><a href="global.html#handleEnemyAttack">handleEnemyAttack</a></li><li><a href="global.html#handleSlowEffect">handleSlowEffect</a></li><li><a href="global.html#handleTowerAttack">handleTowerAttack</a></li><li><a href="global.html#initializeDragAndDrop">initializeDragAndDrop</a></li><li><a href="global.html#placeTower">placeTower</a></li><li><a href="global.html#processEnemyAttacks">processEnemyAttacks</a></li><li><a href="global.html#processTowerAttacks">processTowerAttacks</a></li><li><a href="global.html#renderEnemies">renderEnemies</a></li><li><a href="global.html#renderGrid">renderGrid</a></li><li><a href="global.html#renderUI">renderUI</a></li><li><a href="global.html#updateEnemies">updateEnemies</a></li><li><a href="global.html#updateParticles">updateParticles</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:12:54 GMT-0500 (Eastern Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> \ No newline at end of file |