Skip to content

Commit e8b8d20

Browse files
authored
Merge pull request #950 from AlmasB/dev
Release 11.13
2 parents b7d14f6 + b0d9a69 commit e8b8d20

File tree

164 files changed

+4650
-2399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+4650
-2399
lines changed

.github/.ci/RELEASE.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
To release:
22

33
1. release-fxgl.sh
4-
2. Merge dev branch into release (currently called master)
4+
2. Update README.md -> next version
5+
3. Merge dev branch into release (currently called master)
56

6-
Continue developing in dev
7+
Continue developing on the dev branch

.github/workflows/latest_jdk.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test FXGL on Mac/Win/Linux using latest stable jdk
2+
3+
on:
4+
push:
5+
branches: [ dev ]
6+
pull_request:
7+
branches: [ dev ]
8+
9+
jobs:
10+
build:
11+
name: "Build (JDK-${{ matrix.java }}, ${{ matrix.os }})"
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ ubuntu-latest, macOS-latest, windows-latest ]
16+
java: [ 15 ]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- name: 'Checkout'
20+
uses: actions/checkout@v2
21+
22+
- name: 'Set up JDK'
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: ${{ matrix.java }}
26+
27+
- name: Cache maven deps
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.m2/repository
31+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: |
33+
${{ runner.os }}-maven-
34+
35+
- name: Build and test with Maven using xvfb
36+
uses: GabrielBB/xvfb-action@v1
37+
with:
38+
run: |
39+
mvn test -B -Dgpg.skip=true -Dmaven.javadoc.skip=true

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ services:
1111
- xvfb
1212
jdk:
1313
- openjdk11
14-
- openjdk15
15-
- openjdk-ea
1614

1715
before_install:
1816
- echo "before_install NOOP"

CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at ![link](https://img.shields.io/badge/email-almaslvl%40gmail.com-blue). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2020 Almas Baimagambetov (AlmasB) ([email protected])
3+
Copyright (c) 2015-2021 Almas Baimagambetov (AlmasB) ([email protected])
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

+15-6
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ JavaFX Game Development Framework
1313
### Why FXGL?
1414

1515
* No installation or setup required
16-
* "Out of the box": Java 8-15, Win/Mac/Linux/Android 5.0+/iOS 11.0+/Web
16+
* "Out of the box": Java 8-15, Win/Mac/Linux/Android 8+/iOS 11.0+/Web
1717
* Simple and clean API, higher level than other engines
1818
* Superset of JavaFX: no need to learn new UI API
1919
* Real-world game development techniques: Entity-Component, interpolated animations, particles, and [many more](https://github.com/AlmasB/FXGL/wiki/Core-Features)
2020
* Games are easily packaged into a single executable .jar or native images
2121

2222
### Good for:
2323

24-
* Any 2D genre (side-scroller / platformer / arcade / RPG)
25-
* Complex UI controls
24+
* Any 2D game (side-scroller / platformer / arcade / RPG)
25+
* Any business applications with complex UI controls / animations
26+
* Experimental 3D
2627
* Hobby / academic / commercial projects
2728
* Teaching / learning / improving game development skills
28-
* Fast prototyping of game ideas
29+
* Fast prototyping of app ideas
2930

3031
### Minimal Example
3132

@@ -69,7 +70,7 @@ Already have `pom.xml`? Then add: (use `0.5.4` for Java 8-10). **Note:** make su
6970
<dependency>
7071
<groupId>com.github.almasb</groupId>
7172
<artifactId>fxgl</artifactId>
72-
<version>11.11</version>
73+
<version>11.13</version>
7374
</dependency>
7475
```
7576

@@ -85,7 +86,7 @@ repositories {
8586
}
8687
8788
dependencies {
88-
compile 'com.github.almasb:fxgl:11.11'
89+
compile 'com.github.almasb:fxgl:11.13'
8990
}
9091
```
9192

@@ -122,15 +123,23 @@ If you'd like your project featured here, just add a note in the [Chat](https://
122123
If you want to build FXGL from sources or want to contribute,
123124
please see the [Contribution Guide](CONTRIBUTING.md) (including non-code).
124125
FXGL is fully modular, so new contributors do not need to understand the entire codebase, only the module to which the contribution is made.
126+
Contributions will be reviewed in accordance with the [Code of Conduct](CODE_OF_CONDUCT.md).
125127

126128
You can support the FXGL development / show interest by simply starring the repo or becoming a [sponsor](https://github.com/sponsors/AlmasB).
127129

128130
### Sponsors
129131

132+
Users:
133+
130134
* @Marsl10
131135
* @SergeMerzliakov
132136
* @mbains
133137
* @sabit86
138+
* @hendrikebbers
139+
140+
Companies:
141+
142+
* @karakun
134143

135144
### Contact
136145

fxgl-ai/src/main/java/com/almasb/fxgl/pathfinding/Grid.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public final Optional<T> getDown(int x, int y) {
187187
return getOptional(x, y + 1);
188188
}
189189

190-
private Optional<T> getOptional(int x, int y) {
190+
public final Optional<T> getOptional(int x, int y) {
191191
if (isWithin(x, y))
192192
return Optional.of(get(x, y));
193193

fxgl-ai/src/main/java/com/almasb/fxgl/pathfinding/astar/AStarMoveComponent.java

+15
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import java.util.ArrayList;
1818
import java.util.List;
19+
import java.util.Optional;
1920
import java.util.Random;
2021

2122
/**
@@ -81,6 +82,20 @@ public AStarGrid getGrid() {
8182
return pathfinder.get().getGrid();
8283
}
8384

85+
/**
86+
* Note: entity's anchored position is used to compute this.
87+
* Note: return type is Optional since it is possible to have
88+
* the entity placed at a non-grid position.
89+
*
90+
* @return cell where this entity is located
91+
*/
92+
public Optional<AStarCell> getCurrentCell() {
93+
var cellX = moveComponent.getCellX();
94+
var cellY = moveComponent.getCellY();
95+
96+
return getGrid().getOptional(cellX, cellY);
97+
}
98+
8499
public void stopMovementAt(int cellX, int cellY) {
85100
path.clear();
86101
moveComponent.setPositionToCell(cellX, cellY);

fxgl-ai/src/test/java/com/almasb/fxgl/pathfinding/GridTest.java

+12-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
2020
import static org.hamcrest.Matchers.is;
2121
import static org.hamcrest.Matchers.lessThan;
22-
import static org.junit.jupiter.api.Assertions.assertEquals;
23-
import static org.junit.jupiter.api.Assertions.assertFalse;
24-
import static org.junit.jupiter.api.Assertions.assertNotNull;
25-
import static org.junit.jupiter.api.Assertions.assertTrue;
22+
import static org.junit.jupiter.api.Assertions.*;
2623

2724
@SuppressWarnings("java:S5786")
2825
public class GridTest {
@@ -53,6 +50,17 @@ public void testConstructorWithCellSize() {
5350
assertEquals(CELL_HEIGHT, grid.getCellHeight());
5451
}
5552

53+
@Test
54+
public void testConstructorWithNegativeCellSize() {
55+
assertThrows(IllegalArgumentException.class, () -> {
56+
new Grid<>(MockCell.class, 5, 5, -1, CELL_HEIGHT, new MockCellGenerator());
57+
});
58+
59+
assertThrows(IllegalArgumentException.class, () -> {
60+
new Grid<>(MockCell.class, 5, 5, CELL_WIDTH, -1, new MockCellGenerator());
61+
});
62+
}
63+
5664
@Test
5765
public void testIsWithin() {
5866
for (int y = 0; y < GRID_SIZE; y++) {

fxgl-ai/src/test/kotlin/com/almasb/fxgl/pathfinding/astar/AStarMoveComponentTest.kt

+12
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ class AStarMoveComponentTest {
4949
assertThat(cellMoveComponent.cellX, `is`(0))
5050
assertThat(cellMoveComponent.cellY, `is`(1))
5151

52+
var currentCell = aStarMoveComponent.currentCell
53+
54+
assertTrue(currentCell.isPresent)
55+
assertThat(currentCell.get().x, `is`(0))
56+
assertThat(currentCell.get().y, `is`(1))
57+
5258
// right
5359
aStarMoveComponent.moveToRightCell()
5460

@@ -80,6 +86,12 @@ class AStarMoveComponentTest {
8086

8187
assertThat(cellMoveComponent.cellX, `is`(3))
8288
assertThat(cellMoveComponent.cellY, `is`(5))
89+
90+
currentCell = aStarMoveComponent.currentCell
91+
92+
assertTrue(currentCell.isPresent)
93+
assertThat(currentCell.get().x, `is`(3))
94+
assertThat(currentCell.get().y, `is`(5))
8395
}
8496

8597
@Test

fxgl-animation/src/main/kotlin/com/almasb/fxgl/animation/Animatable.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ interface Animatable {
1818

1919
fun xProperty(): DoubleProperty
2020
fun yProperty(): DoubleProperty
21+
fun zProperty(): DoubleProperty
2122

2223
fun scaleXProperty(): DoubleProperty
2324
fun scaleYProperty(): DoubleProperty
25+
fun scaleZProperty(): DoubleProperty
2426

25-
fun rotationProperty(): DoubleProperty
27+
fun rotationXProperty(): DoubleProperty
28+
fun rotationYProperty(): DoubleProperty
29+
fun rotationZProperty(): DoubleProperty
2630

2731
fun opacityProperty(): DoubleProperty
2832

0 commit comments

Comments
 (0)