extends SpaceInvadersLevel with a ZigZack move of the enemies in
+ Level3.createSingleEnemy(String, double, double, double, double, ObjectController, double) and
+ sets a different Level3.getStartupMessage().
main to start the whole application.
- initializes the levels ArrayList of Playground instances (levels) to be played with one level SpaceInvadersLevel in constructor of GameLoop().
+
main to start the whole application. It calls. runGame(String[]).
+ (levels are automatically added/loaded by constructor of GameLoop()).
Parameters:
args - Java default command line args, forwarded to runGame(String[])
The package contains classes implementing a 'bounding box' area around game objects.
+ The abstract base class Collider provides the abstract method Collider.collidesWith(Collider),
+ which needs to be implemented by child classes to detect and decide whether or not an object with such instance really collides with the other.
+ Collider instances are to be used for game objects (gameobjects); see constructors.
+
+ The benefit of seperating Colliders from visual representations is that the area for collisions can be smaller/bigger/other shape to improve game play experience.
Copies current values of x,y position and speed vx,vy into attributes. These can be restored by call to restoreDynamicState().
restoreDynamicState
publicvoidrestoreDynamicState()
+
Restores formally saved values of x,y position and speed vx,vy from attributes back to the ego object.
+ These values should have been stored before by a call to saveDynamicState(), otherwise all values will be 0.00.
checks the position and respects level boundaries and own radius or width/height set on constructor.
+
extends parent class implementation by a check whether or not the ego object collides with any other "obstacle" object.
+ If yes, the position stays fixed (by using saveDynamicState() and restoreDynamicState().
Is called once every game time step by the game itself. NEVER call this directly, not
necessary!
The method can do whatever it likes, including nothing. The attribute ObjectController.gameObject
contains a reference to the controlled object, which allows access to the Playground the object
belongs to (useful for getting the pixel size in x and y of the playing field. Recommended: when implementing this method, call at the end
- ObjectController.applySpeedVector() method. This is a helper method that sets the new x,y coordinates
+ ObjectController.applySpeedVector() method. This is a helper method that sets the new x,y coordinates
for the ObjectController.gameObject correctly.
The controller package contains Object controllers that govern an objects behavior, without being
involved in its collision or drawing properties. Object controllers react to user actions/inputs
- and govern for example the movement of GameObject instances. They can access
+ and govern for example the movement of GameObject instances. They can access
their parent objects' properties and, by indirection, the properties and methods of the
associated level.
Controllers should be designed in such a way that they implement behavior that is
level-independent. All level-dependent behavior should be implemented in
- Playground.applyGameLogic().
The package gameobjects contains all objects with a visual representation on screen.
+ They can be combined to use controller instances for their behavior (subclasses of ObjectController).
+ The abstract base class is GameObject, which forces child-classes to implement the method
+ GameObject.updateObject().
@@ -93,6 +96,10 @@ Starting from the Overview page, you can browse the doc
Kinds of Pages
The following sections describe the different kinds of pages in this collection.
+
+
Overview
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+
Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:
@@ -155,6 +162,10 @@ The following sections describe the different kinds of pages in this collection.
When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
applies the logic of the level: For now, this is just about deleting shots that are leaving the
+ screen and calling methods 'actionIf..' in case objects collide.
loops over all GameLoop.levels and implements the game loop to update continuously the level
diff --git a/spaceinvaders/GameProject/doc/index-files/index-15.html b/spaceinvaders/GameProject/doc/index-files/index-15.html
index 623b0d8..f26f69c 100644
--- a/spaceinvaders/GameProject/doc/index-files/index-15.html
+++ b/spaceinvaders/GameProject/doc/index-files/index-15.html
@@ -1,11 +1,11 @@
-
+
S-Index
-
+
@@ -57,7 +57,9 @@ loadScripts(document, 'script');
Collision detection implemented by iteration through the own list of Collider
+ and calling their Collider.collidesWith(Collider) method to check collision
+ with the given parameter instance of other GameObject.
diff --git a/spaceinvaders/GameProject/doc/jquery-ui.overrides.css b/spaceinvaders/GameProject/doc/jquery-ui.overrides.css
index f89acb6..1abff95 100644
--- a/spaceinvaders/GameProject/doc/jquery-ui.overrides.css
+++ b/spaceinvaders/GameProject/doc/jquery-ui.overrides.css
@@ -1,26 +1,26 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
*/
.ui-state-active,
diff --git a/spaceinvaders/GameProject/doc/member-search-index.js b/spaceinvaders/GameProject/doc/member-search-index.js
index d62b223..344facf 100644
--- a/spaceinvaders/GameProject/doc/member-search-index.js
+++ b/spaceinvaders/GameProject/doc/member-search-index.js
@@ -1 +1 @@
-memberSearchIndex = [{"p":"controller","c":"ReboundController","l":"ReboundController()","u":"%3Cinit%3E()"},{"p":"controller","c":"ReboundController","l":"updateObject()"}];updateSearchResults();
\ No newline at end of file
+memberSearchIndex = [{"p":"ui","c":"GameUI","l":"ACTION_ABOUT"},{"p":"ui","c":"GameUI","l":"ACTION_BUTTON"},{"p":"ui","c":"GameUI","l":"ACTION_LOAD"},{"p":"ui","c":"GameUI","l":"ACTION_NEW"},{"p":"ui","c":"GameUI","l":"ACTION_PAUSE"},{"p":"ui","c":"GameUI","l":"ACTION_QUIT"},{"p":"ui","c":"GameUI","l":"ACTION_RESET"},{"p":"ui","c":"GameUI","l":"ACTION_SAVE"},{"p":"ui","c":"GameUI","l":"actionPerformed(ActionEvent)","u":"actionPerformed(java.awt.event.ActionEvent)"},{"p":"gameobjects","c":"GameObject","l":"addArtist(Artist)","u":"addArtist(rendering.Artist)"},{"p":"gameobjects","c":"GameObject","l":"addCollider(Collider)","u":"addCollider(collider.Collider)"},{"p":"gameobjects","c":"GameObject","l":"addController(ObjectController)","u":"addController(controller.ObjectController)"},{"p":"playground","c":"Playground","l":"addObject(GameObject)","u":"addObject(gameobjects.GameObject)"},{"p":"playground","c":"Playground","l":"addObjectNow(GameObject)","u":"addObjectNow(gameobjects.GameObject)"},{"p":"gameobjects","c":"AnimatedGameobject","l":"AnimatedGameobject(String, Playground, double, double, double, double, double, Animation, double, String)","u":"%3Cinit%3E(java.lang.String,playground.Playground,double,double,double,double,double,playground.Animation,double,java.lang.String)"},{"p":"playground","c":"Animation","l":"Animation(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"rendering","c":"AnimationArtist","l":"AnimationArtist(GameObject, Animation, double, String, double)","u":"%3Cinit%3E(gameobjects.GameObject,playground.Animation,double,java.lang.String,double)"},{"p":"playground","c":"BreakoutLevelBase","l":"applyGameLogic()"},{"p":"playground","c":"Playground","l":"applyGameLogic()"},{"p":"playground","c":"SpaceInvadersLevel","l":"applyGameLogic()"},{"p":"controller","c":"ObjectController","l":"applySpeedVector()"},{"p":"base","c":"BreakoutGame","l":"BreakoutGame()","u":"%3Cinit%3E()"},{"p":"playground","c":"BreakoutLevelBase","l":"BreakoutLevelBase()","u":"%3Cinit%3E()"},{"p":"collider","c":"CircleCollider","l":"checkCollisionCircCirc(Collider)","u":"checkCollisionCircCirc(collider.Collider)"},{"p":"collider","c":"RectCollider","l":"checkCollisionRectCirc(Collider)","u":"checkCollisionRectCirc(collider.Collider)"},{"p":"collider","c":"RectCollider","l":"checkCollisionRectRect(Collider)","u":"checkCollisionRectRect(collider.Collider)"},{"p":"rendering","c":"CircleArtist","l":"CircleArtist(GameObject)","u":"%3Cinit%3E(gameobjects.GameObject)"},{"p":"rendering","c":"CircleArtist","l":"CircleArtist(GameObject, double, Color)","u":"%3Cinit%3E(gameobjects.GameObject,double,java.awt.Color)"},{"p":"collider","c":"CircleCollider","l":"CircleCollider(String, GameObject, double)","u":"%3Cinit%3E(java.lang.String,gameobjects.GameObject,double)"},{"p":"playground","c":"HighscoreManager","l":"closeFile()"},{"p":"playground","c":"Playground","l":"collectObjects(String, boolean)","u":"collectObjects(java.lang.String,boolean)"},{"p":"collider","c":"Collider","l":"Collider(String, GameObject)","u":"%3Cinit%3E(java.lang.String,gameobjects.GameObject)"},{"p":"collider","c":"CircleCollider","l":"collidesWith(Collider)","u":"collidesWith(collider.Collider)"},{"p":"collider","c":"Collider","l":"collidesWith(Collider)","u":"collidesWith(collider.Collider)"},{"p":"collider","c":"RectCollider","l":"collidesWith(Collider)","u":"collidesWith(collider.Collider)"},{"p":"controller","c":"CollisionAwareEgoController","l":"CollisionAwareEgoController(double)","u":"%3Cinit%3E(double)"},{"p":"controller","c":"CollisionAwareEgoController","l":"CollisionAwareEgoController(double, File)","u":"%3Cinit%3E(double,java.io.File)"},{"p":"gameobjects","c":"GameObject","l":"collisionDetection(GameObject)","u":"collisionDetection(gameobjects.GameObject)"},{"p":"base","c":"BreakoutGame","l":"defineLevels()"},{"p":"base","c":"MovingObjectsGame","l":"defineLevels()"},{"p":"playground","c":"Playground","l":"deleteObject(String)","u":"deleteObject(java.lang.String)"},{"p":"playground","c":"Playground","l":"deleteObjectNow(String)","u":"deleteObjectNow(java.lang.String)"},{"p":"gameobjects","c":"GameObject","l":"draw(Graphics2D)","u":"draw(java.awt.Graphics2D)"},{"p":"rendering","c":"AnimationArtist","l":"draw(Graphics2D)","u":"draw(java.awt.Graphics2D)"},{"p":"rendering","c":"Artist","l":"draw(Graphics2D)","u":"draw(java.awt.Graphics2D)"},{"p":"rendering","c":"CircleArtist","l":"draw(Graphics2D)","u":"draw(java.awt.Graphics2D)"},{"p":"rendering","c":"RectArtist","l":"draw(Graphics2D)","u":"draw(java.awt.Graphics2D)"},{"p":"rendering","c":"TextArtist","l":"draw(Graphics2D)","u":"draw(java.awt.Graphics2D)"},{"p":"controller","c":"EgoController","l":"EgoController(double)","u":"%3Cinit%3E(double)"},{"p":"controller","c":"EgoController","l":"EgoController(double, double)","u":"%3Cinit%3E(double,double)"},{"p":"gameobjects","c":"EgoObject","l":"EgoObject(String, Playground, double, double, double, double, double)","u":"%3Cinit%3E(java.lang.String,playground.Playground,double,double,double,double,double)"},{"p":"playground","c":"SpaceInvadersLevel","l":"EGOSPEED"},{"p":"controller","c":"EnemyController","l":"EnemyController()","u":"%3Cinit%3E()"},{"p":"gameobjects","c":"FallingStar","l":"FallingStar(String, Playground, double, double, double, double, Color, double)","u":"%3Cinit%3E(java.lang.String,playground.Playground,double,double,double,double,java.awt.Color,double)"},{"p":"controller","c":"FallingStarController","l":"FallingStarController()","u":"%3Cinit%3E()"},{"p":"playground","c":"Animation","l":"fileList"},{"p":"playground","c":"Playground","l":"FLAGS_ALL"},{"p":"playground","c":"Playground","l":"FLAGS_GLOBAL"},{"p":"playground","c":"Playground","l":"FLAGS_LEVEL"},{"p":"base","c":"GameLoop","l":"GameLoop()","u":"%3Cinit%3E()"},{"p":"gameobjects","c":"GameObject","l":"GameObject(String, Playground, double, double, double, double)","u":"%3Cinit%3E(java.lang.String,playground.Playground,double,double,double,double)"},{"p":"gameobjects","c":"GameObject","l":"GameObject(String, Playground, ObjectController, double, double, double, double)","u":"%3Cinit%3E(java.lang.String,playground.Playground,controller.ObjectController,double,double,double,double)"},{"p":"playground","c":"BreakoutLevelBase","l":"gameOver()"},{"p":"playground","c":"Playground","l":"gameOver()"},{"p":"playground","c":"SpaceInvadersLevel","l":"gameOver()"},{"p":"ui","c":"GameUI","l":"GameUI(int, int)","u":"%3Cinit%3E(int,int)"},{"p":"gameobjects","c":"AnimatedGameobject","l":"generateColliders()"},{"p":"gameobjects","c":"EgoObject","l":"generateColliders()"},{"p":"gameobjects","c":"GameObject","l":"generateColliders()"},{"p":"gameobjects","c":"RectObject","l":"generateColliders()"},{"p":"gameobjects","c":"TextObject","l":"generateColliders()"},{"p":"ui","c":"GameUI","l":"getCurrentKey()"},{"p":"playground","c":"Animation","l":"getFileList()"},{"p":"gameobjects","c":"GameObject","l":"getGameTime()"},{"p":"playground","c":"Playground","l":"getGameTime()"},{"p":"rendering","c":"Artist","l":"getGameTime()"},{"p":"playground","c":"Playground","l":"getGlobalFlag(String)","u":"getGlobalFlag(java.lang.String)"},{"p":"rendering","c":"AnimationArtist","l":"getH()"},{"p":"gameobjects","c":"RectObject","l":"getHeight()"},{"p":"collider","c":"Collider","l":"getId()"},{"p":"gameobjects","c":"GameObject","l":"getId()"},{"p":"playground","c":"Animation","l":"getImageList()"},{"p":"playground","c":"Playground","l":"getKeyEvents()"},{"p":"ui","c":"GameUI","l":"getKeyEvents()"},{"p":"playground","c":"Playground","l":"getLevelFlag(String)","u":"getLevelFlag(java.lang.String)"},{"p":"playground","c":"Playground","l":"getMouseEvents()"},{"p":"ui","c":"GameUI","l":"getMouseEvents()"},{"p":"ui","c":"GameUI","l":"getNewAction()"},{"p":"playground","c":"Playground","l":"getObject(String)","u":"getObject(java.lang.String)"},{"p":"gameobjects","c":"GameObject","l":"getObjectController()"},{"p":"gameobjects","c":"GameObject","l":"getObjectFlag(String)","u":"getObjectFlag(java.lang.String)"},{"p":"playground","c":"Playground","l":"getOrCreateGlobalFlag(String, Object)","u":"getOrCreateGlobalFlag(java.lang.String,java.lang.Object)"},{"p":"playground","c":"Playground","l":"getOrCreateLevelFlag(String, Object)","u":"getOrCreateLevelFlag(java.lang.String,java.lang.Object)"},{"p":"gameobjects","c":"GameObject","l":"getOrCreateObjectFlag(String, Object)","u":"getOrCreateObjectFlag(java.lang.String,java.lang.Object)"},{"p":"controller","c":"ObjectController","l":"getPlayground()"},{"p":"gameobjects","c":"GameObject","l":"getPlayground()"},{"p":"playground","c":"Animation","l":"getShowtimeList()"},{"p":"playground","c":"Playground","l":"getSizeX()"},{"p":"playground","c":"Playground","l":"getSizeY()"},{"p":"gameobjects","c":"TextObject","l":"getText()"},{"p":"rendering","c":"TextArtist","l":"getText()"},{"p":"rendering","c":"TextArtist","l":"getTextHeight()"},{"p":"rendering","c":"TextArtist","l":"getTextWidth()"},{"p":"controller","c":"ObjectController","l":"getTimestep()"},{"p":"playground","c":"Playground","l":"getTimestep()"},{"p":"controller","c":"ObjectController","l":"getVX()"},{"p":"gameobjects","c":"GameObject","l":"getVX()"},{"p":"rendering","c":"Artist","l":"getVX()"},{"p":"controller","c":"ObjectController","l":"getVY()"},{"p":"gameobjects","c":"GameObject","l":"getVY()"},{"p":"rendering","c":"Artist","l":"getVY()"},{"p":"rendering","c":"AnimationArtist","l":"getW()"},{"p":"gameobjects","c":"RectObject","l":"getWidth()"},{"p":"collider","c":"Collider","l":"getX()"},{"p":"controller","c":"ObjectController","l":"getX()"},{"p":"gameobjects","c":"GameObject","l":"getX()"},{"p":"rendering","c":"Artist","l":"getX()"},{"p":"collider","c":"Collider","l":"getY()"},{"p":"controller","c":"ObjectController","l":"getY()"},{"p":"gameobjects","c":"GameObject","l":"getY()"},{"p":"rendering","c":"Artist","l":"getY()"},{"p":"ui","c":"GameUI","l":"grabFocus()"},{"p":"playground","c":"HighscoreManager","l":"HighscoreManager()","u":"%3Cinit%3E()"},{"p":"collider","c":"Collider","l":"id"},{"p":"gameobjects","c":"GameObject","l":"id"},{"p":"playground","c":"Animation","l":"imageList"},{"p":"gameobjects","c":"GameObject","l":"isActive()"},{"p":"ui","c":"GameUI","l":"isPainting()"},{"p":"playground","c":"Playground","l":"isPaused()"},{"p":"playground","c":"Level1","l":"Level1()","u":"%3Cinit%3E()"},{"p":"playground","c":"Level2","l":"Level2()","u":"%3Cinit%3E()"},{"p":"playground","c":"Level3","l":"Level3()","u":"%3Cinit%3E()"},{"p":"playground","c":"Level4","l":"Level4()","u":"%3Cinit%3E()"},{"p":"playground","c":"Level5","l":"Level5()","u":"%3Cinit%3E()"},{"p":"playground","c":"Level6","l":"Level6()","u":"%3Cinit%3E()"},{"p":"playground","c":"Level7","l":"Level7()","u":"%3Cinit%3E()"},{"p":"playground","c":"LevelBoss","l":"LevelBoss()","u":"%3Cinit%3E()"},{"p":"playground","c":"BreakoutLevelBase","l":"levelFinished()"},{"p":"playground","c":"Playground","l":"levelFinished()"},{"p":"playground","c":"SpaceInvadersLevel","l":"levelFinished()"},{"p":"playground","c":"LevelHitTwice","l":"LevelHitTwice()","u":"%3Cinit%3E()"},{"p":"playground","c":"LevelMovingHitObjects","l":"LevelMovingHitObjects()","u":"%3Cinit%3E()"},{"p":"playground","c":"LevelMovingObjects","l":"LevelMovingObjects()","u":"%3Cinit%3E()"},{"p":"playground","c":"LevelWithBox","l":"LevelWithBox()","u":"%3Cinit%3E()"},{"p":"controller","c":"LimitedTimeController","l":"LimitedTimeController(double, double)","u":"%3Cinit%3E(double,double)"},{"p":"base","c":"BreakoutGame","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"base","c":"GameLoop","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"base","c":"MovingObjectsGame","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"base","c":"MultiLevelGame","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"gameobjects","c":"GameObject","l":"MASK"},{"p":"playground","c":"Level4","l":"MAX_HITS"},{"p":"playground","c":"LevelHitTwice","l":"MAX_HITS"},{"p":"controller","c":"MineController","l":"MineController(double)","u":"%3Cinit%3E(double)"},{"p":"base","c":"MovingObjectsGame","l":"MovingObjectsGame()","u":"%3Cinit%3E()"},{"p":"base","c":"MultiLevelGame","l":"MultiLevelGame()","u":"%3Cinit%3E()"},{"p":"playground","c":"Music","l":"Music()","u":"%3Cinit%3E()"},{"p":"playground","c":"Music","l":"music(File)","u":"music(java.io.File)"},{"p":"controller","c":"ObjectController","l":"ObjectController()","u":"%3Cinit%3E()"},{"p":"controller","c":"EgoController","l":"onDown(KeyEvent, GameObject)","u":"onDown(java.awt.event.KeyEvent,gameobjects.GameObject)"},{"p":"controller","c":"EgoController","l":"onLeft(KeyEvent, GameObject)","u":"onLeft(java.awt.event.KeyEvent,gameobjects.GameObject)"},{"p":"controller","c":"EgoController","l":"onRight(KeyEvent, GameObject)","u":"onRight(java.awt.event.KeyEvent,gameobjects.GameObject)"},{"p":"controller","c":"CollisionAwareEgoController","l":"onSpace(KeyEvent, GameObject)","u":"onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)"},{"p":"controller","c":"EgoController","l":"onSpace(KeyEvent, GameObject)","u":"onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)"},{"p":"controller","c":"EgoController","l":"onStop(KeyEvent, GameObject)","u":"onStop(java.awt.event.KeyEvent,gameobjects.GameObject)"},{"p":"controller","c":"EgoController","l":"onUp(KeyEvent, GameObject)","u":"onUp(java.awt.event.KeyEvent,gameobjects.GameObject)"},{"p":"playground","c":"Playground","l":"Playground()","u":"%3Cinit%3E()"},{"p":"playground","c":"BreakoutLevelBase","l":"preferredSizeX()"},{"p":"playground","c":"Playground","l":"preferredSizeX()"},{"p":"playground","c":"SpaceInvadersLevel","l":"preferredSizeX()"},{"p":"playground","c":"BreakoutLevelBase","l":"preferredSizeY()"},{"p":"playground","c":"Playground","l":"preferredSizeY()"},{"p":"playground","c":"SpaceInvadersLevel","l":"preferredSizeY()"},{"p":"playground","c":"BreakoutLevelBase","l":"prepareLevel(String)","u":"prepareLevel(java.lang.String)"},{"p":"playground","c":"LevelMovingHitObjects","l":"prepareLevel(String)","u":"prepareLevel(java.lang.String)"},{"p":"playground","c":"LevelMovingObjects","l":"prepareLevel(String)","u":"prepareLevel(java.lang.String)"},{"p":"playground","c":"LevelWithBox","l":"prepareLevel(String)","u":"prepareLevel(java.lang.String)"},{"p":"playground","c":"Playground","l":"prepareLevel(String)","u":"prepareLevel(java.lang.String)"},{"p":"playground","c":"SpaceInvadersLevel","l":"prepareLevel(String)","u":"prepareLevel(java.lang.String)"},{"p":"playground","c":"Playground","l":"processKeyEvents(Stack)","u":"processKeyEvents(java.util.Stack)"},{"p":"playground","c":"Playground","l":"processMouseEvents(Stack)","u":"processMouseEvents(java.util.Stack)"},{"p":"gameobjects","c":"GameObject","l":"RADIUS"},{"p":"playground","c":"HighscoreManager","l":"readHSFromFile()"},{"p":"controller","c":"ReboundController","l":"ReboundController()","u":"%3Cinit%3E()"},{"p":"controller","c":"ReboundController2","l":"ReboundController2()","u":"%3Cinit%3E()"},{"p":"gameobjects","c":"GameObject","l":"RECTANGLE"},{"p":"rendering","c":"RectArtist","l":"RectArtist(GameObject, double, double, Color)","u":"%3Cinit%3E(gameobjects.GameObject,double,double,java.awt.Color)"},{"p":"collider","c":"RectCollider","l":"RectCollider(String, GameObject, double, double)","u":"%3Cinit%3E(java.lang.String,gameobjects.GameObject,double,double)"},{"p":"gameobjects","c":"RectObject","l":"RectObject(String, Playground, double, double, double, double, double, double, Color)","u":"%3Cinit%3E(java.lang.String,playground.Playground,double,double,double,double,double,double,java.awt.Color)"},{"p":"playground","c":"Playground","l":"redraw(Graphics2D)","u":"redraw(java.awt.Graphics2D)"},{"p":"playground","c":"BreakoutLevelBase","l":"redrawLevel(Graphics2D)","u":"redrawLevel(java.awt.Graphics2D)"},{"p":"playground","c":"Playground","l":"redrawLevel(Graphics2D)","u":"redrawLevel(java.awt.Graphics2D)"},{"p":"playground","c":"SpaceInvadersLevel","l":"redrawLevel(Graphics2D)","u":"redrawLevel(java.awt.Graphics2D)"},{"p":"ui","c":"GameUI","l":"repaint()"},{"p":"playground","c":"Playground","l":"reset()"},{"p":"ui","c":"GameUI","l":"resetAction()"},{"p":"playground","c":"Playground","l":"resetFlags(int)"},{"p":"playground","c":"BreakoutLevelBase","l":"resetRequested()"},{"p":"controller","c":"CollisionAwareEgoController","l":"restoreDynamicState()"},{"p":"base","c":"GameLoop","l":"runGame(String[])","u":"runGame(java.lang.String[])"},{"p":"playground","c":"SaveGame","l":"save()"},{"p":"controller","c":"CollisionAwareEgoController","l":"saveDynamicState()"},{"p":"playground","c":"SaveGame","l":"SaveGame()","u":"%3Cinit%3E()"},{"p":"gameobjects","c":"GameObject","l":"scol"},{"p":"gameobjects","c":"GameObject","l":"setActive(boolean)"},{"p":"gameobjects","c":"GameObject","l":"setColliders(LinkedList)","u":"setColliders(java.util.LinkedList)"},{"p":"gameobjects","c":"GameObject","l":"setComponentProperty(String, String, Object)","u":"setComponentProperty(java.lang.String,java.lang.String,java.lang.Object)"},{"p":"collider","c":"Collider","l":"setController(ObjectController)","u":"setController(controller.ObjectController)"},{"p":"controller","c":"ObjectController","l":"setDummy(String)","u":"setDummy(java.lang.String)"},{"p":"playground","c":"Playground","l":"setGameTime(double)"},{"p":"playground","c":"Playground","l":"setGlobalFlag(String, Object)","u":"setGlobalFlag(java.lang.String,java.lang.Object)"},{"p":"playground","c":"Playground","l":"setLevelFlag(String, Object)","u":"setLevelFlag(java.lang.String,java.lang.Object)"},{"p":"collider","c":"Collider","l":"setObject(GameObject)","u":"setObject(gameobjects.GameObject)"},{"p":"controller","c":"ObjectController","l":"setObject(GameObject)","u":"setObject(gameobjects.GameObject)"},{"p":"gameobjects","c":"GameObject","l":"setObjectController(ObjectController)","u":"setObjectController(controller.ObjectController)"},{"p":"gameobjects","c":"GameObject","l":"setObjectFlag(String, Object)","u":"setObjectFlag(java.lang.String,java.lang.Object)"},{"p":"collider","c":"Collider","l":"setOffsets(double, double)","u":"setOffsets(double,double)"},{"p":"ui","c":"GameUI","l":"setPainting()"},{"p":"playground","c":"Playground","l":"setPaused(boolean)"},{"p":"collider","c":"Collider","l":"setPlayground(Playground)","u":"setPlayground(playground.Playground)"},{"p":"controller","c":"ObjectController","l":"setPlayground(Playground)","u":"setPlayground(playground.Playground)"},{"p":"gameobjects","c":"GameObject","l":"setPlayground(Playground)","u":"setPlayground(playground.Playground)"},{"p":"ui","c":"GameUI","l":"setPlayground(Playground)","u":"setPlayground(playground.Playground)"},{"p":"gameobjects","c":"TextObject","l":"setText(String)","u":"setText(java.lang.String)"},{"p":"rendering","c":"TextArtist","l":"setText(String)","u":"setText(java.lang.String)"},{"p":"rendering","c":"TextArtist","l":"setTextHeight(double)"},{"p":"rendering","c":"TextArtist","l":"setTextWidth(double)"},{"p":"playground","c":"Playground","l":"setTimestep(double)"},{"p":"controller","c":"ObjectController","l":"setVX(double)"},{"p":"gameobjects","c":"GameObject","l":"setVX(double)"},{"p":"controller","c":"ObjectController","l":"setVY(double)"},{"p":"gameobjects","c":"GameObject","l":"setVY(double)"},{"p":"controller","c":"ObjectController","l":"setX(double)"},{"p":"gameobjects","c":"GameObject","l":"setX(double)"},{"p":"controller","c":"ObjectController","l":"setY(double)"},{"p":"gameobjects","c":"GameObject","l":"setY(double)"},{"p":"playground","c":"SpaceInvadersLevel","l":"SHOTSPEED"},{"p":"playground","c":"Animation","l":"showtimeList"},{"p":"controller","c":"SimpleShotController","l":"SimpleShotController()","u":"%3Cinit%3E()"},{"p":"base","c":"GameLoop","l":"SIZEX"},{"p":"base","c":"GameLoop","l":"SIZEY"},{"p":"playground","c":"SpaceInvadersLevel","l":"SpaceInvadersLevel()","u":"%3Cinit%3E()"},{"p":"playground","c":"SpaceInvadersLevelAua","l":"SpaceInvadersLevelAua()","u":"%3Cinit%3E()"},{"p":"controller","c":"CollisionAwareEgoController","l":"stopObject()"},{"p":"controller","c":"EgoController","l":"stopObject()"},{"p":"rendering","c":"TextArtist","l":"TextArtist(GameObject, String, int, Color)","u":"%3Cinit%3E(gameobjects.GameObject,java.lang.String,int,java.awt.Color)"},{"p":"gameobjects","c":"TextObject","l":"TextObject(String, Playground, double, double, double, double, String, int, Color)","u":"%3Cinit%3E(java.lang.String,playground.Playground,double,double,double,double,java.lang.String,int,java.awt.Color)"},{"p":"playground","c":"Playground","l":"togglePause()"},{"p":"collider","c":"CircleCollider","l":"toString()"},{"p":"collider","c":"Collider","l":"toString()"},{"p":"collider","c":"RectCollider","l":"toString()"},{"p":"controller","c":"EgoController","l":"updateObject()"},{"p":"controller","c":"EnemyController","l":"updateObject()"},{"p":"controller","c":"FallingStarController","l":"updateObject()"},{"p":"controller","c":"LimitedTimeController","l":"updateObject()"},{"p":"controller","c":"MineController","l":"updateObject()"},{"p":"controller","c":"ObjectController","l":"updateObject()"},{"p":"controller","c":"ReboundController","l":"updateObject()"},{"p":"controller","c":"ReboundController2","l":"updateObject()"},{"p":"controller","c":"SimpleShotController","l":"updateObject()"},{"p":"controller","c":"ZickZackController","l":"updateObject()"},{"p":"gameobjects","c":"GameObject","l":"updateObject()"},{"p":"playground","c":"Playground","l":"updateObjects()"},{"p":"ui","c":"GameUI","l":"waitWhilePainting()"},{"p":"playground","c":"HighscoreManager","l":"writeHSToFile(Integer, Integer)","u":"writeHSToFile(java.lang.Integer,java.lang.Integer)"},{"p":"controller","c":"ZickZackController","l":"ZickZackController(double, double)","u":"%3Cinit%3E(double,double)"}];updateSearchResults();
\ No newline at end of file
diff --git a/spaceinvaders/GameProject/doc/overview-summary.html b/spaceinvaders/GameProject/doc/overview-summary.html
index 31860dc..a0fc0ee 100644
--- a/spaceinvaders/GameProject/doc/overview-summary.html
+++ b/spaceinvaders/GameProject/doc/overview-summary.html
@@ -1,11 +1,11 @@
-
+
Generated Documentation (Untitled)
-
+
diff --git a/spaceinvaders/GameProject/doc/overview-tree.html b/spaceinvaders/GameProject/doc/overview-tree.html
index 4d94a1f..16557cf 100644
--- a/spaceinvaders/GameProject/doc/overview-tree.html
+++ b/spaceinvaders/GameProject/doc/overview-tree.html
@@ -1,11 +1,11 @@
-
+
Class Hierarchy
-
+
@@ -28,6 +28,7 @@ loadScripts(document, 'script');
checks for interactions between GameObjects; notably ball with ego and ball with brick.
+ In case of detected collisions, it calls either actionIfBallHitsBrick(GameObject, GameObject)
+ or actionIfBallHitsEgo(GameObject, GameObject).
+ Called every game loop.
Prepares a generic Breakout-Type level. This method relies on the methods createEgoObject(),
+ createBall() and createBrick(int, int), among others, which are meant to be overwritten
+ in subclasses.
+ Attention: the attributes ball and ego need to be set properly to GameObject
+ instances when implementing this method prepareLevel(String).
initially sets up the level. Not called by user interaction, but called every time a layer is
+ restarted from scratch. So make sure that this is possible. Here, resources are loaded only
+ once even if method is called several times.
initially sets up the level. Not called by user interaction, but called every time a layer is
+ restarted from scratch. So make sure that this is possible. Here, resources are loaded only
+ once even if method is called several times.
extends SpaceInvadersLevel with a ZigZack move of the enemies in
Level3.createSingleEnemy(String, double, double, double, double, ObjectController, double) and
sets a different Level3.getStartupMessage().
The package playground contains all level specific logic and control of level logic.
+ The structure and general logic (with global and local flags to be stored/used)
+ is provided in abstract base class Playground.
+ Child-classes implement specific logic for one level and game type (e.g. SpaceInvadersLevel).
+
+ Generally, the base class Playground supports totally different game types to be implemented.
extends SpaceInvadersLevel with a ZigZack move of the enemies in
Level3.createSingleEnemy(String, double, double, double, double, ObjectController, double) and
sets a different Level3.getStartupMessage().
diff --git a/spaceinvaders/GameProject/doc/script.js b/spaceinvaders/GameProject/doc/script.js
index 864989c..0765364 100644
--- a/spaceinvaders/GameProject/doc/script.js
+++ b/spaceinvaders/GameProject/doc/script.js
@@ -1,26 +1,26 @@
/*
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
*/
var moduleSearchIndex;
diff --git a/spaceinvaders/GameProject/doc/search.js b/spaceinvaders/GameProject/doc/search.js
index 2246cdd..df0e6fb 100644
--- a/spaceinvaders/GameProject/doc/search.js
+++ b/spaceinvaders/GameProject/doc/search.js
@@ -1,26 +1,26 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
*
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
*
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
*
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
*/
var noResult = {l: "No results found"};
diff --git a/spaceinvaders/GameProject/doc/tag-search-index.js b/spaceinvaders/GameProject/doc/tag-search-index.js
index 0367dae..f2a440c 100644
--- a/spaceinvaders/GameProject/doc/tag-search-index.js
+++ b/spaceinvaders/GameProject/doc/tag-search-index.js
@@ -1 +1 @@
-tagSearchIndex = [];updateSearchResults();
\ No newline at end of file
+tagSearchIndex = [{"l":"Constant Field Values","h":"","u":"constant-values.html"}];updateSearchResults();
\ No newline at end of file
diff --git a/spaceinvaders/GameProject/doc/type-search-index.js b/spaceinvaders/GameProject/doc/type-search-index.js
index 74569fd..e111866 100644
--- a/spaceinvaders/GameProject/doc/type-search-index.js
+++ b/spaceinvaders/GameProject/doc/type-search-index.js
@@ -1 +1 @@
-typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"controller","l":"ReboundController"}];updateSearchResults();
\ No newline at end of file
+typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"gameobjects","l":"AnimatedGameobject"},{"p":"playground","l":"Animation"},{"p":"rendering","l":"AnimationArtist"},{"p":"rendering","l":"Artist"},{"p":"base","l":"BreakoutGame"},{"p":"playground","l":"BreakoutLevelBase"},{"p":"rendering","l":"CircleArtist"},{"p":"collider","l":"CircleCollider"},{"p":"collider","l":"Collider"},{"p":"controller","l":"CollisionAwareEgoController"},{"p":"controller","l":"EgoController"},{"p":"gameobjects","l":"EgoObject"},{"p":"controller","l":"EnemyController"},{"p":"gameobjects","l":"FallingStar"},{"p":"controller","l":"FallingStarController"},{"p":"base","l":"GameLoop"},{"p":"gameobjects","l":"GameObject"},{"p":"ui","l":"GameUI"},{"p":"playground","l":"HighscoreManager"},{"p":"playground","l":"Level1"},{"p":"playground","l":"Level2"},{"p":"playground","l":"Level3"},{"p":"playground","l":"Level4"},{"p":"playground","l":"Level5"},{"p":"playground","l":"Level6"},{"p":"playground","l":"Level7"},{"p":"playground","l":"LevelBoss"},{"p":"playground","l":"LevelHitTwice"},{"p":"playground","l":"LevelMovingHitObjects"},{"p":"playground","l":"LevelMovingObjects"},{"p":"playground","l":"LevelWithBox"},{"p":"controller","l":"LimitedTimeController"},{"p":"controller","l":"MineController"},{"p":"base","l":"MovingObjectsGame"},{"p":"base","l":"MultiLevelGame"},{"p":"playground","l":"Music"},{"p":"controller","l":"ObjectController"},{"p":"playground","l":"Playground"},{"p":"controller","l":"ReboundController"},{"p":"controller","l":"ReboundController2"},{"p":"rendering","l":"RectArtist"},{"p":"collider","l":"RectCollider"},{"p":"gameobjects","l":"RectObject"},{"p":"playground","l":"SaveGame"},{"p":"controller","l":"SimpleShotController"},{"p":"playground","l":"SpaceInvadersLevel"},{"p":"playground","l":"SpaceInvadersLevelAua"},{"p":"rendering","l":"TextArtist"},{"p":"gameobjects","l":"TextObject"},{"p":"controller","l":"ZickZackController"}];updateSearchResults();
\ No newline at end of file
diff --git a/spaceinvaders/GameProject/doc/ui/GameUI.html b/spaceinvaders/GameProject/doc/ui/GameUI.html
index a2a7c21..29951e1 100644
--- a/spaceinvaders/GameProject/doc/ui/GameUI.html
+++ b/spaceinvaders/GameProject/doc/ui/GameUI.html
@@ -1,11 +1,11 @@
-
+
GameUI
-
+
diff --git a/spaceinvaders/GameProject/doc/ui/class-use/GameUI.html b/spaceinvaders/GameProject/doc/ui/class-use/GameUI.html
index d730a96..ac68d72 100644
--- a/spaceinvaders/GameProject/doc/ui/class-use/GameUI.html
+++ b/spaceinvaders/GameProject/doc/ui/class-use/GameUI.html
@@ -1,11 +1,11 @@
-
+
Uses of Class ui.GameUI
-
+
diff --git a/spaceinvaders/GameProject/doc/ui/package-summary.html b/spaceinvaders/GameProject/doc/ui/package-summary.html
index ca586c8..5f7f405 100644
--- a/spaceinvaders/GameProject/doc/ui/package-summary.html
+++ b/spaceinvaders/GameProject/doc/ui/package-summary.html
@@ -1,11 +1,11 @@
-
+
ui
-
+
diff --git a/spaceinvaders/GameProject/doc/ui/package-tree.html b/spaceinvaders/GameProject/doc/ui/package-tree.html
index 3799561..f8a158e 100644
--- a/spaceinvaders/GameProject/doc/ui/package-tree.html
+++ b/spaceinvaders/GameProject/doc/ui/package-tree.html
@@ -1,11 +1,11 @@
-
+
ui Class Hierarchy
-
+
diff --git a/spaceinvaders/GameProject/doc/ui/package-use.html b/spaceinvaders/GameProject/doc/ui/package-use.html
index 2ad4761..f2122f6 100644
--- a/spaceinvaders/GameProject/doc/ui/package-use.html
+++ b/spaceinvaders/GameProject/doc/ui/package-use.html
@@ -1,11 +1,11 @@
-
+
Uses of Package ui
-
+
diff --git a/spaceinvaders/GameProject/log/log4j.log b/spaceinvaders/GameProject/log/log4j.log
index 8af9426..9c3e258 100644
--- a/spaceinvaders/GameProject/log/log4j.log
+++ b/spaceinvaders/GameProject/log/log4j.log
@@ -1226,3 +1226,62 @@
2022-05-19 14:04:49,855 INFO playground.SpaceInvadersLevel - no enemies left, level done.
2022-05-19 14:04:49,856 INFO base.GameLoop - reached end of levels
2022-05-19 14:04:49,856 INFO base.GameLoop - Game ends. Bye.
+2022-05-27 22:05:10,869 INFO base.GameLoop - GUI starts
+2022-05-27 22:05:16,446 INFO base.GameLoop - GUI NEW
+2022-05-27 22:05:16,447 INFO playground.SpaceInvadersLevel - PREPARE
+2022-05-27 22:05:16,602 INFO playground.Animation - img added .\video/sweetAlien0.png
+2022-05-27 22:05:16,626 INFO playground.Animation - img added .\video/sweetAlien1.png
+2022-05-27 22:05:16,636 INFO playground.Animation - img added .\video/sweetAlien2.png
+2022-05-27 22:05:16,650 INFO playground.Animation - img added .\video/sweetAlien3.png
+2022-05-27 22:05:16,666 INFO playground.Animation - img added .\video/sweetAlien4.png
+2022-05-27 22:05:16,682 INFO playground.Animation - img added .\video/sweetAlien5.png
+2022-05-27 22:05:16,693 INFO playground.Animation - img added .\video/sweetAlien6.png
+2022-05-27 22:05:16,705 INFO playground.Animation - img added .\video/sweetAlien7.png
+2022-05-27 22:05:16,744 INFO playground.Animation - img added .\video/heart0.png
+2022-05-27 22:05:16,754 INFO playground.Animation - img added .\video/heart1.png
+2022-05-27 22:05:16,776 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
+2022-05-27 22:16:28,011 INFO base.GameLoop - GUI starts
+2022-05-27 22:16:33,395 INFO base.GameLoop - GUI NEW
+2022-05-27 22:16:33,397 INFO playground.SpaceInvadersLevel - PREPARE
+2022-05-27 22:16:33,528 INFO playground.Animation - img added .\video/sweetAlien0.png
+2022-05-27 22:16:33,552 INFO playground.Animation - img added .\video/sweetAlien1.png
+2022-05-27 22:16:33,562 INFO playground.Animation - img added .\video/sweetAlien2.png
+2022-05-27 22:16:33,577 INFO playground.Animation - img added .\video/sweetAlien3.png
+2022-05-27 22:16:33,593 INFO playground.Animation - img added .\video/sweetAlien4.png
+2022-05-27 22:16:33,607 INFO playground.Animation - img added .\video/sweetAlien5.png
+2022-05-27 22:16:33,618 INFO playground.Animation - img added .\video/sweetAlien6.png
+2022-05-27 22:16:33,628 INFO playground.Animation - img added .\video/sweetAlien7.png
+2022-05-27 22:16:33,665 INFO playground.Animation - img added .\video/heart0.png
+2022-05-27 22:16:33,675 INFO playground.Animation - img added .\video/heart1.png
+2022-05-27 22:16:33,690 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
+2022-05-27 22:16:38,380 INFO base.GameLoop - Game ends. Bye.
+2022-05-27 22:30:39,422 INFO base.GameLoop - GUI starts
+2022-05-27 22:30:41,525 INFO base.GameLoop - GUI NEW
+2022-05-27 22:30:41,527 INFO playground.SpaceInvadersLevel - PREPARE
+2022-05-27 22:30:41,662 INFO playground.Animation - img added .\video/sweetAlien0.png
+2022-05-27 22:30:41,688 INFO playground.Animation - img added .\video/sweetAlien1.png
+2022-05-27 22:30:41,697 INFO playground.Animation - img added .\video/sweetAlien2.png
+2022-05-27 22:30:41,712 INFO playground.Animation - img added .\video/sweetAlien3.png
+2022-05-27 22:30:41,730 INFO playground.Animation - img added .\video/sweetAlien4.png
+2022-05-27 22:30:41,745 INFO playground.Animation - img added .\video/sweetAlien5.png
+2022-05-27 22:30:41,756 INFO playground.Animation - img added .\video/sweetAlien6.png
+2022-05-27 22:30:41,767 INFO playground.Animation - img added .\video/sweetAlien7.png
+2022-05-27 22:30:41,802 INFO playground.Animation - img added .\video/heart0.png
+2022-05-27 22:30:41,816 INFO playground.Animation - img added .\video/heart1.png
+2022-05-27 22:30:41,833 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
+2022-05-27 22:30:45,443 INFO base.GameLoop - Game ends. Bye.
+2022-05-27 22:30:57,375 INFO base.GameLoop - GUI starts
+2022-05-27 22:31:01,040 INFO base.GameLoop - GUI NEW
+2022-05-27 22:31:01,042 INFO playground.SpaceInvadersLevel - PREPARE
+2022-05-27 22:31:01,178 INFO playground.Animation - img added .\video/sweetAlien0.png
+2022-05-27 22:31:01,204 INFO playground.Animation - img added .\video/sweetAlien1.png
+2022-05-27 22:31:01,214 INFO playground.Animation - img added .\video/sweetAlien2.png
+2022-05-27 22:31:01,227 INFO playground.Animation - img added .\video/sweetAlien3.png
+2022-05-27 22:31:01,241 INFO playground.Animation - img added .\video/sweetAlien4.png
+2022-05-27 22:31:01,254 INFO playground.Animation - img added .\video/sweetAlien5.png
+2022-05-27 22:31:01,266 INFO playground.Animation - img added .\video/sweetAlien6.png
+2022-05-27 22:31:01,276 INFO playground.Animation - img added .\video/sweetAlien7.png
+2022-05-27 22:31:01,313 INFO playground.Animation - img added .\video/heart0.png
+2022-05-27 22:31:01,322 INFO playground.Animation - img added .\video/heart1.png
+2022-05-27 22:31:01,338 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
+2022-05-27 22:31:33,238 INFO base.GameLoop - Game ends. Bye.
diff --git a/spaceinvaders/GameProject/src/base/MovingObjectsGame.java b/spaceinvaders/GameProject/src/base/MovingObjectsGame.java
index 6086e9f..7191923 100644
--- a/spaceinvaders/GameProject/src/base/MovingObjectsGame.java
+++ b/spaceinvaders/GameProject/src/base/MovingObjectsGame.java
@@ -32,7 +32,7 @@ public class MovingObjectsGame extends GameLoop {
@Override
public void defineLevels() {
this.resetLevels();
- this.addLevel(new LevelMovingObjects());
+ //this.addLevel(new LevelMovingObjects());
this.addLevel(new LevelMovingHitObjects());
}
diff --git a/spaceinvaders/GameProject/src/playground/LevelMovingHitObjects.java b/spaceinvaders/GameProject/src/playground/LevelMovingHitObjects.java
index 533b41a..580d97a 100644
--- a/spaceinvaders/GameProject/src/playground/LevelMovingHitObjects.java
+++ b/spaceinvaders/GameProject/src/playground/LevelMovingHitObjects.java
@@ -1,5 +1,11 @@
package playground;
+import java.awt.Color;
+
+import controller.ReboundController;
+import gameobjects.GameObject;
+import gameobjects.RectObject;
+import collider.*;
/**
* Level that creates two RectObjects moving around and if ego is hit by them game is directly lost
@@ -11,7 +17,33 @@ public class LevelMovingHitObjects extends SpaceInvadersLevel {
// FIXME add logger here
- //FIXME add your method overrides here
+ @Override
+ public void prepareLevel(String id) {
+ super.prepareLevel(id);
+ RectObject blueBox = new RectObject("fly_enemy1", this, 300, 300, 75, 40, 40, 40, Color.BLUE);
+ this.addObject(blueBox);
+ ReboundController boxControl = new ReboundController();
+ blueBox.addController(boxControl);
+ RectCollider colliderBlue = new RectCollider("ColliderBlue", blueBox, 40, 40);
+ blueBox.addCollider(colliderBlue);
+ RectObject greenBox = new RectObject("fly_enemy2", this, 200, 200, 20, 90, 40, 40, Color.GREEN);
+ this.addObject(greenBox);
+ ReboundController boxControl_2 = new ReboundController();
+ greenBox.addController(boxControl_2);
+ RectCollider colliderGreen = new RectCollider("ColliderGreen", greenBox, 40, 40);
+ greenBox.addCollider(colliderGreen);
+ }
+
+ @Override
+ void actionIfEgoCollidesWithEnemy(GameObject enemy, GameObject ego) {
+ super.actionIfEgoCollidesWithEnemy(enemy, ego);
+ if(enemy.id.equals("fly_enemy1") || enemy.id.equals("fly_enemy2")) {
+ this.lost = true;
+ HighscoreManager.writeHSToFile((Integer) Playground.getGlobalFlag("points"),
+ (Integer) Playground.getGlobalFlag("highscore"));
+ }
+ }
+