Space Invaders

The classic game Space Invaders, without GUI.
This commit is contained in:
Fernando Méndez
2020-09-17 20:06:49 +02:00
committed by GitHub
parent 08097b1ba0
commit 1d271afe24
49 changed files with 3086 additions and 0 deletions

View File

@ -0,0 +1,16 @@
package tp.p2.game.GameObjects.Interfaces;
import tp.p2.game.GameObjects.GameObject;
/**
* @author Fernando M<>ndez Torrubiano
*
*/
public interface IAttack {
default boolean performAttack(GameObject other) {return false;};
default boolean receiveMissileAttack(int damage) {return false;};
default boolean receiveBombAttack(int damage) {return false;};
default boolean receiveShockWaveAttack(int damage) {return false;};
default boolean recibeExplodeAttack(int damage) {return false;};
}

View File

@ -0,0 +1,18 @@
package tp.p2.game.GameObjects.Interfaces;
import tp.p2.game.Game;
/**
* @author Fernando M<>ndez Torrubiano
*
*/
public interface IExecuteRandomActions {
static boolean canGenerateRandomOvni(Game game){
return game.getRandom().nextDouble() < game.getLevel().getOvniFrequency();
}
static boolean canGenerateRandomBomb(Game game){
return game.getRandom().nextDouble() < game.getLevel().getShootFrequency();
}
}

View File

@ -0,0 +1,20 @@
package tp.p2.game.GameObjects.Interfaces;
import tp.p2.controller.Exceptions.CommandExecuteException;
/**
* @author Fernando M<>ndez Torrubiano
*
*/
public interface IPlayerController {
// PLAYER ACTIONS
public boolean move (String dir, int numCells) throws CommandExecuteException;
public boolean shootLaser();
public boolean shockWave();
public boolean shootSuperLaser();
// CALLBACKS
public void receivePoints(int points);
public void enableShockWave();
public void enableMissile();
public void enableSuperMissile();
}