Commit 12ad7ca0 authored by Krish Shah's avatar Krish Shah
Browse files

deleted unnecessary files

parent 3febb9e7
Loading
Loading
Loading
Loading

README.md

deleted100644 → 0
+0 −27
Original line number Diff line number Diff line
# Group5Project

# Title
8-bit Invaders

# Category:
Animated Game

# Description: 
We are building a Space Shooter-like game in an 8-bit style.

# Roles
Lead: AnishSinha [14.29%], KrishShah [14.29%], NathanStrahs [14.29%], JamesKnee [14.29%], ThomasPoimenidis [14.29%], DerekXu [14.29%], JiaweiXiang [14.29%]

Front: AnishSinha [14.29%], KrishShah [14.29%], NathanStrahs [14.29%], JamesKnee [14.29%], ThomasPoimenidis [14.29%], DerekXu [14.29%], JiaweiXiang [14.29%]

Back: AnishSinha [14.29%], KrishShah [14.29%], NathanStrahs [14.29%], JamesKnee [14.29%], ThomasPoimenidis [14.29%], DerekXu [14.29%], JiaweiXiang [14.29%]

Documenter: AnishSinha [14.29%], KrishShah [14.29%], NathanStrahs [14.29%], JamesKnee [14.29%], ThomasPoimenidis [14.29%], DerekXu [14.29%], JiaweiXiang [14.29%]

Tester: AnishSinha [14.29%], KrishShah [14.29%], NathanStrahs [14.29%], JamesKnee [14.29%], ThomasPoimenidis [14.29%], DerekXu [14.29%], JiaweiXiang [14.29%]

# Member Names:
Anish Sinha, Thomas Poimenidis, Jiawei Xiang(DavidXiang), Krish Shah, Nathan Strahs, Derek Xu, James Knee

# Personalize Gitlab Task:
Completed
+0 −23
Original line number Diff line number Diff line
package com.example.a8_bitinvader;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Background {

    int xPos = 0, yPos = 0;
    Bitmap background;

    /**
     * Creates a background
     * @param screenWidth Width of screen in pixels
     * @param screenHeight Height of screen in pixels
     * @param res Resource object
     */
    Background(int screenWidth, int screenHeight, Resources res) {
        background = BitmapFactory.decodeResource(res, R.drawable.background);
        background = Bitmap.createScaledBitmap(background, screenWidth, screenHeight, false);
    }

}
+0 −19
Original line number Diff line number Diff line
package com.example.a8_bitinvader;


import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Bullet extends Sprite {

    /**
     * Creates Bullet object using Sprite constructor
     */
    public Bullet(int xPos, int yPos, int xVel, int yVel, int screenWidth, int screenHeight, Resources res) {
        super(xPos, yPos, xVel, yVel, screenWidth, screenHeight);
        spriteImage = BitmapFactory.decodeResource(res, R.drawable.bullet);
        spriteImage = Bitmap.createScaledBitmap(spriteImage, screenWidth, screenHeight, false);
    }

}
+0 −61
Original line number Diff line number Diff line
package com.example.a8_bitinvader;

public class Enemy extends Sprite{

    // this will need to vary no?
    /** Health of player */
    private int health = 1;

    // speed adjust
    /** Speed */
    public final int SPEED_MULTIPLIER = 3;

    //initialize the Xval,Yval. and inital position

    /**
     * Initialize an enemy with the given coordinates and initial velocity
     * @param xPos X point
     * @param yPos Y point
     * @param xVel X velocity
     * @param yVel Y velocity
     */
    public Enemy(int xPos, int yPos, int xVel, int yVel, int screenWidth, int screenHeight) {
        super(xPos, yPos, xVel, yVel, screenWidth, screenWidth);

    }

    /**
     * Checks if the given points are within the sprite and reduce the health if so
     * @param xx Other X point
     * @param yy Other Y point
     * @return True if input xx and yy are within the sprite
     */
    @Override //the return doesn't really mean anything all we need is that when any of the point hit within the hit box of player, call the loose health function.
    public boolean checkForCollision(int xx, int yy)
    {
        if( super.checkForCollision(xx,yy) ) {
            loseHealth();
            return true;
        } else {
            return false;
        }
    }

    /**
     * Decrease the health of the player
     */
    // when loseHealth drop the help to 0, call the destroy function. which we will override ltr
    private void loseHealth() {
        health -= 1;
        if (health == 0) {
            destroy();
        }
    }


    // will shoot bullets
    public void shootBullets(){

    }

}
+0 −50
Original line number Diff line number Diff line
package com.example.a8_bitinvader;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

import android.graphics.Point;              // necessary to get ScreenWidth and ScreenHeight
import android.view.WindowManager;

public class GameActivity extends AppCompatActivity {

    private GameView gameView;

    /**
     * Create an instance of the activity based on the saved state. Then initialize the gameview and display the gameview onto the screen
     * @param savedInstanceState The cached game state
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // puts app into fullscreen when GameActivity is running
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);


        Point point = new Point();
        getWindowManager().getDefaultDisplay().getSize(point);

        gameView = new GameView(this, point.x, point.y);

        setContentView(gameView);
    }

    /**
     * Pause the game
     */
    @Override
    protected void onPause() {
        super.onPause();
        gameView.pause();
    }

    /**
     * Resume the game
     */
    @Override
    protected void onResume() {
        super.onResume();
        gameView.resume();
    }
}
Loading