Space Invaders
The classic game Space Invaders, without GUI.
This commit is contained in:
@ -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;};
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
@ -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();
|
||||
}
|
Reference in New Issue
Block a user