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

fixed bug with sound tags #141

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</execution>
</executions>
<configuration>
<mainClass>project_16x16.SideScroller</mainClass>
<mainClass>project_16x16.Main</mainClass>
</configuration>
</plugin>
</plugins>
Expand All @@ -87,7 +87,7 @@
</descriptorRefs>
<archive>
<manifest>
<mainClass>project_16x16.SideScroller</mainClass>
<mainClass>project_16x16.Main</mainClass>
</manifest>
</archive>
</configuration>
Expand All @@ -109,7 +109,7 @@
<outfile>target/${project.artifactId}.exe</outfile>
<jar>target/${project.artifactId}-${project.version}-jar-with-dependencies.jar</jar>
<classPath>
<mainClass>project_16x16.SideScroller</mainClass>
<mainClass>project_16x16.Main</mainClass>
</classPath>
<jre>
<path>${java.home}</path>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/project_16x16/Audio.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public String getPath() {
*
* @param s
*/
public static void assignApplet(SideScroller s) {
public static void assignApplet(Main s) {
minim = new Minim(s);

for (SFX sfx : SFX.values()) {
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/project_16x16/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public final class Camera extends ZoomPan {

private SideScroller applet;
private Main applet;
/**
* Lerp constant for motion. Used for all motion easing (zoom, position and
* rotation).
Expand Down Expand Up @@ -82,9 +82,9 @@ public final class Camera extends ZoomPan {
/**
* The most basic constructor. Initialises the camera at position (0, 0).
*
* @param applet Target applet ({@link SideScroller}).
* @param applet Target applet ({@link Main}).
*/
public Camera(SideScroller applet) {
public Camera(Main applet) {
super(applet);
this.applet = applet;
targetPosition = new PVector(0, 0); // default position
Expand All @@ -93,10 +93,10 @@ public Camera(SideScroller applet) {
/**
* Constructor. Specify camera's initial fixed position.
*
* @param applet Target applet ({@link SideScroller}).
* @param applet Target applet ({@link Main}).
* @param startPosition Initial camera position.
*/
public Camera(SideScroller applet, PVector startPosition) {
public Camera(Main applet, PVector startPosition) {
super(applet);
this.applet = applet;
targetPosition = new PVector(-startPosition.x, -startPosition.y);
Expand All @@ -105,10 +105,10 @@ public Camera(SideScroller applet, PVector startPosition) {
/**
* Constructor. Specify the object to track from initialisation.
*
* @param applet Target applet ({@link SideScroller}).
* @param applet Target applet ({@link Main}).
* @param followObject Object the camera will follow.
*/
public Camera(SideScroller applet, EditableObject followObject) {
public Camera(Main applet, EditableObject followObject) {
super(applet);
this.applet = applet;
this.followObject = followObject;
Expand All @@ -119,12 +119,12 @@ public Camera(SideScroller applet, EditableObject followObject) {
* Constructor. Specify both the object to track and the translation offset with
* which to track it from initialisation.
*
* @param applet Target applet ({@link SideScroller}).
* @param applet Target applet ({@link Main}).
* @param followObject Object the camera will follow.
* @param followOffset Offset with which the camera will follow the given
* object.
*/
public Camera(SideScroller applet, EditableObject followObject, PVector followOffset) {
public Camera(Main applet, EditableObject followObject, PVector followOffset) {
super(applet);
this.applet = applet;
this.followObject = followObject;
Expand Down Expand Up @@ -169,7 +169,7 @@ public void post() {
* called will be affected by the camera.
* <p>
* If you wish for the entire sketch to be affected by the camera, you can call
* this method in the first line of the {@link SideScroller#Draw draw()} method.
* this method in the first line of the {@link Main#Draw draw()} method.
* This results in all subsequent drawing being affected by the camera.
* Occasionally though there may be a need to have some display activity that is
* independent of the camera -- see {@link #release()}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* and is the heart of the game.
* </p>
*/
public class SideScroller extends PApplet {
public class Main extends PApplet {

// Game Dev
public static final String LEVEL = "Storage/Game/Maps/tiledMap.dat";
Expand Down Expand Up @@ -600,6 +600,6 @@ public void exit() {

// Main
public static void main(String args[]) {
PApplet.main(SideScroller.class, args);
PApplet.main(Main.class, args);
}
}
4 changes: 2 additions & 2 deletions src/main/java/project_16x16/PClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* </p>
*/
public abstract class PClass {
public SideScroller applet;
public Main applet;

public static final int CENTER = PConstants.CENTER;
public static final int CORNER = PConstants.CORNER;
Expand All @@ -36,7 +36,7 @@ public abstract class PClass {
* Constructor
* @param a The SideScroller game controller.
*/
public PClass(SideScroller a) {
public PClass(Main a) {
applet = a;
}

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/project_16x16/Tileset.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import project_16x16.components.Tile;
import project_16x16.components.Tile.TileType;
Expand All @@ -11,7 +10,6 @@
import project_16x16.objects.MirrorBoxObject;

import processing.core.PApplet;
import processing.core.PGraphics;
import processing.core.PImage;
import processing.data.JSONObject;
import processing.data.JSONArray;
Expand All @@ -28,7 +26,7 @@ public class Tileset {
private static final String DATAPATH = "tileData.json";
private static final int SCALE = 4;

private static SideScroller applet;
private static Main applet;
private static PImage graphicsSheet;

private static int loadedTiles = 0;
Expand All @@ -37,7 +35,7 @@ public class Tileset {

private static JSONArray JSONanimations;

public static void load(SideScroller app){
public static void load(Main app){
applet = app;
graphicsSheet = applet.loadImage(TILESHEETPATH);
tiles = new Tile[TILESETWIDTH * TILESETHEIGHT];
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/project_16x16/Utility.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

public final class Utility {

private static SideScroller applet;
private static Main applet;

/**
* The Util class provides static functions, but uses a PApplet (SideScroller)
* instance within the static methods. This instance must be assigned in a
* static method, here, before anything else uses this class.
*/
public static void assignApplet(SideScroller a) {
public static void assignApplet(Main a) {
applet = a;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

import processing.core.PImage;
import project_16x16.Audio;
import project_16x16.SideScroller;
import project_16x16.Main;
import project_16x16.Audio.SFX;

/**
* The Animation Class
*/
public class AnimationComponent {

private static SideScroller applet;
private static Main applet;

private ArrayList<PImage> frames;
private boolean loop;
Expand All @@ -33,7 +33,7 @@ public AnimationComponent() {
sounds = new MultiValueMap();
}

public static void assignApplet(SideScroller applet) {
public static void assignApplet(Main applet) {
AnimationComponent.applet = applet;
}

Expand Down
22 changes: 3 additions & 19 deletions src/main/java/project_16x16/entities/CleanerRobot.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
package project_16x16.entities;

import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.HashMap;

import processing.core.PImage;
import processing.core.PVector;
import processing.data.JSONObject;
import project_16x16.Audio;
import project_16x16.Options;
import project_16x16.SideScroller;
import project_16x16.SideScroller.debugType;
import project_16x16.Tileset;
import project_16x16.Utility;
import project_16x16.Audio.SFX;
import project_16x16.components.AnimationComponent;
import project_16x16.objects.CollidableObject;
import project_16x16.objects.EditableObject;
import project_16x16.projectiles.Swing;
import project_16x16.Main;
import project_16x16.scene.GameplayScene;

public class CleanerRobot extends Enemy {
Expand All @@ -33,11 +17,11 @@ public class CleanerRobot extends Enemy {
private PVector posA, posB;
private PVector target;

public CleanerRobot(SideScroller a, GameplayScene g) {
public CleanerRobot(Main a, GameplayScene g) {
super(a, g);
}

public CleanerRobot(SideScroller a, GameplayScene g, PVector x1, PVector x2) {
public CleanerRobot(Main a, GameplayScene g, PVector x1, PVector x2) {
this(a, g);
posA = x1;
posB = x2;
Expand Down
17 changes: 4 additions & 13 deletions src/main/java/project_16x16/entities/Enemy.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
package project_16x16.entities;

import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.HashMap;

import processing.core.PImage;
import processing.core.PVector;
import processing.data.JSONObject;
import project_16x16.Audio;
import project_16x16.Options;
import project_16x16.SideScroller;
import project_16x16.SideScroller.debugType;
import project_16x16.Tileset;
import project_16x16.Utility;
import project_16x16.Audio.SFX;
import project_16x16.components.AnimationComponent;
import project_16x16.*;
import project_16x16.Main;
import project_16x16.Main.debugType;
import project_16x16.objects.CollidableObject;
import project_16x16.objects.EditableObject;
import project_16x16.objects.GameObject;
import project_16x16.projectiles.Swing;
import project_16x16.scene.GameplayScene;

/**
Expand Down Expand Up @@ -51,7 +42,7 @@ public class Enemy extends CollidableObject {
*
* @param a SideScroller game controller.
*/
public Enemy(SideScroller a, GameplayScene g) {
public Enemy(Main a, GameplayScene g) {
super(a,g);
gravity = 1;
image = Tileset.getTile(0, 258, 14, 14, 4);
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/project_16x16/entities/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
import processing.core.PImage;
import processing.core.PVector;
import processing.data.JSONObject;
import project_16x16.Audio;
import project_16x16.Constants;
import project_16x16.Options;
import project_16x16.SideScroller;
import project_16x16.SideScroller.debugType;
import project_16x16.Tileset;
import project_16x16.Utility;
import project_16x16.*;
import project_16x16.Main;
import project_16x16.Main.debugType;
import project_16x16.Audio.SFX;
import project_16x16.components.AnimationComponent;
import project_16x16.objects.CollidableObject;
Expand Down Expand Up @@ -83,7 +79,7 @@ private enum ACTION {
*
* @param a SideScroller game controller.
*/
public Player(SideScroller a, GameplayScene g , boolean isMultiplayerPlayer) {
public Player(Main a, GameplayScene g , boolean isMultiplayerPlayer) {

super(a, g);

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/project_16x16/multiplayer/Multiplayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import processing.data.JSONObject;
import processing.net.*;

import project_16x16.SideScroller;
import project_16x16.Main;

public class Multiplayer {

Expand All @@ -28,7 +28,7 @@ public class Multiplayer {
* @param hostIP
* @param port
*/
public Multiplayer(SideScroller player, String hostIP, int port, boolean isHost) throws java.net.ConnectException {
public Multiplayer(Main player, String hostIP, int port, boolean isHost) throws java.net.ConnectException {
this.isHost = isHost;
data = null;
if (isHost) {
Expand All @@ -51,7 +51,7 @@ public Multiplayer(SideScroller player, String hostIP, int port, boolean isHost)
* @param isHost
* @throws ConnectException
*/
public Multiplayer(SideScroller player, boolean isHost) throws ConnectException {
public Multiplayer(Main player, boolean isHost) throws ConnectException {
this(player, "127.0.0.1", 25565, isHost);
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/project_16x16/objects/BackgroundObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
import processing.core.PVector;
import processing.data.JSONObject;

import project_16x16.Main;
import project_16x16.scene.GameplayScene;
import project_16x16.SideScroller;
import project_16x16.Tileset;

public class BackgroundObject extends EditableObject {

public PImage image;

public BackgroundObject(SideScroller a, GameplayScene g) {
public BackgroundObject(Main a, GameplayScene g) {
super(a, g);

type = type.BACKGROUND;
}

public BackgroundObject(SideScroller a, GameplayScene g, String id) {
public BackgroundObject(Main a, GameplayScene g, String id) {
this(a, g);
setGraphic(id);
}

public BackgroundObject(SideScroller a, GameplayScene g, String id, int x, int y) {
public BackgroundObject(Main a, GameplayScene g, String id, int x, int y) {
this(a, g);

pos = new PVector(x, y);
Expand Down
Loading