Skip to content

Releases: fastjengine/FastJ

FastJ 1.3.0 - The Logo Update

17 Apr 05:13
Compare
Choose a tag to compare

🎉 We are now officially FastJ 🎉

Thank you to everyone who has supported the project so far -- you've helped us get this far, and we'll be getting even further on very soon.
This update sparks the official change of the repository name and the addition of a logo! We are no longer FastJ-Game-Library... we are FastJ. The repository name and URL have been changed to reflect this, as well as the addition of the logo.

fastj_logo

In Other News...

This update brings you more unit test coverage, Javadoc cleaning, package redistribution, and numerous improved engine features.

Classes Moved

  • systems.render → graphics - all classes under system.render have been moved to the graphics package.
    • This affects Camera.java and Display.java

New Unit Tests

  • Camera.java
  • Drawable.java
  • GameObject.java

New Additions

Camera.java

  • Added equals, hashCode, and toString implementations
  • Added constants for translation and rotation

DrawUtil.java

  • Added method DrawUtil#randomFont() to generate random fonts

Keyboard.java

  • Keyboard#stop() method to reset the keyboard and close all of its threads.

Maths.java

  • Added method Maths#randomInteger() to generate random integers
  • Method Maths#randomBoolean() to generate psuedorandom booleans.
  • Added Maths#floatEquals -- checks for 'equality' by ensuring the difference between two floats is less than the value of Maths#FloatingPrecision.
    • All methods in FastJ checking for equality between floating-point values have been converted to use this method.

Model2D.java

  • Added toString() override
  • Added constant defining default show value.
  • Added constructor Model2D(Polygon2D[]) that sets the show variable to the default show value (the one mentioned above).

Mouse.java

  • Mouse#stop() method to reset the mouse and close all of its threads.

Polygon2D.java

  • Added toString() override

Text2D.java

  • Add default color and show constants

Bug Fixes

Camera.java

  • Added checks to Camera#getTransformation() to ensure rotation/translation doesn't happen when the camera hasn't been moved.
  • Fixed issue in default Camera constructor where the translation would be set to a reference to the default Camera translation, causing checks to fail in getTransformation

DrawUtil.java

  • Fixed issue in constructor Model2D(Polygon2D[], Pointf, float, Pointf, boolean) where translations were attempted to be performed before the collision object was made, resulting in a null pointer exception.
  • Fixed issue where font string choice would occasionally be larger than the length.

FastJEngine.java

  • Fixed issue where some environments would return 0 for the default refresh rate, causing the default FPS to be set to 0. Now, it will set to be at least 1.

General Changes

Display.java

  • Changed return value of Display#getJFrame -- The method now returns JFrame instead of Frame.

FastJEngine.java

  • Changed FastJEngine#exit() in two key ways:
    • Removed the call of System.exit(0)
    • Reset all the data contained in the engine.
      This allows the game engine to be reused after closing a game instance.
  • FastJEngine#exit() now calls Keyboard#stop() and Mouse#stop() rather than their respective reset() methods, and no longer exits the VM.
  • Simplified the FastJEngine#error(...) method - no longer closes the JVM instance. Instead, it closes the game and throws the provided exception with the provided error message.

Keyboard.java

  • Made key constants follow PascalCase rather than camelCase

Maths.java

  • All methods in the Maths class that previously returned double values now return float values.
  • Lowered float precision delta (Maths.FloatPrecision) to 0.00001f
  • Fixed issue with incorrect random generation where the trueMin value in the random(min, max) method would be set to trueMax no matter what.

Model2D.java

  • Renamed Model2D#getObjects() to Model2D#getPolygons()
  • Keyboard#reset() no longer closes the keyboard threads.
  • This now sets its rotation and scale to the default values provided by GameObject.

Polygon2D.java

  • This now sets its rotation and scale to the default values provided by GameObject.
  • Changed Polygon2D#modifyPoints to set translation, rotation, and scale to, if requested, the default GameObject translation, rotation, and scale.

Text2D.java

  • Changed constant Text2D#DEFAULT_FONT to Text2D#defaultFont.

Package Redistribution

FastJ will consist of 4 main packages:

Engine

This package contains the game loop on which the game engine runs, as well as engine-related configurable settings.

Graphics

This package contains all non-rendering graphical content -- game objects, UI, and helper methods to simplify the general process of working with graphics, as well as handling rendering to the screen.

Math

This package contains all mathematics-related content -- Point and Pointf, as well as a secondary math class called Maths are defined here.

Systems

This package contains FastJ's numerous features which make it a viable choice for game development.
Currently, it contains the following features:

  • Scene System -- a way to divide logic and loading of the game into different sections, or scenes, as well as switching between them.
  • Behavior System -- a way to control the updating of game objects outside the update method
  • Input System -- a way to recieve and process keyboard and mouse inputs. Input values can be statically accessed.
  • Tag System -- FastJ provides a tagging system for all renderable content that allows for further distinction between two graphical objects.

Changed Packages:

  • src/main/java/io/github/lucasstarsz/fastj/graphics/GameObject.java → src/main/java/io/github/lucasstarsz/fastj/graphics/game/GameObject.java
  • src/main/java/io/github/lucasstarsz/fastj/graphics/shapes/Model2D.java → src/main/java/io/github/lucasstarsz/fastj/graphics/game/Model2D.java
  • src/main/java/io/github/lucasstarsz/fastj/graphics/shapes/Polygon2D.java → src/main/java/io/github/lucasstarsz/fastj/graphics/game/Polygon2D.java
  • src/main/java/io/github/lucasstarsz/fastj/graphics/text/Text2D.java → src/main/java/io/github/lucasstarsz/fastj/graphics/game/Text2D.java
  • src/main/java/io/github/lucasstarsz/fastj/ui/EventCondition.java → src/main/java/io/github/lucasstarsz/fastj/graphics/ui/EventCondition.java
  • src/main/java/io/github/lucasstarsz/fastj/ui/UIElement.java → src/main/java/io/github/lucasstarsz/fastj/graphics/ui/UIElement.java
  • src/main/java/io/github/lucasstarsz/fastj/ui/elements/Button.java → src/main/java/io/github/lucasstarsz/fastj/graphics/ui/elements/Button.java
  • src/main/java/io/github/lucasstarsz/fastj/systems/game/DrawableManager.java → src/main/java/io/github/lucasstarsz/fastj/systems/control/DrawableManager.java
  • src/main/java/io/github/lucasstarsz/fastj/systems/game/LogicManager.java → src/main/java/io/github/lucasstarsz/fastj/systems/control/LogicManager.java
  • src/main/java/io/github/lucasstarsz/fastj/systems/game/Scene.java → src/main/java/io/github/lucasstarsz/fastj/systems/control/Scene.java
  • src/main/java/io/github/lucasstarsz/fastj/io/keyboard/Keyboard.java → src/main/java/io/github/lucasstarsz/fastj/systems/input/keyboard/Keyboard.java
  • src/main/java/io/github/lucasstarsz/fastj/io/keyboard/KeyboardActionListener.java → src/main/java/io/github/lucasstarsz/fastj/systems/input/keyboard/KeyboardActionListener.java
  • src/main/java/io/github/lucasstarsz/fastj/io/keyboard/Keys.java → src/main/java/io/github/lucasstarsz/fastj/systems/input/keyboard/Keys.java
  • src/main/java/io/github/lucasstarsz/fastj/io/mouse/Mouse.java → src/main/java/io/github/lucasstarsz/fastj/systems/input/mouse/Mouse.java
  • src/main/java/io/github/lucasstarsz/fastj/io/mouse/MouseAction.java → src/main/java/io/github/lucasstarsz/fastj/systems/input/mouse/MouseAction.java
  • src/main/java/io/github/lucasstarsz/fastj/io/mouse/MouseActionListener.java → src/main/java/io/github/lucasstarsz/fastj/systems/input/mouse/MouseActionListener.java
  • src/main/java/io/github/lucasstarsz/fastj/io/mouse/MouseButtons.java → src/main/java/io/github/lucasstarsz/fastj/systems/input/mouse/MouseButtons.java
  • src/main/java/io/github/lucasstarsz/fastj/render/Camera.java → src/main/java/io/github/lucasstarsz/fastj/graphics/Camera.java
  • src/main/java/io/github/lucasstarsz/fastj/render/Display.java → src/main/java/io/github/lucasstarsz/fastj/graphics/Display.java

FastJ 1.2.0

09 Apr 17:58
Compare
Choose a tag to compare

The "Unit Test" Update

A new version arises! And this one's coming in with the fact that I've begun to write unit tests for FastJ! Generally speaking, this decision came about because Slope-ECS has been on hold until Gradle 7.0 releases (more on that later).

Highlights

Unit Testing with JUnit 5

In the meantime, I've been working on getting all of FastJ unit tested! The project will use JUnit 5 for unit testing rather than JUnit 4, specifically because I need ordered test support. Sorry to anyone who's used to JUnit 4 😅

Currently, the project has all of the following unit tested:

  • fastj.math
  • fastj.graphics.DrawUtil
  • Constructors of fastj.graphics.shapes.Polygon2D

As the project progresses, more unit tests will be added.

Bug Fixes

DrawUtil.java

  • Fixed issue in writeToPSDF() where newlines were not being added after show (s) or after Pointf (p).
  • Fixed inconsistency between writeToPSDF() and parseModelFile() where models were being written with fill (f) and show (s) values as boolean values. As of now, all models will be written and read as boolean values.
  • Nearly complete re-write of the createCollisionOutline() method -- a proper outline is now generated and sorted to be displayed clockwise.
    • Uses intersection counting to weed out points on the inner sections of the array of Polygon2Ds.
    • Shifts results counter-clockwise to ensure the resulting Pointf[] matches the original orientation of the Polygon2Ds.
  • Fixed issue in lengthOfPath() where path close (which connects the last point to the beginning, effectively another line in the path) did not count towards the line path count. Now, that extra line is accounted for.

Polygon2D.java

  • Fixed issue in constructor Polygon2D(Pointf[] pts, Pointf setLocation, float setRotation, Pointf setScale, Color color, boolean fill, boolean show) where scale and rotation were not being set to the correct values.

Additions

Drawable.java

  • Added method chaining to setShouldRender()

DrawUtil.java

  • Added createBox(float, float, Pointf) method to round out the box creation methods

GameObject.java

  • Added default translation constant
  • Added default scale constant
  • Added default rotation constant
  • Added method chaining to setTranslation(), setRotation(), setScale()

Model2D.java

  • Added Object#equals(), Object#hashCode()

Point.java

  • Added Object#equals(), Object#hashCode()
  • Added equalsPointf() for comparing against a Pointf object
  • Added origin constant

Pointf.java

  • Added Object#equals(), Object#hashCode()
  • Added equalsPoint() for comparing against a Point object
  • Added origin constant

Polygon2D.java

  • Added Object#equals(), Object#hashCode()
  • Added default color constant
  • Added default "should fill" constant
  • Added default "should show" constant

General Changes

DrawUtil.java

  • changed lengthOfPath() to accept all Path2D objects
  • made Polygon2D#createPath() publicly available as DrawUtil#createPath()

FastJ 1.1.2

21 Mar 06:54
Compare
Choose a tag to compare