Skip to content

Commit

Permalink
Passing Actions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HamzaEzzRa committed May 30, 2021
1 parent 68767d6 commit 5345398
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 21 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JUnit Testing
name: tests

on:
push:
Expand All @@ -8,8 +8,25 @@ on:

jobs:
run_tests:
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Audio device
run: Get-CimInstance Win32_SoundDevice | fl *
- name: Install Scream
shell: powershell
run: |
Start-Service audio*
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
$store.Open("ReadWrite")
$store.Add($cert)
$store.Close()
cd C:\Scream\Install\driver
C:\Scream\Install\helpers\devcon install Scream.inf *Scream
- name: Audio device
run: Get-CimInstance Win32_SoundDevice | fl *
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up JDK 8
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This is a Super Mario 2D Clone written in java.

Originally forked from [Super-Mario-Java-2D-Game](https://github.com/mtala3t/Super-Mario-Java-2D-Game).

The project has been fully migrated to Maven.

We're implementing a better gameplay and user experience as part of our Agile development school project.

### Planned features
Expand All @@ -20,7 +22,7 @@ We're implementing a better gameplay and user experience as part of our Agile de
- [x] Improve the animation system and the game graphics.
- [x] An audio system.
- [ ] Add a shop system where you can spend your collected coins.
- [ ] Hitbox visualization and adjustment.
- [ ] Hit-box visualization and adjustment.

### Screenshots

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.TETOSOFT</groupId>
<artifactId>SuperMarioClone</artifactId>
<version>1.1</version>
<version>1.1.2</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/TETOSOFT/graphics/Animation.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.ArrayList;

public class Animation {
private ArrayList frames;
private ArrayList<AnimFrame> frames;
private int currFrameIndex;
private long animTime;
private long totalDuration;
Expand All @@ -14,10 +14,10 @@ public int getSize() {
}

public Animation() {
this(new ArrayList(), 0);
this(new ArrayList<AnimFrame>(), 0);
}

private Animation(ArrayList frames, long totalDuration) {
private Animation(ArrayList<AnimFrame> frames, long totalDuration) {
this.frames = frames;
this.totalDuration = totalDuration;
start();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/TETOSOFT/input/InputManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void clearMap(GameAction gameAction) {
}

public List getMaps(GameAction gameCode) {
ArrayList list = new ArrayList();
ArrayList<String> list = new ArrayList<>();

for (int i=0; i<keyActions.length; i++) {
if (keyActions[i] == gameCode) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/TETOSOFT/tilegame/MapLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"host" Sprites.
*/
public class MapLoader {
private ArrayList tiles;
private ArrayList<Image> tiles;
public int currentMap;
private GraphicsConfiguration gc;

Expand Down Expand Up @@ -114,7 +114,7 @@ public TileMap reloadMap() {
}

private TileMap loadMap(String filename) throws IOException {
ArrayList lines = new ArrayList();
ArrayList<String> lines = new ArrayList<>();
int width = 0;
int height = 0;

Expand Down Expand Up @@ -202,7 +202,7 @@ private void addSprite(TileMap map,
public void loadTileImages() {
// keep looking for tile A,B,C, etc. this makes it
// easy to drop new tiles in the images/ directory
tiles = new ArrayList();
tiles = new ArrayList<>();
char ch = 'A';

while (true) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/TETOSOFT/tilegame/TileMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class TileMap {

private Image[][] tiles;
private LinkedList sprites;
private LinkedList<Sprite> sprites;
private Sprite player;

/**
Expand All @@ -24,7 +24,7 @@ public class TileMap {
*/
public TileMap(int width, int height) {
tiles = new Image[width][height];
sprites = new LinkedList();
sprites = new LinkedList<>();
}


Expand Down
Empty file.
Binary file modified target/classes/com/TETOSOFT/graphics/Animation.class
Binary file not shown.
Binary file modified target/classes/com/TETOSOFT/input/InputManager.class
Binary file not shown.
Binary file modified target/classes/com/TETOSOFT/tilegame/MapLoader.class
Binary file not shown.
Binary file modified target/classes/com/TETOSOFT/tilegame/TileMap.class
Binary file not shown.
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=1.1
version=1.1.2
groupId=com.TETOSOFT
artifactId=SuperMarioClone
2 changes: 1 addition & 1 deletion target/surefire-reports/AudioTest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: AudioTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.627 sec
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.548 sec
2 changes: 1 addition & 1 deletion target/surefire-reports/InputTest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: InputTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.189 sec
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.075 sec
6 changes: 3 additions & 3 deletions target/surefire-reports/TEST-AudioTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="2" failures="0" name="AudioTest" time="3.599" errors="0" skipped="0">
<testsuite tests="2" failures="0" name="AudioTest" time="3.527" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_271\jre\bin"/>
Expand Down Expand Up @@ -64,6 +64,6 @@
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="AudioTest" name="testMP3" time="0.924"/>
<testcase classname="AudioTest" name="testWAV" time="2.675"/>
<testcase classname="AudioTest" name="testMP3" time="0.862"/>
<testcase classname="AudioTest" name="testWAV" time="2.665"/>
</testsuite>
4 changes: 2 additions & 2 deletions target/surefire-reports/TEST-InputTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="InputTest" time="1.189" errors="0" skipped="0">
<testsuite tests="1" failures="0" name="InputTest" time="1.075" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_271\jre\bin"/>
Expand Down Expand Up @@ -64,5 +64,5 @@
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="InputTest" name="testActionKeys" time="1.189"/>
<testcase classname="InputTest" name="testActionKeys" time="1.075"/>
</testsuite>
Empty file.
Binary file modified target/test-classes/AudioTest.class
Binary file not shown.
Binary file modified target/test-classes/InputTest.class
Binary file not shown.

0 comments on commit 5345398

Please sign in to comment.