-
Notifications
You must be signed in to change notification settings - Fork 9
Obstacle Minigame ‐ Sprint 1
The obstacle minigame feature is implemented in the game as an immersive experience for the player to solve problems when exiting one planet to another (i.e. transitioning from one map to another map). The obstacle minigame, at its core, is a short time-based minigame where the player must navigate their spaceship along a maze and figure their way out to the exit point which is represented in the form of a wormhole in the map.
Anshul Dadhwal (@AnshulDadhwal)
Arsh Upadhyaya (@mr-popo123)
Manpreet Singh (@Manpreetingh)
Zhen Feng (@Foref)
The player can do basic movements with the ship using the arrow keys as follows:
D
and →
-- Move Right
A
and ←
-- Move Left
W
and ↑
-- Move Up
A
and ↓
-- Move Down
Method for creating asteroids
private void spawnAsteroids() {
//Extra Spicy Asteroids
GridPoint2 posAs = new GridPoint2(22, 10);
spawnEntityAt(ObstacleFactory.createAsteroid(ASTEROID_SIZE,ASTEROID_SIZE), posAs, false, false);
}
Method for spawning asteroids to the right recursively
private void spawnStaticAsteroidsRight(int n, GridPoint2 pos){
if (n <= 0) {
return;
}
spawnEntityAt(
ObstacleFactory.createStaticAsteroid(STATIC_ASTEROID_SIZE, STATIC_ASTEROID_SIZE), pos, false, false);
// Increment the position for the next asteroid
pos.x += 1;
pos.y += 0;
spawnStaticAsteroidsRight(n - 1, pos); // Recursive call
}
Method for spawning exit point
private void spawnGoal(){
GridPoint2 position = new GridPoint2(24,10);
spawnEntityAt(
ObstacleFactory.createObstacleGameGoal(WORMHOLE_SIZE,WORMHOLE_SIZE), position,false,false);
}
Method for spawning ship
private void spawnShip(){
Entity newShip = ShipFactory.createShip();
spawnEntityAt(newShip, SHIP_SPAWN, true, true);
targetables.add(newShip);
}
We collaborated with Team 5 for the design of this ship and agreed on the ship design given below:
Uses setPosition() function of the Entity Class in render()<>
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files