Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Settings feature #24

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
7fdc344
Add luca.txt to main branch
Sep 27, 2021
af0c07f
Merge pull request #1 from 56luca/main
eliasb1 Sep 27, 2021
35c6433
Created janae.txt file
jfarinas96 Sep 27, 2021
e5dd165
Merge pull request #2 from jfarinas96/testbranch
eliasb1 Sep 27, 2021
937907c
Change luca.txt in testBranch
Sep 27, 2021
82c561d
Merge pull request #3 from 56luca/testBranch
eliasb1 Sep 27, 2021
f74ef37
Adding practice file
Josholeary Sep 27, 2021
b7ee2d6
Added Sophie.txt
sibylle221 Sep 27, 2021
15f7c06
Merge pull request #4 from Josholeary/main
eliasb1 Sep 27, 2021
98cc497
Merge pull request #5 from sibylle221/main
eliasb1 Sep 27, 2021
d49ad32
Pause function added
Josholeary Nov 18, 2021
0f1ae1b
Merge pull request #6 from Josholeary/main
eliasb1 Nov 18, 2021
9a464d8
Added missing font file
Josholeary Nov 18, 2021
25f51b6
Merge pull request #7 from Josholeary/main
eliasb1 Nov 18, 2021
75edb77
Delete txt files from git practice and update gitignore
Nov 19, 2021
263d217
Add GameScreenTest.java to include test directory (file contains no r…
Nov 19, 2021
eb0051f
Merge pull request #8 from 56luca/main
eliasb1 Nov 19, 2021
ca9788a
Create notification_text.txt
Dec 2, 2021
8f95c69
Merge pull request #9 from 56luca/main
eliasb1 Dec 2, 2021
90fde26
Add help menu
eliasb1 Dec 9, 2021
cb4c3dd
Merge pull request #10 from eliasb1/main
eliasb1 Dec 13, 2021
c2dab23
Display settings and options for each setting
jfarinas96 Dec 13, 2021
608afd2
Change screen size
jfarinas96 Dec 13, 2021
fb556c1
Adds setColor method to Entity class
Dec 14, 2021
c80ffc9
Adds health, HEALTH_COLOR_CODE, getHealth() and reduceHealth() to the…
Dec 14, 2021
ed1d44f
Removes GameScreenTest (was only for testing purposes during the lab …
Dec 14, 2021
1d888ee
Added Music and sound effects
Josholeary Dec 14, 2021
e7bc143
Fixed issue with music file pathnames
Josholeary Dec 14, 2021
3661c13
Merge pull request #11 from 56luca/main
eliasb1 Dec 14, 2021
de95961
Merge pull request #13 from Josholeary/main
eliasb1 Dec 14, 2021
dc7cc71
Delete .vscode directory
eliasb1 Dec 14, 2021
19c0d7a
Merge with upstream main
jfarinas96 Dec 15, 2021
ea3cc3e
Add CI features using Maven
eliasb1 Dec 15, 2021
b8b216e
Upgraded sound features
Josholeary Dec 15, 2021
b3179c1
Merge pull request #14 from Josholeary/main
eliasb1 Dec 15, 2021
1a86f10
Merge with upstream main
jfarinas96 Dec 15, 2021
c939f99
Testing volume control
jfarinas96 Dec 15, 2021
68c9dd6
Add Maven configuration file
eliasb1 Dec 15, 2021
2b29c9a
Merge volume branch with main branch
jfarinas96 Dec 15, 2021
19c3393
Add volume feature
jfarinas96 Dec 15, 2021
607cab3
Merge remote-tracking branch 'upstream/main'
jfarinas96 Dec 15, 2021
bd8a01b
Delete old Maven configuration file
eliasb1 Dec 15, 2021
7c906b6
Create maven.yml
eliasb1 Dec 15, 2021
90ab251
Update from upstream
jfarinas96 Dec 15, 2021
9ca18c2
Fix Maven dependencies
eliasb1 Dec 15, 2021
8bc13cd
Merge volume with main
jfarinas96 Dec 15, 2021
73283dc
Delete old Maven configuration file
eliasb1 Dec 15, 2021
a8ca5e8
Create maven.yml
eliasb1 Dec 15, 2021
435fe23
Fix JUnit version for Maven
eliasb1 Dec 15, 2021
84bd627
Add vibration effect when damage is taken [Sophie]
eliasb1 Dec 15, 2021
7f56310
Fix bgm music volume adjustment
jfarinas96 Dec 15, 2021
2c9ad7c
Adds JUnit dependency (forgot to commit with Display HP function)
Dec 15, 2021
7f5c2f4
Merge pull request #15 from 56luca/main
eliasb1 Dec 15, 2021
13ce1f9
Preparing for difficulty settings option
jfarinas96 Dec 15, 2021
c60ad3d
Merge remote-tracking branch 'upstream/main'
jfarinas96 Dec 15, 2021
bed4c21
Add difficulty setting
jfarinas96 Dec 15, 2021
b6882db
Change EnemyShipTest.java file
jfarinas96 Dec 15, 2021
2b1163c
Merge pull request #16 from jfarinas96/main
eliasb1 Dec 15, 2021
0424414
Starting over to change the project structure
eliasb1 Dec 15, 2021
006c690
Update project structure to Maven project
eliasb1 Dec 15, 2021
5b661d8
Change project structure to a Maven project
eliasb1 Dec 15, 2021
20ef604
Update Maven configuration file and add missing font
eliasb1 Dec 15, 2021
df29efd
Merge branch 'maven' into main
eliasb1 Dec 15, 2021
bce775f
Merge pull request #17 from eliasb1/main
eliasb1 Dec 15, 2021
8a319f7
Update README file
eliasb1 Dec 15, 2021
75cfcfe
Merge pull request #19 from eliasb1/main
eliasb1 Dec 15, 2021
3e843d3
Update README file
eliasb1 Dec 15, 2021
ebf327e
Merge pull request #20 from eliasb1/main
eliasb1 Dec 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,7 @@ pip-log.txt
#############

log*
*.ttf
.checkstyle
.checkstyle
*.class
.idea/
out/
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
Invaders
=
[Space Invaders](http://en.wikipedia.org/wiki/Space_Invaders) clone, written in Java.

###Screenshots
![](http://i.minus.com/ijt8HhaA8laZq.png)
Welcome to our Space Invaders java project developed as part of our Software Development Practices class at Hanyang University. We were tasked with adding features onto a previously developed space invaders game.

###Download
[Dropbox](https://dl.dropboxusercontent.com/u/23829102/invaders.zip)
### Team

Mirror: [Mediafire](http://www.mediafire.com/download/kwv9s90j9i1o4kc/invaders.zip)
Our team is called Team Aliens, it comprises of 5 members.

###Installation
After downloading the file above, unpack it and save it to an appropiate location.
* Elias - https://github.com/eliasb1
* Luca - https://github.com/56luca
* Janae - https://github.com/jfarinas96
* Sophie - https://github.com/sibylle221
* Josh - https://github.com/Josholeary

Open the directory and double-click invaders.jar. In some systems (i.e. Ubuntu) you may need to select 'Open with OpenJDK 7 Runtime' or similar from the context menu.
### Features

If the Java path is not set correctly, you can also navigate to the directory from the command line and execute
The following is a list of the features we added.

>java -jar invaders.jar
- Add dying effect (screen shake)
- Add SFX & BGM (background music and sound effects)
- Add various monsters (making higher hp monsters and different monster formations)
- Display HP Color (coordinating colours to reflect monster hp)
- Add Setting function (screen resizing, game speed selecting etc)
- Add game summary (controls/manual)
- Add pause function

###System Requirements
Requires Java 7 or better.
### CI/CD
We used Github Actions for CI/CD, these are the specific tools we are using for this project:

- Maven to build the project
- CodeFactor for code checking

###Resources
[Space Invaders Regular (font)](http://www.fonts2u.com/space-invaders-regular.font) - © kylemaoin 2010
33 changes: 33 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.setb</groupId>
<artifactId>Invaders</artifactId>
<version>1.0-SNAPSHOT</version>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

</project>
File renamed without changes.
41 changes: 33 additions & 8 deletions src/engine/Core.java → src/main/java/engine/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import screen.GameScreen;
import screen.HighScoreScreen;
import screen.ScoreScreen;
import screen.Screen;
import screen.TitleScreen;
import screen.*;

/**
* Implements core game logic.
Expand All @@ -23,9 +19,9 @@
public final class Core {

/** Width of current screen. */
private static final int WIDTH = 448;
private static int WIDTH = 448;
/** Height of current screen. */
private static final int HEIGHT = 520;
private static int HEIGHT = 520;
/** Max fps of current screen. */
private static final int FPS = 60;

Expand Down Expand Up @@ -59,7 +55,7 @@ public final class Core {
new GameSettings(8, 7, 2, 500);

/** Frame to draw the screen on. */
private static Frame frame;
public static Frame frame;
/** Screen currently shown. */
private static Screen currentScreen;
/** Difficulty settings list. */
Expand Down Expand Up @@ -114,13 +110,21 @@ public static void main(final String[] args) {

GameState gameState;

Sound.playMusic();

int returnCode = 1;
do {
gameState = new GameState(1, 0, MAX_LIVES, 0, 0);

switch (returnCode) {
case 1:
// Main menu.
frame.setVisible(false); // This makes the old window disappear
frame = new Frame(WIDTH, HEIGHT); // This creates a new window with new width & height values
DrawManager.getInstance().setFrame(frame);
width = frame.getWidth();
height = frame.getHeight();

currentScreen = new TitleScreen(width, height, FPS);
LOGGER.info("Starting " + WIDTH + "x" + HEIGHT
+ " title screen at " + FPS + " fps.");
Expand Down Expand Up @@ -172,6 +176,22 @@ public static void main(final String[] args) {
returnCode = frame.setScreen(currentScreen);
LOGGER.info("Closing high score screen.");
break;
case 4:
// Help.
currentScreen = new HelpScreen(width, height, FPS);
LOGGER.info("Starting " + WIDTH + "x" + HEIGHT
+ " help screen at " + FPS + " fps.");
returnCode = frame.setScreen(currentScreen);
LOGGER.info("Closing help screen.");
break;
case 5:
// Settings.
currentScreen = new SettingsScreen(width, height, FPS);
LOGGER.info("Starting " + WIDTH + "x" + HEIGHT
+ " settings screen at " + FPS + " fps.");
returnCode = frame.setScreen(currentScreen);
LOGGER.info("Closing settings screen.");
break;
default:
break;
}
Expand Down Expand Up @@ -250,4 +270,9 @@ public static Cooldown getVariableCooldown(final int milliseconds,
final int variance) {
return new Cooldown(milliseconds, variance);
}

public static void setSize(int width, int height) {
WIDTH = width;
HEIGHT = height;
}
}
Loading