Browse Source

Nacharbeiten in live HA-SU

master
fdai7222 3 years ago
parent
commit
3bf608b8cb
  1. 6
      spaceinvaders/GameProject/bin/.gitignore
  2. BIN
      spaceinvaders/GameProject/bin/base/BreakoutGame.class
  3. BIN
      spaceinvaders/GameProject/bin/controller/ReboundController2.class
  4. 76
      spaceinvaders/GameProject/log/log4j.log
  5. 17
      spaceinvaders/GameProject/src/playground/LevelMovingHitObjects.java

6
spaceinvaders/GameProject/bin/.gitignore

@ -1,7 +1 @@
/base/
/collider/
/controller/
/gameobjects/
/playground/
/rendering/
/ui/

BIN
spaceinvaders/GameProject/bin/base/BreakoutGame.class

BIN
spaceinvaders/GameProject/bin/controller/ReboundController2.class

76
spaceinvaders/GameProject/log/log4j.log

@ -1285,3 +1285,79 @@
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.
2022-05-30 10:39:50,655 INFO base.GameLoop - GUI starts
2022-05-30 10:39:56,558 INFO base.GameLoop - GUI NEW
2022-05-30 10:39:56,558 INFO playground.SpaceInvadersLevel - PREPARE
2022-05-30 10:39:56,629 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-05-30 10:39:56,638 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-05-30 10:39:56,641 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-05-30 10:39:56,645 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-05-30 10:39:56,649 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-05-30 10:39:56,653 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-05-30 10:39:56,657 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-05-30 10:39:56,659 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-05-30 10:39:56,676 INFO playground.Animation - img added .\video/heart0.png
2022-05-30 10:39:56,680 INFO playground.Animation - img added .\video/heart1.png
2022-05-30 10:39:56,691 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-05-30 10:39:59,461 INFO base.GameLoop - Game ends. Bye.
2022-05-30 10:40:05,917 INFO base.GameLoop - GUI starts
2022-05-30 10:40:09,786 INFO base.GameLoop - GUI NEW
2022-05-30 10:40:09,787 INFO playground.SpaceInvadersLevel - PREPARE
2022-05-30 10:40:09,839 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-05-30 10:40:09,848 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-05-30 10:40:09,850 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-05-30 10:40:09,855 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-05-30 10:40:09,859 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-05-30 10:40:09,863 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-05-30 10:40:09,866 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-05-30 10:40:09,869 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-05-30 10:40:09,876 INFO playground.Animation - img added .\video/heart0.png
2022-05-30 10:40:09,879 INFO playground.Animation - img added .\video/heart1.png
2022-05-30 10:40:09,884 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-05-30 10:40:16,840 INFO base.GameLoop - Game ends. Bye.
2022-05-30 10:51:53,135 INFO base.GameLoop - GUI starts
2022-05-30 10:51:56,999 INFO base.GameLoop - GUI NEW
2022-05-30 10:51:56,999 INFO playground.SpaceInvadersLevel - PREPARE
2022-05-30 10:51:57,052 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-05-30 10:51:57,060 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-05-30 10:51:57,063 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-05-30 10:51:57,068 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-05-30 10:51:57,072 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-05-30 10:51:57,076 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-05-30 10:51:57,079 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-05-30 10:51:57,082 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-05-30 10:51:57,089 INFO playground.Animation - img added .\video/heart0.png
2022-05-30 10:51:57,093 INFO playground.Animation - img added .\video/heart1.png
2022-05-30 10:51:57,097 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-05-30 10:52:00,009 INFO base.GameLoop - Game ends. Bye.
2022-05-30 10:52:04,688 INFO base.GameLoop - GUI starts
2022-05-30 10:52:07,410 INFO base.GameLoop - GUI NEW
2022-05-30 10:52:07,410 INFO playground.SpaceInvadersLevel - PREPARE
2022-05-30 10:52:07,463 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-05-30 10:52:07,472 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-05-30 10:52:07,475 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-05-30 10:52:07,479 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-05-30 10:52:07,483 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-05-30 10:52:07,487 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-05-30 10:52:07,491 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-05-30 10:52:07,493 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-05-30 10:52:07,500 INFO playground.Animation - img added .\video/heart0.png
2022-05-30 10:52:07,504 INFO playground.Animation - img added .\video/heart1.png
2022-05-30 10:52:07,508 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-05-30 10:52:12,569 INFO base.GameLoop - Game ends. Bye.
2022-05-30 11:14:26,546 INFO base.GameLoop - GUI starts
2022-05-30 11:14:28,979 INFO base.GameLoop - GUI NEW
2022-05-30 11:14:28,979 INFO playground.SpaceInvadersLevel - PREPARE
2022-05-30 11:14:29,034 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-05-30 11:14:29,041 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-05-30 11:14:29,044 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-05-30 11:14:29,049 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-05-30 11:14:29,053 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-05-30 11:14:29,058 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-05-30 11:14:29,061 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-05-30 11:14:29,064 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-05-30 11:14:29,072 INFO playground.Animation - img added .\video/heart0.png
2022-05-30 11:14:29,075 INFO playground.Animation - img added .\video/heart1.png
2022-05-30 11:14:29,079 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-05-30 11:14:31,658 INFO playground.LevelMovingObjects - ego hit a letal RectObject. Game ends NOW
2022-05-30 11:14:31,659 INFO base.GameLoop - Game ends. Bye.

17
spaceinvaders/GameProject/src/playground/LevelMovingHitObjects.java

@ -6,6 +6,7 @@ import controller.ReboundController;
import gameobjects.GameObject;
import gameobjects.RectObject;
import collider.*;
import org.apache.log4j.*;
/**
* Level that creates two RectObjects moving around and if ego is hit by them game is directly lost
@ -14,19 +15,26 @@ import collider.*;
*/
public class LevelMovingHitObjects extends SpaceInvadersLevel {
private static Logger Logger = LogManager.getLogger(LevelMovingObjects.class);
// FIXME add logger here
private RectObject blueBox;
private RectObject greenBox;
@Override
public void prepareLevel(String id) {
super.prepareLevel(id);
RectObject blueBox = new RectObject("fly_enemy1", this, 300, 300, 75, 40, 40, 40, Color.BLUE);
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);
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);
@ -37,8 +45,11 @@ public class LevelMovingHitObjects extends SpaceInvadersLevel {
@Override
void actionIfEgoCollidesWithEnemy(GameObject enemy, GameObject ego) {
super.actionIfEgoCollidesWithEnemy(enemy, ego);
if(enemy.id.equals("fly_enemy1") || enemy.id.equals("fly_enemy2")) {
if(enemy.id.contains("fly")) {
this.lost = true;
Playground.setGlobalFlag("egoLives", 0);
Logger.info("ego hit a letal RectObject. Game ends NOW");
HighscoreManager.writeHSToFile((Integer) Playground.getGlobalFlag("points"),
(Integer) Playground.getGlobalFlag("highscore"));
}

Loading…
Cancel
Save