Skip to content

Commit ad91085

Browse files
committed
update to FastJ 1.7.0-SNAPSHOT-1
- improve jpackage speed by disabling installer generation - bump gradle version to 7.5.1 - bump slf4j to 2.0.0-alpha7 - improve example game - format readme - update license
1 parent 282fb15 commit ad91085

File tree

5 files changed

+54
-36
lines changed

5 files changed

+54
-36
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Andrew Dey
3+
Copyright (c) 2022 Andrew Dey
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# FastJ Java Template Program
22

33
## Requirements
4-
- [Java 11 JDK or Higher][jdk-link]
5-
- Basic understanding of Java
64

5+
- [Java 18 JDK or Higher][jdk-link]
6+
- Basic understanding of Java
77

88
## Initial Setup
99

1010
### Download the Template
11+
1112
You have a few options for getting the template:
1213

13-
#### Create from Template
14-
1. Click the "Use This Template" button at the top of this project. Leave everything on the project creation screen as is, and hit "Create repository from template".
14+
#### Create from Template - Recommended for Beginners
15+
16+
1. Click the "Use This Template" button at the top of this project. Leave everything on the project creation screen as
17+
is, and hit "Create repository from template".
1518
![image](https://user-images.githubusercontent.com/64715411/125542737-6eb23326-d07a-4a28-89af-dcacb4f01cac.png)
1619
![image](https://user-images.githubusercontent.com/64715411/125543010-b960404a-ad40-431c-ab31-c097f52574bb.png)
1720

@@ -21,13 +24,15 @@ You have a few options for getting the template:
2124
![image](https://user-images.githubusercontent.com/64715411/125545310-c62610da-1eb5-4e80-86b3-352b1ea16612.png)
2225

2326
#### Clone the template directly
27+
2428
1. Clone the repository via terminal: `git clone https://github.com/lucasstarsz/fastj-java-template`
2529

2630
#### Downloading the latest release
27-
Download the archive (.zip file, or tar.gz file) from https://github.com/lucasstarsz/fastj-java-template/releases/latest
2831

32+
Download the archive (.zip file, or tar.gz file) from https://github.com/lucasstarsz/fastj-java-template/releases/latest
2933

3034
### Running the Program
35+
3136
1. Build the program:
3237
```bash
3338
./gradlew build
@@ -37,10 +42,10 @@ Download the archive (.zip file, or tar.gz file) from https://github.com/lucasst
3742
./gradlew run
3843
```
3944

40-
4145
## General Usage
4246

4347
### Generating Installer/Executable
48+
4449
1. Build the program:
4550
```bash
4651
./gradlew build
@@ -53,18 +58,22 @@ Download the archive (.zip file, or tar.gz file) from https://github.com/lucasst
5358

5459
_Having trouble using `gradlew`? Read [this][Terminals Are Different]._
5560

56-
5761
## Learning FastJ
62+
5863
Check out the following links to learn how to use FastJ:
64+
5965
- [Example Programs][example-programs-readme-link]
6066
- [FastJ Documentation][documentation-link]
6167

62-
6368
## Configuring the Project Variables
69+
6470
Please view the [build.gradle](build.gradle) file -- it contains general instructions for modifying the base example.
6571

6672

67-
[jdk-link]: https://adoptium.net/?variant=openjdk17 "Java JDK Download"
73+
[jdk-link]: https://adoptium.net/temurin/releases?version=18 "Java JDK Download"
74+
6875
[Terminals Are Different]: https://gist.github.com/lucasstarsz/9bbc306f8655b916367d557043e498ad "Terminals Access Files Differently"
69-
[example-programs-readme-link]: http://fastj.me/tree/main/src/example "FastJ Examples"
70-
[documentation-link]: https://javadoc.io/doc/io.github.lucasstarsz.fastj/fastj-library "FastJ API Documentation"
76+
77+
[example-programs-readme-link]: https://github.com/fastjengine/FastJ/tree/1.7.0-SNAPSHOT-1/examples "FastJ Examples"
78+
79+
[documentation-link]: https://javadoc.io/doc/io.github.lucasstarsz.fastj/fastj-library/1.7.0-SNAPSHOT-1 "FastJ API Documentation"

build.gradle

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ repositories.maven {
4444
repositories.mavenCentral()
4545

4646
/* The dependency for FastJ, the game engine this template depends on. */
47-
dependencies.implementation('com.github.fastjengine:FastJ:1.6.0')
47+
dependencies.implementation('io.github.lucasstarsz.fastj:fastj-library:1.7.0-SNAPSHOT-1')
4848
/* We'll stick with the simplest logging option for now -- you can change it however you need. */
49-
dependencies.implementation('org.slf4j:slf4j-simple:2.0.0-alpha5')
49+
dependencies.implementation('org.slf4j:slf4j-simple:2.0.0-alpha7')
5050

5151

5252
/* JLink is used to configure the executables and other distributions for your project. */
@@ -70,26 +70,34 @@ jlink {
7070
def iconPath = 'project-resources/fastj_icon'
7171
def currentOs = org.gradle.internal.os.OperatingSystem.current()
7272

73-
installerOptions += [
74-
'--description', project.description,
75-
'--vendor', project.group,
76-
'--app-version', project.version
77-
]
78-
79-
8073
if (currentOs.windows) {
81-
installerType = 'msi'
8274
icon = "${iconPath}.ico"
83-
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-shortcut']
8475
} else if (currentOs.linux) {
85-
installerType = 'deb'
8676
icon = "${iconPath}.png"
87-
installerOptions += ['--linux-shortcut']
8877
} else if (currentOs.macOsX) {
89-
installerType = 'pkg'
9078
icon = "${iconPath}.icns"
91-
installerOptions += ['--mac-package-name', project.name]
79+
}
80+
81+
/* Comment the line below to create an installer for your application */
82+
skipInstaller = true
83+
84+
if (!skipInstaller) {
85+
installerOptions += [
86+
'--description', project.description,
87+
'--vendor', project.group,
88+
'--app-version', project.version
89+
]
90+
91+
if (currentOs.windows) {
92+
installerType = 'msi'
93+
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-shortcut']
94+
} else if (currentOs.linux) {
95+
installerType = 'deb'
96+
installerOptions += ['--linux-shortcut']
97+
} else if (currentOs.macOsX) {
98+
installerType = 'pkg'
99+
installerOptions += ['--mac-package-name', project.name]
100+
}
92101
}
93102
}
94103
}
95-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/tech/fastj/template/Game.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import tech.fastj.graphics.display.FastJCanvas;
55
import tech.fastj.graphics.display.RenderSettings;
66
import tech.fastj.graphics.game.Text2D;
7-
7+
import tech.fastj.math.Pointf;
88
import tech.fastj.systems.control.SimpleManager;
99

1010
public class Game extends SimpleManager {
@@ -15,13 +15,14 @@ public void init(FastJCanvas canvas) {
1515
canvas.modifyRenderSettings(RenderSettings.Antialiasing.Enable);
1616

1717
/* A very simple Text2D object, welcoming you to FastJ! */
18-
Text2D helloFastJText = Text2D.fromText("Hello, FastJ 1.6.0!");
19-
helloFastJText.translate(canvas.getCanvasCenter());
20-
drawableManager.addGameObject(helloFastJText);
21-
}
18+
Text2D helloFastJ = Text2D.fromText("Hello, FastJ 1.7.0-SNAPSHOT-1!");
2219

23-
@Override
24-
public void update(FastJCanvas canvas) {
20+
/* Translate our hello text to the center of the screen */
21+
Pointf center = canvas.getCanvasCenter();
22+
helloFastJ.setTranslation(center.subtract(helloFastJ.width() / 2f, helloFastJ.height() / 2f));
23+
24+
/* Render hello fastj text */
25+
drawableManager().addGameObject(helloFastJ);
2526
}
2627

2728
public static void main(String[] args) {

0 commit comments

Comments
 (0)