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.

740 lines
52 KiB

  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Fri Jun 17 12:42:43 CEST 2022 -->
  5. <title>GameObject</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-06-17">
  9. <meta name="description" content="declaration: package: gameobjects, class: GameObject">
  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/GameObject.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><a href="#field-summary">Field</a>&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><a href="#field-detail">Field</a>&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">gameobjects</a></div>
  73. <h1 title="Class GameObject" class="title">Class GameObject</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">gameobjects.GameObject</div>
  77. </div>
  78. <section class="class-description" id="class-description">
  79. <dl class="notes">
  80. <dt>Direct Known Subclasses:</dt>
  81. <dd><code><a href="AnimatedGameobject.html" title="class in gameobjects">AnimatedGameobject</a></code>, <code><a href="EgoObject.html" title="class in gameobjects">EgoObject</a></code>, <code><a href="FallingStar.html" title="class in gameobjects">FallingStar</a></code>, <code><a href="RectObject.html" title="class in gameobjects">RectObject</a></code>, <code><a href="TextObject.html" title="class in gameobjects">TextObject</a></code></dd>
  82. </dl>
  83. <hr>
  84. <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">GameObject</span>
  85. <span class="extends-implements">extends <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></span></div>
  86. <div class="block">The class <a href="GameObject.html" title="class in gameobjects"><code>GameObject</code></a> represents a (possibly animated) object appearing in a level of the
  87. game. It is therefore attached to an instance of the class <a href="../playground/Playground.html" title="class in playground"><code>Playground</code></a>. A GameObject has
  88. at least the following properties:
  89. <ul>
  90. <li>2D screen position
  91. <li>2D speed
  92. <li>a name that is unique within a certain <a href="../playground/Playground.html" title="class in playground"><code>Playground</code></a><br>
  93. <li>a reference to the <a href="../playground/Playground.html" title="class in playground"><code>Playground</code></a> object it belongs to<br>
  94. <li>a reference to an instance of <a href="../controller/ObjectController.html" title="class in controller"><code>ObjectController</code></a> that handles the movement
  95. logic of the object<br>
  96. <li>a (circular) radius for simple collision checking. This may be handled differently in
  97. subclasses<br>
  98. </ul>
  99. The main task of GameObject, or its subclasses, is to draw the object on the screen, which is
  100. handles by the <a href="#draw(java.awt.Graphics2D)"><code>draw(Graphics2D)</code></a> method. It is this method that must be redefined if a
  101. new appearance should be realized. For introducing new behavior, it is sufficient to supply a
  102. different <a href="../controller/ObjectController.html" title="class in controller"><code>ObjectController</code></a> instance when constructing a GameObject.</div>
  103. </section>
  104. <section class="summary">
  105. <ul class="summary-list">
  106. <!-- =========== FIELD SUMMARY =========== -->
  107. <li>
  108. <section class="field-summary" id="field-summary">
  109. <h2>Field Summary</h2>
  110. <div class="caption"><span>Fields</span></div>
  111. <div class="summary-table three-column-summary">
  112. <div class="table-header col-first">Modifier and Type</div>
  113. <div class="table-header col-second">Field</div>
  114. <div class="table-header col-last">Description</div>
  115. <div class="col-first even-row-color"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
  116. <div class="col-second even-row-color"><code><a href="#id" class="member-name-link">id</a></code></div>
  117. <div class="col-last even-row-color">&nbsp;</div>
  118. <div class="col-first odd-row-color"><code>static final int</code></div>
  119. <div class="col-second odd-row-color"><code><a href="#MASK" class="member-name-link">MASK</a></code></div>
  120. <div class="col-last odd-row-color">&nbsp;</div>
  121. <div class="col-first even-row-color"><code>static final int</code></div>
  122. <div class="col-second even-row-color"><code><a href="#RADIUS" class="member-name-link">RADIUS</a></code></div>
  123. <div class="col-last even-row-color">&nbsp;</div>
  124. <div class="col-first odd-row-color"><code>static final int</code></div>
  125. <div class="col-second odd-row-color"><code><a href="#RECTANGLE" class="member-name-link">RECTANGLE</a></code></div>
  126. <div class="col-last odd-row-color">&nbsp;</div>
  127. <div class="col-first even-row-color"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html" title="class or interface in java.util" class="external-link">LinkedList</a>&lt;<a href="../collider/Collider.html" title="class in collider">Collider</a>&gt;</code></div>
  128. <div class="col-second even-row-color"><code><a href="#scol" class="member-name-link">scol</a></code></div>
  129. <div class="col-last even-row-color">&nbsp;</div>
  130. </div>
  131. </section>
  132. </li>
  133. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  134. <li>
  135. <section class="constructor-summary" id="constructor-summary">
  136. <h2>Constructor Summary</h2>
  137. <div class="caption"><span>Constructors</span></div>
  138. <div class="summary-table two-column-summary">
  139. <div class="table-header col-first">Constructor</div>
  140. <div class="table-header col-last">Description</div>
  141. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String,playground.Playground,double,double,double,double)" class="member-name-link">GameObject</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  142. <a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground,
  143. double&nbsp;x,
  144. double&nbsp;y,
  145. double&nbsp;vx,
  146. double&nbsp;vy)</code></div>
  147. <div class="col-last even-row-color">
  148. <div class="block">Constructor to initialize a GameObject, respectively set the current <a href="../playground/Playground.html" title="class in playground"><code>Playground</code></a>
  149. instance this GameObject belongs to.</div>
  150. </div>
  151. <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(java.lang.String,playground.Playground,controller.ObjectController,double,double,double,double)" class="member-name-link">GameObject</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  152. <a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground,
  153. <a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;controller,
  154. double&nbsp;x,
  155. double&nbsp;y,
  156. double&nbsp;vx,
  157. double&nbsp;vy)</code></div>
  158. <div class="col-last odd-row-color">
  159. <div class="block">Constructor to initialize a GameObject, respectively set the current Playground instance this
  160. GameObject belongs to.</div>
  161. </div>
  162. </div>
  163. </section>
  164. </li>
  165. <!-- ========== METHOD SUMMARY =========== -->
  166. <li>
  167. <section class="method-summary" id="method-summary">
  168. <h2>Method Summary</h2>
  169. <div id="method-summary-table">
  170. <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>
  171. <div id="method-summary-table.tabpanel" role="tabpanel">
  172. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  173. <div class="table-header col-first">Modifier and Type</div>
  174. <div class="table-header col-second">Method</div>
  175. <div class="table-header col-last">Description</div>
  176. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GameObject.html" title="class in gameobjects">GameObject</a></code></div>
  177. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addArtist(rendering.Artist)" class="member-name-link">addArtist</a><wbr>(<a href="../rendering/Artist.html" title="class in rendering">Artist</a>&nbsp;a)</code></div>
  178. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  179. <div class="block">Sets the artist to be used for drawing the object onto visible canvas area.</div>
  180. </div>
  181. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  182. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addCollider(collider.Collider)" class="member-name-link">addCollider</a><wbr>(<a href="../collider/Collider.html" title="class in collider">Collider</a>&nbsp;c)</code></div>
  183. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  184. <div class="block">saves the collider in the internal list of Colliders to be used for this GameObject.</div>
  185. </div>
  186. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GameObject.html" title="class in gameobjects">GameObject</a></code></div>
  187. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addController(controller.ObjectController)" class="member-name-link">addController</a><wbr>(<a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;c)</code></div>
  188. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  189. <div class="block">Sets the controller to use for this GameObject's logical behavior.</div>
  190. </div>
  191. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  192. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#collisionDetection(gameobjects.GameObject)" class="member-name-link">collisionDetection</a><wbr>(<a href="GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;other)</code></div>
  193. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  194. <div class="block">Collision detection implemented by iteration through the own list of <a href="../collider/Collider.html" title="class in collider"><code>Collider</code></a>
  195. and calling their <a href="../collider/Collider.html#collidesWith(collider.Collider)"><code>Collider.collidesWith(Collider)</code></a> method to check collision
  196. with the given parameter instance of other <a href="GameObject.html" title="class in gameobjects"><code>GameObject</code></a>.</div>
  197. </div>
  198. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  199. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#draw(java.awt.Graphics2D)" class="member-name-link">draw</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g)</code></div>
  200. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  201. <div class="block">Draws the object in its current state.</div>
  202. </div>
  203. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GameObject.html" title="class in gameobjects">GameObject</a></code></div>
  204. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#generateColliders()" class="member-name-link">generateColliders</a>()</code></div>
  205. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  206. <div class="block">generates and sets collider(s) for this GameObject.</div>
  207. </div>
  208. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  209. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGameTime()" class="member-name-link">getGameTime</a>()</code></div>
  210. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  211. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
  212. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getId()" class="member-name-link">getId</a>()</code></div>
  213. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  214. <div class="block">return the unique object ID.</div>
  215. </div>
  216. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../controller/ObjectController.html" title="class in controller">ObjectController</a></code></div>
  217. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getObjectController()" class="member-name-link">getObjectController</a>()</code></div>
  218. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  219. <div class="block">Access to object controller.</div>
  220. </div>
  221. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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></code></div>
  222. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getObjectFlag(java.lang.String)" class="member-name-link">getObjectFlag</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</code></div>
  223. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  224. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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></code></div>
  225. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getOrCreateObjectFlag(java.lang.String,java.lang.Object)" class="member-name-link">getOrCreateObjectFlag</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  226. <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>&nbsp;createValue)</code></div>
  227. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  228. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../playground/Playground.html" title="class in playground">Playground</a></code></div>
  229. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPlayground()" class="member-name-link">getPlayground</a>()</code></div>
  230. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  231. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  232. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getVX()" class="member-name-link">getVX</a>()</code></div>
  233. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  234. <div class="block">gets the screen X speed in pixels per frame.</div>
  235. </div>
  236. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  237. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getVY()" class="member-name-link">getVY</a>()</code></div>
  238. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  239. <div class="block">gets the screen Y speed in pixels per frame.</div>
  240. </div>
  241. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  242. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getX()" class="member-name-link">getX</a>()</code></div>
  243. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  244. <div class="block">gets the screen X position.</div>
  245. </div>
  246. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  247. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getY()" class="member-name-link">getY</a>()</code></div>
  248. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  249. <div class="block">gets the screen Y position.</div>
  250. </div>
  251. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  252. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isActive()" class="member-name-link">isActive</a>()</code></div>
  253. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  254. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GameObject.html" title="class in gameobjects">GameObject</a></code></div>
  255. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setActive(boolean)" class="member-name-link">setActive</a><wbr>(boolean&nbsp;flag)</code></div>
  256. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  257. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  258. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setColliders(java.util.LinkedList)" class="member-name-link">setColliders</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html" title="class or interface in java.util" class="external-link">LinkedList</a>&lt;<a href="../collider/Collider.html" title="class in collider">Collider</a>&gt;&nbsp;l)</code></div>
  259. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  260. <div class="block">sets colliders.</div>
  261. </div>
  262. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  263. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setComponentProperty(java.lang.String,java.lang.String,java.lang.Object)" class="member-name-link">setComponentProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;comp,
  264. <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;property,
  265. <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>&nbsp;value)</code></div>
  266. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  267. <div class="block">calls via reflection a method of a component if this GameObjects instance and provides the
  268. given value as String parameter.</div>
  269. </div>
  270. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  271. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setObjectController(controller.ObjectController)" class="member-name-link">setObjectController</a><wbr>(<a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;controller)</code></div>
  272. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  273. <div class="block">Sets a new object controller (replaces any former one).</div>
  274. </div>
  275. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  276. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setObjectFlag(java.lang.String,java.lang.Object)" class="member-name-link">setObjectFlag</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  277. <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>&nbsp;value)</code></div>
  278. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  279. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  280. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPlayground(playground.Playground)" class="member-name-link">setPlayground</a><wbr>(<a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground)</code></div>
  281. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  282. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  283. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setVX(double)" class="member-name-link">setVX</a><wbr>(double&nbsp;vx)</code></div>
  284. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  285. <div class="block">set screen x speed in pixel per frame</div>
  286. </div>
  287. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  288. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setVY(double)" class="member-name-link">setVY</a><wbr>(double&nbsp;vy)</code></div>
  289. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  290. <div class="block">set screen y speed in pixel per frame.</div>
  291. </div>
  292. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  293. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setX(double)" class="member-name-link">setX</a><wbr>(double&nbsp;x)</code></div>
  294. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  295. <div class="block">set screen x position.</div>
  296. </div>
  297. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  298. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setY(double)" class="member-name-link">setY</a><wbr>(double&nbsp;y)</code></div>
  299. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  300. <div class="block">set screen y position.</div>
  301. </div>
  302. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  303. <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>
  304. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  305. <div class="block">triggers this GameObjects own controller (if set) to update the object.</div>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <div class="inherited-list">
  311. <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>
  312. <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>
  313. </section>
  314. </li>
  315. </ul>
  316. </section>
  317. <section class="details">
  318. <ul class="details-list">
  319. <!-- ============ FIELD DETAIL =========== -->
  320. <li>
  321. <section class="field-details" id="field-detail">
  322. <h2>Field Details</h2>
  323. <ul class="member-list">
  324. <li>
  325. <section class="detail" id="RADIUS">
  326. <h3>RADIUS</h3>
  327. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">RADIUS</span></div>
  328. <dl class="notes">
  329. <dt>See Also:</dt>
  330. <dd>
  331. <ul class="see-list">
  332. <li><a href="../constant-values.html#gameobjects.GameObject.RADIUS">Constant Field Values</a></li>
  333. </ul>
  334. </dd>
  335. </dl>
  336. </section>
  337. </li>
  338. <li>
  339. <section class="detail" id="RECTANGLE">
  340. <h3>RECTANGLE</h3>
  341. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">RECTANGLE</span></div>
  342. <dl class="notes">
  343. <dt>See Also:</dt>
  344. <dd>
  345. <ul class="see-list">
  346. <li><a href="../constant-values.html#gameobjects.GameObject.RECTANGLE">Constant Field Values</a></li>
  347. </ul>
  348. </dd>
  349. </dl>
  350. </section>
  351. </li>
  352. <li>
  353. <section class="detail" id="MASK">
  354. <h3>MASK</h3>
  355. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">MASK</span></div>
  356. <dl class="notes">
  357. <dt>See Also:</dt>
  358. <dd>
  359. <ul class="see-list">
  360. <li><a href="../constant-values.html#gameobjects.GameObject.MASK">Constant Field Values</a></li>
  361. </ul>
  362. </dd>
  363. </dl>
  364. </section>
  365. </li>
  366. <li>
  367. <section class="detail" id="id">
  368. <h3>id</h3>
  369. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">id</span></div>
  370. </section>
  371. </li>
  372. <li>
  373. <section class="detail" id="scol">
  374. <h3>scol</h3>
  375. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html" title="class or interface in java.util" class="external-link">LinkedList</a>&lt;<a href="../collider/Collider.html" title="class in collider">Collider</a>&gt;</span>&nbsp;<span class="element-name">scol</span></div>
  376. </section>
  377. </li>
  378. </ul>
  379. </section>
  380. </li>
  381. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  382. <li>
  383. <section class="constructor-details" id="constructor-detail">
  384. <h2>Constructor Details</h2>
  385. <ul class="member-list">
  386. <li>
  387. <section class="detail" id="&lt;init&gt;(java.lang.String,playground.Playground,double,double,double,double)">
  388. <h3>GameObject</h3>
  389. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">GameObject</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  390. <a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground,
  391. double&nbsp;x,
  392. double&nbsp;y,
  393. double&nbsp;vx,
  394. double&nbsp;vy)</span></div>
  395. <div class="block">Constructor to initialize a GameObject, respectively set the current <a href="../playground/Playground.html" title="class in playground"><code>Playground</code></a>
  396. instance this GameObject belongs to.</div>
  397. <dl class="notes">
  398. <dt>Parameters:</dt>
  399. <dd><code>id</code> - unique ID for this GameObject (should not be null or empty String)</dd>
  400. <dd><code>playground</code> - the Playground the GameObject belongs to (should not be null)</dd>
  401. <dd><code>x</code> - initial screen position in direction horizontal (positive value including zero)</dd>
  402. <dd><code>y</code> - initial screen position in direction vertical (positive value including zero)</dd>
  403. <dd><code>vx</code> - initial speed (velocity) in direction horizontal (can be negative, zero, positive)</dd>
  404. <dd><code>vy</code> - initial speed (velocity) in direction horizontal (can be negative, zero, positive)</dd>
  405. </dl>
  406. </section>
  407. </li>
  408. <li>
  409. <section class="detail" id="&lt;init&gt;(java.lang.String,playground.Playground,controller.ObjectController,double,double,double,double)">
  410. <h3>GameObject</h3>
  411. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">GameObject</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  412. <a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground,
  413. <a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;controller,
  414. double&nbsp;x,
  415. double&nbsp;y,
  416. double&nbsp;vx,
  417. double&nbsp;vy)</span></div>
  418. <div class="block">Constructor to initialize a GameObject, respectively set the current Playground instance this
  419. GameObject belongs to.</div>
  420. <dl class="notes">
  421. <dt>Parameters:</dt>
  422. <dd><code>id</code> - unique ID for this GameObject (should not be null or empty String)</dd>
  423. <dd><code>playground</code> - the Playground the GameObject belongs to (should not be null)</dd>
  424. <dd><code>controller</code> - controller instance to be used for this GameObject (can be null)</dd>
  425. <dd><code>x</code> - initial screen position in direction horizontal (positive value including zero)</dd>
  426. <dd><code>y</code> - initial screen position in direction vertical (positive value including zero)</dd>
  427. <dd><code>vx</code> - initial speed (velocity) in direction horizontal (can be negative, zero, positive)</dd>
  428. <dd><code>vy</code> - initial speed (velocity) in direction horizontal (can be negative, zero, positive)</dd>
  429. </dl>
  430. </section>
  431. </li>
  432. </ul>
  433. </section>
  434. </li>
  435. <!-- ============ METHOD DETAIL ========== -->
  436. <li>
  437. <section class="method-details" id="method-detail">
  438. <h2>Method Details</h2>
  439. <ul class="member-list">
  440. <li>
  441. <section class="detail" id="setColliders(java.util.LinkedList)">
  442. <h3>setColliders</h3>
  443. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setColliders</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html" title="class or interface in java.util" class="external-link">LinkedList</a>&lt;<a href="../collider/Collider.html" title="class in collider">Collider</a>&gt;&nbsp;l)</span></div>
  444. <div class="block">sets colliders.</div>
  445. <dl class="notes">
  446. <dt>Parameters:</dt>
  447. <dd><code>l</code> - LinkedList of Colliders.</dd>
  448. </dl>
  449. </section>
  450. </li>
  451. <li>
  452. <section class="detail" id="generateColliders()">
  453. <h3>generateColliders</h3>
  454. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GameObject.html" title="class in gameobjects">GameObject</a></span>&nbsp;<span class="element-name">generateColliders</span>()</div>
  455. <div class="block">generates and sets collider(s) for this GameObject. This implementation does nothing. Intended
  456. to be overridden by subclasses.</div>
  457. <dl class="notes">
  458. <dt>Returns:</dt>
  459. <dd>instance of this GameObject (this).</dd>
  460. </dl>
  461. </section>
  462. </li>
  463. <li>
  464. <section class="detail" id="addController(controller.ObjectController)">
  465. <h3>addController</h3>
  466. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GameObject.html" title="class in gameobjects">GameObject</a></span>&nbsp;<span class="element-name">addController</span><wbr><span class="parameters">(<a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;c)</span></div>
  467. <div class="block">Sets the controller to use for this GameObject's logical behavior.</div>
  468. <dl class="notes">
  469. <dt>Parameters:</dt>
  470. <dd><code>c</code> - instance to be used.</dd>
  471. <dt>Returns:</dt>
  472. <dd>the current instance (this).</dd>
  473. </dl>
  474. </section>
  475. </li>
  476. <li>
  477. <section class="detail" id="addArtist(rendering.Artist)">
  478. <h3>addArtist</h3>
  479. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GameObject.html" title="class in gameobjects">GameObject</a></span>&nbsp;<span class="element-name">addArtist</span><wbr><span class="parameters">(<a href="../rendering/Artist.html" title="class in rendering">Artist</a>&nbsp;a)</span></div>
  480. <div class="block">Sets the artist to be used for drawing the object onto visible canvas area.</div>
  481. <dl class="notes">
  482. <dt>Parameters:</dt>
  483. <dd><code>a</code> - instance to be used for calling <a href="../rendering/Artist.html#draw(java.awt.Graphics2D)"><code>Artist.draw(Graphics2D)</code></a>.</dd>
  484. <dt>Returns:</dt>
  485. <dd>the current instance (this).</dd>
  486. </dl>
  487. </section>
  488. </li>
  489. <li>
  490. <section class="detail" id="addCollider(collider.Collider)">
  491. <h3>addCollider</h3>
  492. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addCollider</span><wbr><span class="parameters">(<a href="../collider/Collider.html" title="class in collider">Collider</a>&nbsp;c)</span></div>
  493. <div class="block">saves the collider in the internal list of Colliders to be used for this GameObject.</div>
  494. <dl class="notes">
  495. <dt>Parameters:</dt>
  496. <dd><code>c</code> - instance to be added to internal list</dd>
  497. </dl>
  498. </section>
  499. </li>
  500. <li>
  501. <section class="detail" id="getPlayground()">
  502. <h3>getPlayground</h3>
  503. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../playground/Playground.html" title="class in playground">Playground</a></span>&nbsp;<span class="element-name">getPlayground</span>()</div>
  504. </section>
  505. </li>
  506. <li>
  507. <section class="detail" id="setPlayground(playground.Playground)">
  508. <h3>setPlayground</h3>
  509. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPlayground</span><wbr><span class="parameters">(<a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground)</span></div>
  510. </section>
  511. </li>
  512. <li>
  513. <section class="detail" id="setComponentProperty(java.lang.String,java.lang.String,java.lang.Object)">
  514. <h3>setComponentProperty</h3>
  515. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setComponentProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;comp,
  516. <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;property,
  517. <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>&nbsp;value)</span></div>
  518. <div class="block">calls via reflection a method of a component if this GameObjects instance and provides the
  519. given value as String parameter.</div>
  520. <dl class="notes">
  521. <dt>Parameters:</dt>
  522. <dd><code>comp</code> - class name of GameObject component. Currently only "controller" is supported,
  523. otherwise nothing happens.</dd>
  524. <dd><code>property</code> - method name of the component to call.</dd>
  525. <dd><code>value</code> - argument to pass to the method as String parameter.</dd>
  526. </dl>
  527. </section>
  528. </li>
  529. <li>
  530. <section class="detail" id="setObjectFlag(java.lang.String,java.lang.Object)">
  531. <h3>setObjectFlag</h3>
  532. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setObjectFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  533. <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>&nbsp;value)</span></div>
  534. </section>
  535. </li>
  536. <li>
  537. <section class="detail" id="getObjectFlag(java.lang.String)">
  538. <h3>getObjectFlag</h3>
  539. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">getObjectFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</span></div>
  540. </section>
  541. </li>
  542. <li>
  543. <section class="detail" id="getOrCreateObjectFlag(java.lang.String,java.lang.Object)">
  544. <h3>getOrCreateObjectFlag</h3>
  545. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">getOrCreateObjectFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  546. <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>&nbsp;createValue)</span></div>
  547. </section>
  548. </li>
  549. <li>
  550. <section class="detail" id="isActive()">
  551. <h3>isActive</h3>
  552. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isActive</span>()</div>
  553. </section>
  554. </li>
  555. <li>
  556. <section class="detail" id="setActive(boolean)">
  557. <h3>setActive</h3>
  558. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GameObject.html" title="class in gameobjects">GameObject</a></span>&nbsp;<span class="element-name">setActive</span><wbr><span class="parameters">(boolean&nbsp;flag)</span></div>
  559. </section>
  560. </li>
  561. <li>
  562. <section class="detail" id="getId()">
  563. <h3>getId</h3>
  564. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getId</span>()</div>
  565. <div class="block">return the unique object ID.</div>
  566. <dl class="notes">
  567. <dt>Returns:</dt>
  568. <dd>unique object ID</dd>
  569. </dl>
  570. </section>
  571. </li>
  572. <li>
  573. <section class="detail" id="getX()">
  574. <h3>getX</h3>
  575. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getX</span>()</div>
  576. <div class="block">gets the screen X position.</div>
  577. <dl class="notes">
  578. <dt>Returns:</dt>
  579. <dd>screen x position</dd>
  580. </dl>
  581. </section>
  582. </li>
  583. <li>
  584. <section class="detail" id="getY()">
  585. <h3>getY</h3>
  586. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getY</span>()</div>
  587. <div class="block">gets the screen Y position.</div>
  588. <dl class="notes">
  589. <dt>Returns:</dt>
  590. <dd>screen Y position</dd>
  591. </dl>
  592. </section>
  593. </li>
  594. <li>
  595. <section class="detail" id="getVX()">
  596. <h3>getVX</h3>
  597. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getVX</span>()</div>
  598. <div class="block">gets the screen X speed in pixels per frame.</div>
  599. <dl class="notes">
  600. <dt>Returns:</dt>
  601. <dd>screen x speed</dd>
  602. </dl>
  603. </section>
  604. </li>
  605. <li>
  606. <section class="detail" id="getVY()">
  607. <h3>getVY</h3>
  608. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getVY</span>()</div>
  609. <div class="block">gets the screen Y speed in pixels per frame.</div>
  610. <dl class="notes">
  611. <dt>Returns:</dt>
  612. <dd>screen y speed</dd>
  613. </dl>
  614. </section>
  615. </li>
  616. <li>
  617. <section class="detail" id="setX(double)">
  618. <h3>setX</h3>
  619. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setX</span><wbr><span class="parameters">(double&nbsp;x)</span></div>
  620. <div class="block">set screen x position.</div>
  621. <dl class="notes">
  622. <dt>Parameters:</dt>
  623. <dd><code>x</code> - new position</dd>
  624. </dl>
  625. </section>
  626. </li>
  627. <li>
  628. <section class="detail" id="setY(double)">
  629. <h3>setY</h3>
  630. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setY</span><wbr><span class="parameters">(double&nbsp;y)</span></div>
  631. <div class="block">set screen y position.</div>
  632. <dl class="notes">
  633. <dt>Parameters:</dt>
  634. <dd><code>y</code> - new position</dd>
  635. </dl>
  636. </section>
  637. </li>
  638. <li>
  639. <section class="detail" id="setVX(double)">
  640. <h3>setVX</h3>
  641. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setVX</span><wbr><span class="parameters">(double&nbsp;vx)</span></div>
  642. <div class="block">set screen x speed in pixel per frame</div>
  643. <dl class="notes">
  644. <dt>Parameters:</dt>
  645. <dd><code>vx</code> - new x speed</dd>
  646. </dl>
  647. </section>
  648. </li>
  649. <li>
  650. <section class="detail" id="setVY(double)">
  651. <h3>setVY</h3>
  652. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setVY</span><wbr><span class="parameters">(double&nbsp;vy)</span></div>
  653. <div class="block">set screen y speed in pixel per frame.</div>
  654. <dl class="notes">
  655. <dt>Parameters:</dt>
  656. <dd><code>vy</code> - new y speed.</dd>
  657. </dl>
  658. </section>
  659. </li>
  660. <li>
  661. <section class="detail" id="setObjectController(controller.ObjectController)">
  662. <h3>setObjectController</h3>
  663. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setObjectController</span><wbr><span class="parameters">(<a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;controller)</span></div>
  664. <div class="block">Sets a new object controller (replaces any former one).</div>
  665. <dl class="notes">
  666. <dt>Parameters:</dt>
  667. <dd><code>controller</code> - An instance of <a href="../controller/ObjectController.html" title="class in controller"><code>ObjectController</code></a> or one of its subclasses.</dd>
  668. </dl>
  669. </section>
  670. </li>
  671. <li>
  672. <section class="detail" id="getObjectController()">
  673. <h3>getObjectController</h3>
  674. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../controller/ObjectController.html" title="class in controller">ObjectController</a></span>&nbsp;<span class="element-name">getObjectController</span>()</div>
  675. <div class="block">Access to object controller.</div>
  676. <dl class="notes">
  677. <dt>Returns:</dt>
  678. <dd>the controller for this object.</dd>
  679. </dl>
  680. </section>
  681. </li>
  682. <li>
  683. <section class="detail" id="getGameTime()">
  684. <h3>getGameTime</h3>
  685. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getGameTime</span>()</div>
  686. </section>
  687. </li>
  688. <li>
  689. <section class="detail" id="collisionDetection(gameobjects.GameObject)">
  690. <h3>collisionDetection</h3>
  691. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">collisionDetection</span><wbr><span class="parameters">(<a href="GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;other)</span></div>
  692. <div class="block">Collision detection implemented by iteration through the own list of <a href="../collider/Collider.html" title="class in collider"><code>Collider</code></a>
  693. and calling their <a href="../collider/Collider.html#collidesWith(collider.Collider)"><code>Collider.collidesWith(Collider)</code></a> method to check collision
  694. with the given parameter instance of other <a href="GameObject.html" title="class in gameobjects"><code>GameObject</code></a>.</div>
  695. <dl class="notes">
  696. <dt>Parameters:</dt>
  697. <dd><code>other</code> - instance of the other GameObject to check collision with</dd>
  698. <dt>Returns:</dt>
  699. <dd>true if collision is detected, false otherwise</dd>
  700. </dl>
  701. </section>
  702. </li>
  703. <li>
  704. <section class="detail" id="updateObject()">
  705. <h3>updateObject</h3>
  706. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">updateObject</span>()</div>
  707. <div class="block">triggers this GameObjects own controller (if set) to update the object.</div>
  708. <dl class="notes">
  709. <dt>See Also:</dt>
  710. <dd>
  711. <ul class="see-list">
  712. <li><code>controller</code></li>
  713. </ul>
  714. </dd>
  715. </dl>
  716. </section>
  717. </li>
  718. <li>
  719. <section class="detail" id="draw(java.awt.Graphics2D)">
  720. <h3>draw</h3>
  721. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">draw</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g)</span></div>
  722. <div class="block">Draws the object in its current state. Is called by the game engine, should NOT be called
  723. otherwise.</div>
  724. <dl class="notes">
  725. <dt>Parameters:</dt>
  726. <dd><code>g</code> - object that has all the necessary drawing functionalities</dd>
  727. </dl>
  728. </section>
  729. </li>
  730. </ul>
  731. </section>
  732. </li>
  733. </ul>
  734. </section>
  735. <!-- ========= END OF CLASS DATA ========= -->
  736. </main>
  737. </div>
  738. </div>
  739. </body>
  740. </html>