Skip to content

Commit

Permalink
Re-organising resources; removing built jars
Browse files Browse the repository at this point in the history
  • Loading branch information
goobemaster committed May 19, 2021
1 parent 02a04c3 commit bb673b4
Show file tree
Hide file tree
Showing 55 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ wip_*/
.classpath
.project
.vscode
.log
Binary file removed games/bankrupt-dash/kodenkel-bankrupt-dash.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Application {
private static final int WINDOW_WIDTH = 640;
private static final int WINDOW_HEIGHT = 480;
private static final int LOCKED_FPS = 60;
private static final String JAR_PATH = System.getProperty("user.dir") + "/src/main/resources/";
private static final String JAR_PATH = System.getProperty("user.dir") + "/src/main/resources/bankrupt-dash/";
public static final ResourceLoader RESOURCE_LOADER = new ResourceLoader(JAR_PATH);

private static GameState STATE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

public abstract class BaseScreen implements GameScreen {
ResourceLoader resource;
private boolean volumeControlAvailable;

public BaseScreen(ResourceLoader resource) {
this.resource = resource;
Expand All @@ -30,6 +31,7 @@ public final void tickCommon(GameState state, GameData data) {
if (state.equals(GameState.BOOT)) Application.changeState(GameState.TITLE);

// Sound
if (!this.volumeControlAvailable) return;
if (IsKeyPressed(KEY_F1)) data.toggleSound();
FloatControl volume;
// TODO: test it on Win and Mac. May break (ALSA requires different value).
Expand All @@ -38,8 +40,10 @@ public final void tickCommon(GameState state, GameData data) {
try {
volume = (FloatControl) clip.getControl(Type.VOLUME);
volume.setValue(setVolume);
this.volumeControlAvailable = true;
} catch (Exception e) {
e.printStackTrace();
this.volumeControlAvailable = false;
}
}
}
Expand Down
Binary file removed games/bankrupt-dash/src/main/resources/map1.ods
Binary file not shown.
Binary file removed games/bankrupt-dash/src/main/resources/map2.ods
Binary file not shown.
Binary file removed games/bankrupt-dash/src/main/resources/map3.ods
Binary file not shown.
Binary file removed games/bankrupt-dash/src/main/resources/map4.ods
Binary file not shown.
Binary file removed games/bankrupt-dash/src/main/resources/map5.ods
Binary file not shown.
Binary file removed games/breakout/kodenkel-breakout.jar
Binary file not shown.
Binary file removed games/pong/kodenkel-pong.jar
Binary file not shown.
Binary file removed games/scorched/kodenkel-scorched.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion games/scorched/src/main/java/com/kodenkel/game/Tank.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Tank(int posX, Ground ground, float turretAngle, TankColor tankColor, int
this.posY = ground.getAbsoluteElevationAt(posX) - HEIGHT - 1;
this.turretAngle = turretAngle;
this.power = 25.0f;
Image tankBodyImage = LoadImage("src/main/resources/tank_" + tankColor.toString().toLowerCase() + ".png");
Image tankBodyImage = LoadImage("src/main/resources/scorched/tank_" + tankColor.toString().toLowerCase() + ".png");
tankBodyTexture = LoadTextureFromImage(tankBodyImage);
UnloadImage(tankBodyImage);
}
Expand Down

0 comments on commit bb673b4

Please sign in to comment.