Skip to content

Commit

Permalink
Tanks v1.1.0 - Added mustard, orangered, and gold tanks, shaders, tim…
Browse files Browse the repository at this point in the history
…ed levels, and several new obstacles
  • Loading branch information
aehmttw committed Mar 2, 2021
1 parent 9d180ed commit 4672f44
Show file tree
Hide file tree
Showing 406 changed files with 5,698 additions and 1,710 deletions.
46 changes: 0 additions & 46 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Tanks

Tanks is a game written in Java inspired by a game of the same name on the Wii.<br>
There are 18 unique enemies you can fight, but you can add more of your own too.<br>
There are 21 unique enemies you can fight, but you can add more of your own too.<br>
The game works in Windows, Mac or Linux.<br>
Tanks can be found on [itch.io](https://aehmttw.itch.io/tanks) and the [iOS App Store](https://apps.apple.com/us/app/tanks-the-crusades/id1508772262)

Expand Down
Empty file modified src/main/java/META-INF/MANIFEST.MF
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/BaseFile.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/BaseFileManager.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/BaseFontRenderer.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/BasePlatformHandler.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/BaseSoundPlayer.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/BaseVibrationPlayer.java
100644 → 100755
Empty file.
29 changes: 26 additions & 3 deletions src/main/java/basewindow/BaseWindow.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package basewindow;

import basewindow.transformation.Transformation;
import basewindow.transformation.Translation;
import basewindow.transformation.*;
import lwjglwindow.ShadowMap;

import java.net.URL;
import java.util.ArrayList;
Expand Down Expand Up @@ -71,7 +71,8 @@ public abstract class BaseWindow
public double yOffset = 0;
public double zOffset = 0;

public Transformation baseTransformation = new Translation(this, -0.5, -0.5, -1);
public Transformation[] baseTransformations = new Transformation[]{new Translation(this, -0.5, -0.5, -1)};
public Transformation[] lightBaseTransformation = new Transformation[]{new ScaleAboutPoint(this, 0.8, 0.8, 0.8, 0.5, 0.5, 0.5), new Shear(this, 0, 0, 0, 0, 0.5, 0.5)};

public BaseSoundPlayer soundPlayer;
public boolean soundsEnabled = false;
Expand All @@ -82,6 +83,8 @@ public abstract class BaseWindow
public boolean antialiasingSupported = false;
public boolean antialiasingEnabled = false;

public boolean drawingShadow = false;

public static final HashMap<Integer, String> keyNames = new HashMap<>();

public BasePlatformHandler platformHandler;
Expand Down Expand Up @@ -165,6 +168,8 @@ public void stopTiming()

public abstract void fillOval(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillPartialOval(double x, double y, double sX, double sY, double start, double end);

public abstract void fillFacingOval(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillGlow(double x, double y, double sX, double sY);
Expand All @@ -175,10 +180,18 @@ public void stopTiming()

public abstract void fillGlow(double x, double y, double sX, double sY, boolean shade);

public abstract void fillGlow(double x, double y, double sX, double sY, boolean shade, boolean light);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade, boolean light);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade, boolean light);

public abstract void setColor(double r, double g, double b, double a, double glow);

public abstract void setColor(double r, double g, double b, double a);

public abstract void setColor(double r, double g, double b);
Expand Down Expand Up @@ -248,18 +261,28 @@ public abstract void fillQuadBox(double x1, double y1,

public abstract void transform(double[] matrix);

public abstract void calculateBillboard();

public abstract double getEdgeBounds();

public abstract void setBatchMode(boolean enabled, boolean quads, boolean depth);

public abstract void setBatchMode(boolean enabled, boolean quads, boolean depth, boolean glow);

public abstract void setBatchMode(boolean enabled, boolean quads, boolean depth, boolean glow, boolean depthMask);

public abstract void addVertex(double x, double y, double z);

public abstract void addVertex(double x, double y);

public abstract void openLink(URL url) throws Exception;

public abstract void setShadowQuality(double quality);

public abstract double getShadowQuality();

public abstract void setLighting(double light, double glowLight, double shadow, double glowShadow);

public void setupKeyCodes()
{
keyNames.put(InputCodes.KEY_UNKNOWN, "Unknown key");
Expand Down
Empty file modified src/main/java/basewindow/ComputerFile.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/ComputerFileManager.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/InputCodes.java
100644 → 100755
Empty file.
Empty file modified src/main/java/basewindow/InputPoint.java
100644 → 100755
Empty file.
11 changes: 8 additions & 3 deletions src/main/java/basewindow/transformation/Rotation.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ public Rotation(BaseWindow window, double yaw, double pitch, double roll)
}

public void apply()
{
this.applyToWindow();
transform(window, yaw, pitch, roll);
}

@Override
public void applyToWindow()
{
window.yaw += yaw;
window.pitch += pitch;
window.roll += roll;

window.angled = !(window.yaw == 0 && window.pitch == 0 && window.roll == 0);
transform(window, yaw, pitch, roll);
window.calculateBillboard();
}

public static void transform(BaseWindow window, double yaw, double pitch, double roll)
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/basewindow/transformation/RotationAboutPoint.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ public RotationAboutPoint(BaseWindow window, double yaw, double pitch, double ro
}

public void apply()
{
this.applyToWindow();
transform(window, yaw, pitch, roll, x, y, z);
}

public void applyToWindow()
{
window.yaw += yaw;
window.pitch += pitch;
window.roll += roll;

window.angled = !(window.yaw == 0 && window.pitch == 0 && window.roll == 0);
transform(window, yaw, pitch, roll, x, y, z);
window.calculateBillboard();
}

public static void transform(BaseWindow window, double yaw, double pitch, double roll, double x, double y, double z)
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/basewindow/transformation/Scale.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package basewindow.transformation;

import basewindow.BaseWindow;

public class Scale extends Transformation
{
public double x;
public double y;
public double z;

public Scale(BaseWindow window, double x, double y, double z)
{
super(window);
this.x = x;
this.y = y;
this.z = z;
}

public void apply()
{
transform(window, x, y, z);
}

@Override
public void applyToWindow()
{

}

public static void transform(BaseWindow window, double x, double y, double z)
{
transform(window, x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);
}
}
47 changes: 47 additions & 0 deletions src/main/java/basewindow/transformation/ScaleAboutPoint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package basewindow.transformation;

import basewindow.BaseWindow;

public class ScaleAboutPoint extends Transformation
{
public double x;
public double y;
public double z;

public double posX;
public double posY;
public double posZ;

public ScaleAboutPoint(BaseWindow window, double x, double y, double z, double posX, double posY, double posZ)
{
super(window);

this.x = x;
this.y = y;
this.z = z;

this.posX = posX;
this.posY = posY;
this.posZ = posZ;
}

public void apply()
{
transform(window, x, y, z, posX, posY, posZ);
}

@Override
public void applyToWindow()
{

}

public static void transform(BaseWindow window, double yaw, double pitch, double roll, double x, double y, double z)
{
transform(window, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x * window.absoluteWidth, y * window.absoluteHeight, z * window.absoluteDepth, 1);

transform(window, x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);

transform(window, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -x * window.absoluteWidth, -y * window.absoluteHeight, -z * window.absoluteDepth, 1);
}
}
40 changes: 40 additions & 0 deletions src/main/java/basewindow/transformation/Shear.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package basewindow.transformation;

import basewindow.BaseWindow;

public class Shear extends Transformation
{
public double xy;
public double xz;
public double yx;
public double yz;
public double zx;
public double zy;

public Shear(BaseWindow window, double xy, double xz, double yx, double yz, double zx, double zy)
{
super(window);
this.xy = xy;
this.xz = xz;
this.yx = yx;
this.yz = yz;
this.zx = zx;
this.zy = zy;
}

public void apply()
{
transform(window, xy, xz, yx, yz, zx, zy);
}

@Override
public void applyToWindow()
{

}

public static void transform(BaseWindow window, double xy, double xz, double yx, double yz, double zx, double zy)
{
transform(window, 1, xy, xz, 0, yx, 1, yz, 0, zx, zy, 1, 0, 0, 0, 0, 1);
}
}
4 changes: 4 additions & 0 deletions src/main/java/basewindow/transformation/Transformation.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ public abstract class Transformation
public BaseWindow window;
protected static double[] matrix = new double[16];

public boolean applyAsShadow = false;

public Transformation(BaseWindow window)
{
this.window = window;
}

public abstract void apply();

public abstract void applyToWindow();

protected static void transform(BaseWindow w,
double a1, double a2, double a3, double a4,
double b1, double b2, double b3, double b4,
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/basewindow/transformation/Translation.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ public Translation(BaseWindow window, double x, double y, double z)
}

public void apply()
{
this.applyToWindow();
transform(window, x, y, z);
}

@Override
public void applyToWindow()
{
window.xOffset += x;
window.yOffset += y;
window.zOffset += z;
transform(window, x, y, z);
}

public static void transform(BaseWindow window, double x, double y, double z)
Expand Down
Empty file modified src/main/java/licenses/commons_io_license.txt
100644 → 100755
Empty file.
Empty file modified src/main/java/licenses/commons_io_notice.txt
100644 → 100755
Empty file.
Empty file modified src/main/java/licenses/libgdx_license.txt
100644 → 100755
Empty file.
Empty file modified src/main/java/licenses/pngdecoder_license.txt
100644 → 100755
Empty file.
Empty file modified src/main/java/lwjglwindow/IRenderer.java
100644 → 100755
Empty file.
Loading

0 comments on commit 4672f44

Please sign in to comment.