Skip to content

Obstacle Minigame ‐ Sprint 1

Anshul Dadhwal edited this page Sep 14, 2023 · 6 revisions

Sprint 1

Player Guide

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

Code Documentation

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);
}

Camera Movement - Uses setPosition() function of the Entity Class in render()
CameraBasic

Assets/Design Decisions

Design of Spaceship

We collaborated with Team 5 for the design of this ship and agreed on the ship design given below:

mainship03-2

Design of Asteroids

Asteroids

Design of Wormhole

Wormhole

Design of Map tile

Map

Design of Enemy

Obstacle-Enemy
Clone this wiki locally