diff --git a/spaceinvaders/GameProject/bin/.gitignore b/spaceinvaders/GameProject/bin/.gitignore deleted file mode 100644 index 61c497a..0000000 --- a/spaceinvaders/GameProject/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/playground/ diff --git a/spaceinvaders/GameProject/bin/base/MovingObjectsGame.class b/spaceinvaders/GameProject/bin/base/MovingObjectsGame.class new file mode 100644 index 0000000..078d123 Binary files /dev/null and b/spaceinvaders/GameProject/bin/base/MovingObjectsGame.class differ diff --git a/spaceinvaders/GameProject/bin/collider/package-info.class b/spaceinvaders/GameProject/bin/collider/package-info.class new file mode 100644 index 0000000..4910e13 Binary files /dev/null and b/spaceinvaders/GameProject/bin/collider/package-info.class differ diff --git a/spaceinvaders/GameProject/bin/controller/CollisionAwareEgoController.class b/spaceinvaders/GameProject/bin/controller/CollisionAwareEgoController.class index b172cc2..703a19e 100644 Binary files a/spaceinvaders/GameProject/bin/controller/CollisionAwareEgoController.class and b/spaceinvaders/GameProject/bin/controller/CollisionAwareEgoController.class differ diff --git a/spaceinvaders/GameProject/bin/controller/EgoController.class b/spaceinvaders/GameProject/bin/controller/EgoController.class index b6d0899..5b3695b 100644 Binary files a/spaceinvaders/GameProject/bin/controller/EgoController.class and b/spaceinvaders/GameProject/bin/controller/EgoController.class differ diff --git a/spaceinvaders/GameProject/bin/controller/ObjectController.class b/spaceinvaders/GameProject/bin/controller/ObjectController.class index dce7b55..8d0d429 100644 Binary files a/spaceinvaders/GameProject/bin/controller/ObjectController.class and b/spaceinvaders/GameProject/bin/controller/ObjectController.class differ diff --git a/spaceinvaders/GameProject/bin/gameobjects/package-info.class b/spaceinvaders/GameProject/bin/gameobjects/package-info.class new file mode 100644 index 0000000..42eb12a Binary files /dev/null and b/spaceinvaders/GameProject/bin/gameobjects/package-info.class differ diff --git a/spaceinvaders/GameProject/bin/log4j2.xml b/spaceinvaders/GameProject/bin/log4j2.xml index 87ecf74..21a7607 100644 --- a/spaceinvaders/GameProject/bin/log4j2.xml +++ b/spaceinvaders/GameProject/bin/log4j2.xml @@ -7,7 +7,7 @@ - + diff --git a/spaceinvaders/GameProject/bin/playground/LevelMovingObjects.class b/spaceinvaders/GameProject/bin/playground/LevelMovingObjects.class new file mode 100644 index 0000000..f9b49b2 Binary files /dev/null and b/spaceinvaders/GameProject/bin/playground/LevelMovingObjects.class differ diff --git a/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevel.class b/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevel.class index 0a85aa3..f521a9b 100644 Binary files a/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevel.class and b/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevel.class differ diff --git a/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevelAua.class b/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevelAua.class new file mode 100644 index 0000000..cf8adce Binary files /dev/null and b/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevelAua.class differ diff --git a/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevelTest.class b/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevelTest.class index d406089..2ec45de 100644 Binary files a/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevelTest.class and b/spaceinvaders/GameProject/bin/playground/SpaceInvadersLevelTest.class differ diff --git a/spaceinvaders/GameProject/bin/playground/package-info.class b/spaceinvaders/GameProject/bin/playground/package-info.class new file mode 100644 index 0000000..e81f00a Binary files /dev/null and b/spaceinvaders/GameProject/bin/playground/package-info.class differ diff --git a/spaceinvaders/GameProject/log/log4j.log b/spaceinvaders/GameProject/log/log4j.log index 659f64c..d875e47 100644 --- a/spaceinvaders/GameProject/log/log4j.log +++ b/spaceinvaders/GameProject/log/log4j.log @@ -1080,3 +1080,17 @@ 2022-05-13 10:06:30,041 INFO playground.SpaceInvadersLevel - no enemies left, level done. 2022-05-13 10:06:30,043 INFO base.GameLoop - reached end of levels 2022-05-13 10:06:30,043 INFO base.GameLoop - Game ends. Bye. +2022-05-18 16:16:32,453 INFO base.GameLoop - GUI starts +2022-05-18 16:16:35,213 INFO base.GameLoop - GUI NEW +2022-05-18 16:16:35,214 INFO playground.SpaceInvadersLevel - PREPARE +2022-05-18 16:16:35,267 INFO playground.Animation - img added .\video/sweetAlien0.png +2022-05-18 16:16:35,275 INFO playground.Animation - img added .\video/sweetAlien1.png +2022-05-18 16:16:35,278 INFO playground.Animation - img added .\video/sweetAlien2.png +2022-05-18 16:16:35,282 INFO playground.Animation - img added .\video/sweetAlien3.png +2022-05-18 16:16:35,286 INFO playground.Animation - img added .\video/sweetAlien4.png +2022-05-18 16:16:35,290 INFO playground.Animation - img added .\video/sweetAlien5.png +2022-05-18 16:16:35,294 INFO playground.Animation - img added .\video/sweetAlien6.png +2022-05-18 16:16:35,296 INFO playground.Animation - img added .\video/sweetAlien7.png +2022-05-18 16:16:35,304 INFO playground.Animation - img added .\video/heart0.png +2022-05-18 16:16:35,307 INFO playground.Animation - img added .\video/heart1.png +2022-05-18 16:16:35,311 INFO playground.SpaceInvadersLevel - HIGHSCORE17200 diff --git a/spaceinvaders/GameProject/src/playground/SpaceInvadersLevelTest.java b/spaceinvaders/GameProject/src/playground/SpaceInvadersLevelTest.java deleted file mode 100644 index 145028e..0000000 --- a/spaceinvaders/GameProject/src/playground/SpaceInvadersLevelTest.java +++ /dev/null @@ -1,81 +0,0 @@ -package playground; - -import static org.junit.Assert.assertTrue; -import java.awt.Color; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import gameobjects.EgoObject; -import gameobjects.GameObject; -import gameobjects.RectObject; - -/** - * Tests {@link SpaceInvadersLevel} for - *
    - *
  1. calcEnemySpeedX() returns the same value as constant SpaceInvadersLevel.ENEMYSPEEDX - *
  2. calcEnemySpeedY() returns the same value as constant SpaceInvadersLevel.ENEMYSPEEDY - *
  3. calcNrEnemies() returns the same value as constant SpaceInvadersLevel.NR_ENEMIES - *
  4. actionIfEnemyIsHit() adds 200 points to score - *
  5. actionIfEgoObjectIsHit() reduces number of lives (egoLives) - *
- * @author jkonert - * - */ -class SpaceInvadersLevelTest { - - private static SpaceInvadersLevel myLevel; - - @BeforeAll - static void setUpBeforeClass() throws Exception { - myLevel = new SpaceInvadersLevel(); - SpaceInvadersLevel.setGlobalFlag("egoLives", 5); - SpaceInvadersLevel.setGlobalFlag("points", 500); - SpaceInvadersLevel.setGlobalFlag("highscore", 5000); - } - - @AfterAll - static void tearDownAfterClass() throws Exception { - // nothing - } - - @Test - void testCalcEnemySpeedX() { - assertTrue("EnemySpeedX is as in SpaceInvadersLevel defined", myLevel.calcEnemySpeedX() == SpaceInvadersLevel.ENEMYSPEEDX); - } - - @Test - void testCalcEnemySpeedY() { - assertTrue("EnemySpeedY is as in SpaceInvadersLevel defined", myLevel.calcEnemySpeedY() == SpaceInvadersLevel.ENEMYSPEEDY); - } - - @Test - void testCalcNrEnemies() { - assertTrue("NrOfEnemies is as in SpaceInvadersLevel defined", myLevel.calcNrEnemies() == SpaceInvadersLevel.NR_ENEMIES); - } - - - @Test - void testActionIfEnemyIsHitPointsUp() { - Integer numPointsBefore = (Integer)Playground.getGlobalFlag("points"); - GameObject dummyShot = new RectObject("shot1", myLevel, 0,0,0,0, 12, 12, Color.WHITE); - GameObject dummyEnemy = new RectObject("ego1", myLevel, 0,0,0,0, 12, 12, Color.BLACK); - myLevel.addObject(dummyShot); - myLevel.addObject(dummyEnemy); - myLevel.actionIfEnemyIsHit(dummyEnemy, dummyShot);; // this is the call under test - Integer numPointsAfter = (Integer)Playground.getGlobalFlag("points"); // changed? - assertTrue("numPoints is up +200 after EnemyIsHit", numPointsAfter == numPointsBefore + 200); // points are set +200 , check. - } - - @Test - void testActionIfEgoObjectIsHitLivesDown() { - Integer numLivesBefore = (Integer)Playground.getGlobalFlag("egoLives"); - GameObject dummyShot = new RectObject("shot1", myLevel, 0,0,0,0, 12, 12, Color.RED); - GameObject dummyEgo = new EgoObject("ego1", myLevel, 0,0,0,0, 5); - myLevel.addObject(dummyShot); - myLevel.actionIfEgoObjectIsHit(dummyShot, dummyEgo); // this is the call under test - Integer numLivesAfter = (Integer)Playground.getGlobalFlag("egoLives"); // changed? - assertTrue("numLives is reduced by one ifEgoIsHit", numLivesAfter == numLivesBefore - 1); // lives is reduced by one - - } - -}