You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

332 lines
24 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Fri May 27 21:55:02 CEST 2022 -->
  5. <title>EgoController</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta name="dc.created" content="2022-05-27">
  9. <meta name="description" content="declaration: package: controller, class: EgoController">
  10. <meta name="generator" content="javadoc/ClassWriterImpl">
  11. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  12. <link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
  13. <link rel="stylesheet" type="text/css" href="../jquery-ui.overrides.css" title="Style">
  14. <script type="text/javascript" src="../script.js"></script>
  15. <script type="text/javascript" src="../script-dir/jquery-3.5.1.min.js"></script>
  16. <script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
  17. </head>
  18. <body class="class-declaration-page">
  19. <script type="text/javascript">var evenRowColor = "even-row-color";
  20. var oddRowColor = "odd-row-color";
  21. var tableTab = "table-tab";
  22. var activeTableTab = "active-table-tab";
  23. var pathtoroot = "../";
  24. loadScripts(document, 'script');</script>
  25. <noscript>
  26. <div>JavaScript is disabled on your browser.</div>
  27. </noscript>
  28. <div class="flex-box">
  29. <header role="banner" class="flex-header">
  30. <nav role="navigation">
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="top-nav" id="navbar-top">
  33. <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
  34. <ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
  35. <li><a href="../index.html">Overview</a></li>
  36. <li><a href="package-summary.html">Package</a></li>
  37. <li class="nav-bar-cell1-rev">Class</li>
  38. <li><a href="class-use/EgoController.html">Use</a></li>
  39. <li><a href="package-tree.html">Tree</a></li>
  40. <li><a href="../index-files/index-1.html">Index</a></li>
  41. <li><a href="../help-doc.html#class">Help</a></li>
  42. </ul>
  43. </div>
  44. <div class="sub-nav">
  45. <div>
  46. <ul class="sub-nav-list">
  47. <li>Summary:&nbsp;</li>
  48. <li>Nested&nbsp;|&nbsp;</li>
  49. <li>Field&nbsp;|&nbsp;</li>
  50. <li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
  51. <li><a href="#method-summary">Method</a></li>
  52. </ul>
  53. <ul class="sub-nav-list">
  54. <li>Detail:&nbsp;</li>
  55. <li>Field&nbsp;|&nbsp;</li>
  56. <li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
  57. <li><a href="#method-detail">Method</a></li>
  58. </ul>
  59. </div>
  60. <div class="nav-list-search"><label for="search-input">SEARCH:</label>
  61. <input type="text" id="search-input" value="search" disabled="disabled">
  62. <input type="reset" id="reset-button" value="reset" disabled="disabled">
  63. </div>
  64. </div>
  65. <!-- ========= END OF TOP NAVBAR ========= -->
  66. <span class="skip-nav" id="skip-navbar-top"></span></nav>
  67. </header>
  68. <div class="flex-content">
  69. <main role="main">
  70. <!-- ======== START OF CLASS DATA ======== -->
  71. <div class="header">
  72. <div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">controller</a></div>
  73. <h1 title="Class EgoController" class="title">Class EgoController</h1>
  74. </div>
  75. <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
  76. <div class="inheritance"><a href="ObjectController.html" title="class in controller">controller.ObjectController</a>
  77. <div class="inheritance">controller.EgoController</div>
  78. </div>
  79. </div>
  80. <section class="class-description" id="class-description">
  81. <dl class="notes">
  82. <dt>Direct Known Subclasses:</dt>
  83. <dd><code><a href="CollisionAwareEgoController.html" title="class in controller">CollisionAwareEgoController</a></code></dd>
  84. </dl>
  85. <hr>
  86. <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">EgoController</span>
  87. <span class="extends-implements">extends <a href="ObjectController.html" title="class in controller">ObjectController</a></span></div>
  88. <div class="block">Controller using key events for up, down, left, right and space (shooting) to control the ego
  89. object behavior.</div>
  90. </section>
  91. <section class="summary">
  92. <ul class="summary-list">
  93. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  94. <li>
  95. <section class="constructor-summary" id="constructor-summary">
  96. <h2>Constructor Summary</h2>
  97. <div class="caption"><span>Constructors</span></div>
  98. <div class="summary-table two-column-summary">
  99. <div class="table-header col-first">Constructor</div>
  100. <div class="table-header col-last">Description</div>
  101. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(double)" class="member-name-link">EgoController</a><wbr>(double&nbsp;egoRad)</code></div>
  102. <div class="col-last even-row-color">
  103. <div class="block">constructor that gives the ego controller a radius to stop the ego object when it reaches the level boundaries.</div>
  104. </div>
  105. <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(double,double)" class="member-name-link">EgoController</a><wbr>(double&nbsp;width,
  106. double&nbsp;height)</code></div>
  107. <div class="col-last odd-row-color">
  108. <div class="block">constructor that gives the ego controller a width and height to stop the ego object when it reaches the level boundaries.</div>
  109. </div>
  110. </div>
  111. </section>
  112. </li>
  113. <!-- ========== METHOD SUMMARY =========== -->
  114. <li>
  115. <section class="method-summary" id="method-summary">
  116. <h2>Method Summary</h2>
  117. <div id="method-summary-table">
  118. <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
  119. <div id="method-summary-table.tabpanel" role="tabpanel">
  120. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  121. <div class="table-header col-first">Modifier and Type</div>
  122. <div class="table-header col-second">Method</div>
  123. <div class="table-header col-last">Description</div>
  124. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  125. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onDown(java.awt.event.KeyEvent,gameobjects.GameObject)" class="member-name-link">onDown</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  126. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</code></div>
  127. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  128. <div class="block">moves ego down by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  129. </div>
  130. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  131. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onLeft(java.awt.event.KeyEvent,gameobjects.GameObject)" class="member-name-link">onLeft</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  132. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</code></div>
  133. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  134. <div class="block">moves ego left by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  135. </div>
  136. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  137. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onRight(java.awt.event.KeyEvent,gameobjects.GameObject)" class="member-name-link">onRight</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  138. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</code></div>
  139. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  140. <div class="block">moves ego right by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  141. </div>
  142. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  143. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)" class="member-name-link">onSpace</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;e,
  144. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</code></div>
  145. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  146. <div class="block">behavior for shooting on key space.</div>
  147. </div>
  148. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  149. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onStop(java.awt.event.KeyEvent,gameobjects.GameObject)" class="member-name-link">onStop</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  150. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</code></div>
  151. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  152. <div class="block">sets speed to 0.0</div>
  153. </div>
  154. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  155. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onUp(java.awt.event.KeyEvent,gameobjects.GameObject)" class="member-name-link">onUp</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  156. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</code></div>
  157. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  158. <div class="block">moves ego up by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  159. </div>
  160. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  161. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#stopObject()" class="member-name-link">stopObject</a>()</code></div>
  162. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  163. <div class="block">checks the position and respects level boundaries and own radius or width/height set on constructor.</div>
  164. </div>
  165. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  166. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#updateObject()" class="member-name-link">updateObject</a>()</code></div>
  167. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  168. <div class="block">updates position based on key events (mouse currently ignored).</div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div class="inherited-list">
  174. <h3 id="methods-inherited-from-class-controller.ObjectController">Methods inherited from class&nbsp;controller.<a href="ObjectController.html" title="class in controller">ObjectController</a></h3>
  175. <code><a href="ObjectController.html#applySpeedVector()">applySpeedVector</a>, <a href="ObjectController.html#getPlayground()">getPlayground</a>, <a href="ObjectController.html#getTimestep()">getTimestep</a>, <a href="ObjectController.html#getVX()">getVX</a>, <a href="ObjectController.html#getVY()">getVY</a>, <a href="ObjectController.html#getX()">getX</a>, <a href="ObjectController.html#getY()">getY</a>, <a href="ObjectController.html#setDummy(java.lang.String)">setDummy</a>, <a href="ObjectController.html#setObject(gameobjects.GameObject)">setObject</a>, <a href="ObjectController.html#setPlayground(playground.Playground)">setPlayground</a>, <a href="ObjectController.html#setVX(double)">setVX</a>, <a href="ObjectController.html#setVY(double)">setVY</a>, <a href="ObjectController.html#setX(double)">setX</a>, <a href="ObjectController.html#setY(double)">setY</a></code></div>
  176. <div class="inherited-list">
  177. <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
  178. <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
  179. </section>
  180. </li>
  181. </ul>
  182. </section>
  183. <section class="details">
  184. <ul class="details-list">
  185. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  186. <li>
  187. <section class="constructor-details" id="constructor-detail">
  188. <h2>Constructor Details</h2>
  189. <ul class="member-list">
  190. <li>
  191. <section class="detail" id="&lt;init&gt;(double)">
  192. <h3>EgoController</h3>
  193. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">EgoController</span><wbr><span class="parameters">(double&nbsp;egoRad)</span></div>
  194. <div class="block">constructor that gives the ego controller a radius to stop the ego object when it reaches the level boundaries.</div>
  195. <dl class="notes">
  196. <dt>Parameters:</dt>
  197. <dd><code>egoRad</code> - radius to use as a boundary stop for level borders (usually use the same dimensions as your ego object)</dd>
  198. </dl>
  199. </section>
  200. </li>
  201. <li>
  202. <section class="detail" id="&lt;init&gt;(double,double)">
  203. <h3>EgoController</h3>
  204. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">EgoController</span><wbr><span class="parameters">(double&nbsp;width,
  205. double&nbsp;height)</span></div>
  206. <div class="block">constructor that gives the ego controller a width and height to stop the ego object when it reaches the level boundaries.</div>
  207. <dl class="notes">
  208. <dt>Parameters:</dt>
  209. <dd><code>width</code> - width to use as a boundary stop for level borders (usually use the same dimensions as your ego object)</dd>
  210. <dd><code>height</code> - height to use as a boundary stop for level borders (usually use the same dimensions as your ego object)</dd>
  211. </dl>
  212. </section>
  213. </li>
  214. </ul>
  215. </section>
  216. </li>
  217. <!-- ============ METHOD DETAIL ========== -->
  218. <li>
  219. <section class="method-details" id="method-detail">
  220. <h2>Method Details</h2>
  221. <ul class="member-list">
  222. <li>
  223. <section class="detail" id="onUp(java.awt.event.KeyEvent,gameobjects.GameObject)">
  224. <h3>onUp</h3>
  225. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">onUp</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  226. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</span></div>
  227. <div class="block">moves ego up by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  228. <dl class="notes">
  229. <dt>Parameters:</dt>
  230. <dd><code>kc</code> - KeyEvent to process (ignored)</dd>
  231. <dd><code>ego</code> - the ego object</dd>
  232. </dl>
  233. </section>
  234. </li>
  235. <li>
  236. <section class="detail" id="onDown(java.awt.event.KeyEvent,gameobjects.GameObject)">
  237. <h3>onDown</h3>
  238. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">onDown</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  239. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</span></div>
  240. <div class="block">moves ego down by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  241. <dl class="notes">
  242. <dt>Parameters:</dt>
  243. <dd><code>kc</code> - KeyEvent to process (ignored)</dd>
  244. <dd><code>ego</code> - the ego object</dd>
  245. </dl>
  246. </section>
  247. </li>
  248. <li>
  249. <section class="detail" id="onLeft(java.awt.event.KeyEvent,gameobjects.GameObject)">
  250. <h3>onLeft</h3>
  251. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">onLeft</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  252. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</span></div>
  253. <div class="block">moves ego left by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  254. <dl class="notes">
  255. <dt>Parameters:</dt>
  256. <dd><code>kc</code> - KeyEvent to process (ignored)</dd>
  257. <dd><code>ego</code> - the ego object</dd>
  258. </dl>
  259. </section>
  260. </li>
  261. <li>
  262. <section class="detail" id="onRight(java.awt.event.KeyEvent,gameobjects.GameObject)">
  263. <h3>onRight</h3>
  264. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">onRight</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  265. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</span></div>
  266. <div class="block">moves ego right by <a href="../playground/SpaceInvadersLevel.html#EGOSPEED"><code>SpaceInvadersLevel.EGOSPEED</code></a>.</div>
  267. <dl class="notes">
  268. <dt>Parameters:</dt>
  269. <dd><code>kc</code> - KeyEvent to process (ignored)</dd>
  270. <dd><code>ego</code> - the ego object</dd>
  271. </dl>
  272. </section>
  273. </li>
  274. <li>
  275. <section class="detail" id="onStop(java.awt.event.KeyEvent,gameobjects.GameObject)">
  276. <h3>onStop</h3>
  277. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">onStop</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;kc,
  278. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</span></div>
  279. <div class="block">sets speed to 0.0</div>
  280. <dl class="notes">
  281. <dt>Parameters:</dt>
  282. <dd><code>kc</code> - KeyEvent to process (ignored)</dd>
  283. <dd><code>ego</code> - the ego object</dd>
  284. </dl>
  285. </section>
  286. </li>
  287. <li>
  288. <section class="detail" id="stopObject()">
  289. <h3>stopObject</h3>
  290. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">stopObject</span>()</div>
  291. <div class="block">checks the position and respects level boundaries and own radius or width/height set on constructor.</div>
  292. <dl class="notes">
  293. <dt>Returns:</dt>
  294. <dd>true if the object reached the boundaries of the level, false otherwise.</dd>
  295. </dl>
  296. </section>
  297. </li>
  298. <li>
  299. <section class="detail" id="onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)">
  300. <h3>onSpace</h3>
  301. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">onSpace</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;e,
  302. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</span></div>
  303. <div class="block">behavior for shooting on key space. Creates a new shot using {#link SimpleShotController} with a <a href="../gameobjects/RectObject.html" title="class in gameobjects"><code>RectObject</code></a>.</div>
  304. <dl class="notes">
  305. <dt>Parameters:</dt>
  306. <dd><code>e</code> - KeyEvent of the space key</dd>
  307. <dd><code>ego</code> - EgoObject instance (used to determine position of shot object's start)</dd>
  308. </dl>
  309. </section>
  310. </li>
  311. <li>
  312. <section class="detail" id="updateObject()">
  313. <h3>updateObject</h3>
  314. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">updateObject</span>()</div>
  315. <div class="block">updates position based on key events (mouse currently ignored).</div>
  316. <dl class="notes">
  317. <dt>Specified by:</dt>
  318. <dd><code><a href="ObjectController.html#updateObject()">updateObject</a></code>&nbsp;in class&nbsp;<code><a href="ObjectController.html" title="class in controller">ObjectController</a></code></dd>
  319. </dl>
  320. </section>
  321. </li>
  322. </ul>
  323. </section>
  324. </li>
  325. </ul>
  326. </section>
  327. <!-- ========= END OF CLASS DATA ========= -->
  328. </main>
  329. </div>
  330. </div>
  331. </body>
  332. </html>