Skip to content

Commit 6fb10ea

Browse files
authored
Merge pull request #237 from AlmasB/0.2.8
0.2.8
2 parents e6b5ddb + 383f4ef commit 6fb10ea

File tree

88 files changed

+3548
-1165
lines changed

Some content is hidden

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

88 files changed

+3548
-1165
lines changed

.travis.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
sudo: required
2+
dist: trusty
3+
language: java
4+
cache:
5+
directories:
6+
- "~/.m2"
7+
jdk:
8+
- oraclejdk8
9+
before_script:
10+
- export DISPLAY=:99.0
11+
- sh -e /etc/init.d/xvfb start
12+
- sleep 3
13+
install:
14+
-
15+
after_success:
16+
- bash <(curl -s https://codecov.io/bash)
17+
- mvn com.gavinmogan:codacy-maven-plugin:coverage -DcoverageReportFile=target/site/jacoco/jacoco.xml -DprojectToken=$CODACY_PROJECT_TOKEN -DapiToken=$CODACY_PROJECT_TOKEN -DcodacyApiBaseUrl=https://api.codacy.com/
18+
notifications:
19+
email:
20+
on_success: change
21+
on_failure: always
22+
on_start: never
23+
webhooks:
24+
urls:
25+
- https://webhooks.gitter.im/e/afbf0239aac6566f24d4
26+
on_success: change
27+
on_failure: always
28+
on_start: never
29+
env:
30+
matrix:
31+
secure: fRP4CU2qkv47HOd1PBrkGgwsP6To81AYuzi342fxnNTBv313c5fU+HCLYrYI5xNTYfE2b+Iax+A0ypbBbZ2XU+NtbI4OiAYCcBSiFOxFU/gty5neWvyRKG32qtUSNqdEPmx6EzdAjpFss3fyu6AB+g93SLC6S9IBiOxnS3av7cQ=

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
JavaFX Game Development Framework
44

5-
[![Maven](https://img.shields.io/badge/maven-0.2.7-blue.svg)](https://jitpack.io/#AlmasB/FXGL)
6-
[![Javadoc](https://img.shields.io/badge/docs-javadoc-blue.svg)](http://almasb.github.io/FXGL/javadoc/index.html)
5+
[![Release](https://jitpack.io/v/AlmasB/FXGL.svg)](https://jitpack.io/#AlmasB/FXGL)
6+
[![Javadoc](https://img.shields.io/badge/docs-javadoc-blue.svg)](https://jitpack.io/com/github/AlmasB/FXGL/0.2.8/javadoc/index.html)
77
![Code](https://img.shields.io/badge/lines%20of%20code-14k-blue.svg)
8-
![Test](https://img.shields.io/badge/coverage-10%25-red.svg)
8+
![CI](https://travis-ci.org/AlmasB/FXGL.svg?branch=0.2.8)
9+
[![codecov](https://codecov.io/gh/AlmasB/FXGL/branch/0.2.8/graph/badge.svg)](https://codecov.io/gh/AlmasB/FXGL)
10+
[![Codacy](https://api.codacy.com/project/badge/Grade/9603c2522deb42fbb9146bedfcb860b2)](https://www.codacy.com/app/AlmasB/FXGL?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=AlmasB/FXGL&amp;utm_campaign=Badge_Grade)
911

1012
[![Chat](https://badges.gitter.im/AlmasB/FXGL.svg)](https://gitter.im/AlmasB/FXGL)
11-
[![Website](https://img.shields.io/badge/www-FXGL-green.svg)](http://almasb.github.io/FXGL/)
1213
[![Showcase](https://img.shields.io/badge/www-Showcase-green.svg)](http://almasb.github.io/FXGLGames/)
1314
[![Wiki](https://img.shields.io/badge/www-Wiki-green.svg)](https://github.com/AlmasB/FXGL/wiki)
1415
[![MIT](http://img.shields.io/badge/license-MIT-yellow.svg)](https://github.com/AlmasB/FXGL/blob/master/LICENSE)
@@ -157,7 +158,7 @@ fun main(args: Array<String>) {
157158
<dependency>
158159
<groupId>com.github.AlmasB</groupId>
159160
<artifactId>FXGL</artifactId>
160-
<version>0.2.7</version>
161+
<version>0.2.8</version>
161162
</dependency>
162163
```
163164

@@ -168,7 +169,7 @@ repositories {
168169
}
169170
170171
dependencies {
171-
compile 'com.github.AlmasB:FXGL:0.2.7'
172+
compile 'com.github.AlmasB:FXGL:0.2.8'
172173
}
173174
```
174175

pom.xml

+12-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.github.AlmasB</groupId>
66
<artifactId>FXGL</artifactId>
7-
<version>0.2.7</version>
7+
<version>0.2.8</version>
88
<packaging>jar</packaging>
99

1010
<name>FXGL</name>
@@ -29,11 +29,11 @@
2929
<jfxtras.version>8.0-r4</jfxtras.version>
3030
<controlsfx.version>8.40.10</controlsfx.version>
3131
<fxeventbus.version>1.0</fxeventbus.version>
32-
<ents.version>1.1.0</ents.version>
33-
<game.utils.version>0.0.1</game.utils.version>
34-
<jbox.version>2.3.1-fxgl</jbox.version>
32+
<ents.version>1.1.1</ents.version>
33+
<game.utils.version>0.0.3</game.utils.version>
34+
<jbox.version>2.3.2-fxgl</jbox.version>
3535
<astar.version>1.0</astar.version>
36-
<gdx.ai.version>1.8.1-fxgl</gdx.ai.version>
36+
<gdx.ai.version>1.8.2-fxgl</gdx.ai.version>
3737
<easyio.version>0.1.6</easyio.version>
3838
<log4j.version>2.5</log4j.version>
3939

@@ -314,6 +314,13 @@
314314
<goal>report</goal>
315315
</goals>
316316
</execution>
317+
<execution>
318+
<id>report</id>
319+
<phase>test</phase>
320+
<goals>
321+
<goal>report</goal>
322+
</goals>
323+
</execution>
317324
</executions>
318325
</plugin>
319326
</plugins>

samples/assets/music/intro.mp3

114 KB
Binary file not shown.

samples/assets/properties/system.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
# SOFTWARE.
2525
#
2626

27-
physics.ppm = 45
27+
physics.ppm = 45.0

samples/assets/textures/bg_wrap.png

113 KB
Loading

samples/assets/textures/bubble.png

54.9 KB
Loading

samples/assets/textures/player.png

-49 Bytes
Loading

samples/assets/textures/player2.png

8.18 KB
Loading

samples/assets/textures/rain.png

1.4 KB
Loading
4.65 KB
Loading

samples/s1basicapp/BasicAppSample.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ protected void initSettings(GameSettings settings) {
4545
settings.setFullScreen(false);
4646
settings.setIntroEnabled(false);
4747
settings.setMenuEnabled(false);
48-
settings.setShowFPS(true);
48+
settings.setProfilingEnabled(true);
49+
settings.setCloseConfirmation(false);
4950
settings.setApplicationMode(ApplicationMode.DEVELOPER);
5051
}
5152

samples/s8particles/RainSample.java

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* FXGL - JavaFX Game Library
5+
*
6+
* Copyright (c) 2015-2016 AlmasB ([email protected])
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
* SOFTWARE.
25+
*/
26+
27+
package s8particles;
28+
29+
import com.almasb.fxgl.app.ApplicationMode;
30+
import com.almasb.fxgl.app.GameApplication;
31+
import com.almasb.fxgl.effect.ParticleControl;
32+
import com.almasb.fxgl.effect.ParticleEmitter;
33+
import com.almasb.fxgl.effect.ParticleEmitters;
34+
import com.almasb.fxgl.entity.Entities;
35+
import com.almasb.fxgl.entity.GameEntity;
36+
import com.almasb.fxgl.settings.GameSettings;
37+
import javafx.geometry.Point2D;
38+
import javafx.scene.shape.Rectangle;
39+
40+
/**
41+
*
42+
*
43+
* @author Almas Baimagambetov (AlmasB) ([email protected])
44+
*/
45+
public class RainSample extends GameApplication {
46+
47+
@Override
48+
protected void initSettings(GameSettings settings) {
49+
settings.setWidth(800);
50+
settings.setHeight(600);
51+
settings.setTitle("RainSample");
52+
settings.setVersion("0.1");
53+
settings.setFullScreen(false);
54+
settings.setIntroEnabled(false);
55+
settings.setMenuEnabled(false);
56+
settings.setApplicationMode(ApplicationMode.DEVELOPER);
57+
}
58+
59+
@Override
60+
protected void initInput() {}
61+
62+
@Override
63+
protected void initAssets() {}
64+
65+
@Override
66+
protected void initGame() {
67+
Entities.builder()
68+
.viewFromTexture("underwater3.png")
69+
.buildAndAttach(getGameWorld());
70+
71+
ParticleEmitter emitter = ParticleEmitters.newRainEmitter((int)getWidth());
72+
emitter.setSourceImage(getAssetLoader().loadTexture("rain.png").getImage());
73+
74+
ParticleControl control = new ParticleControl(emitter);
75+
76+
Entities.builder()
77+
.with(control)
78+
.buildAndAttach(getGameWorld());
79+
}
80+
81+
@Override
82+
protected void initPhysics() {}
83+
84+
@Override
85+
protected void initUI() {}
86+
87+
@Override
88+
protected void onUpdate(double tpf) {}
89+
90+
public static void main(String[] args) {
91+
launch(args);
92+
}
93+
}

samples/sandbox/RatingSample.java

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* FXGL - JavaFX Game Library
5+
*
6+
* Copyright (c) 2015-2016 AlmasB ([email protected])
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
* SOFTWARE.
25+
*/
26+
package sandbox;
27+
28+
import com.almasb.fxgl.app.ApplicationMode;
29+
import com.almasb.fxgl.app.GameApplication;
30+
import com.almasb.fxgl.entity.Entities;
31+
import com.almasb.fxgl.entity.ScrollingBackgroundView;
32+
import com.almasb.fxgl.input.UserAction;
33+
import com.almasb.fxgl.settings.GameSettings;
34+
import javafx.geometry.Orientation;
35+
import javafx.scene.canvas.GraphicsContext;
36+
import javafx.scene.image.Image;
37+
import javafx.scene.input.KeyCode;
38+
import org.controlsfx.control.Rating;
39+
40+
/**
41+
* This is an example of a basic FXGL game application.
42+
*
43+
* @author Almas Baimagambetov (AlmasB) ([email protected])
44+
*/
45+
public class RatingSample extends GameApplication {
46+
47+
@Override
48+
protected void initSettings(GameSettings settings) {
49+
settings.setWidth(800);
50+
settings.setHeight(600);
51+
settings.setTitle("RatingSample");
52+
settings.setVersion("0.1");
53+
settings.setFullScreen(false);
54+
settings.setIntroEnabled(false);
55+
settings.setMenuEnabled(false);
56+
settings.setProfilingEnabled(true);
57+
settings.setCloseConfirmation(false);
58+
settings.setApplicationMode(ApplicationMode.DEVELOPER);
59+
}
60+
61+
@Override
62+
protected void initInput() {
63+
64+
getInput().addAction(new UserAction("Move Right") {
65+
@Override
66+
protected void onAction() {
67+
getGameScene().getViewport().setX(getGameScene().getViewport().getX() + 10);
68+
}
69+
}, KeyCode.D);
70+
71+
getInput().addAction(new UserAction("Move Left") {
72+
@Override
73+
protected void onAction() {
74+
getGameScene().getViewport().setX(getGameScene().getViewport().getX() - 10);
75+
}
76+
}, KeyCode.A);
77+
78+
getInput().addAction(new UserAction("Move Up") {
79+
@Override
80+
protected void onAction() {
81+
getGameScene().getViewport().setY(getGameScene().getViewport().getY() - 10);
82+
}
83+
}, KeyCode.W);
84+
85+
getInput().addAction(new UserAction("Move Down") {
86+
@Override
87+
protected void onAction() {
88+
getGameScene().getViewport().setY(getGameScene().getViewport().getY() + 10);
89+
}
90+
}, KeyCode.S);
91+
}
92+
93+
@Override
94+
protected void initAssets() {}
95+
96+
private Image bgImage;
97+
98+
@Override
99+
protected void initGame() {
100+
//bgImage = getAssetLoader().loadTexture("bg_wrap.png", 1280, 720).getImage();
101+
102+
getGameScene().addGameView(new ScrollingBackgroundView(getAssetLoader().loadTexture("bg_wrap.png", 1066, 600),
103+
Orientation.VERTICAL));
104+
// Entities.builder()
105+
// .viewFromNode(getAssetLoader().loadTexture("bg_wrap.png", 1280, 720))
106+
// .buildAndAttach(getGameWorld());
107+
}
108+
109+
@Override
110+
protected void initPhysics() {}
111+
112+
@Override
113+
protected void initUI() {
114+
115+
// Rating rating = new Rating(6, 1);
116+
// rating.setPartialRating(false);
117+
// rating.setUpdateOnHover(false);
118+
// //rating.setDisable(true);
119+
//
120+
// getGameScene().addUINode(rating);
121+
122+
}
123+
124+
@Override
125+
protected void onUpdate(double tpf) {
126+
127+
// double dx = getGameScene().getViewport().getX() % 1280;
128+
// double dy = getGameScene().getViewport().getY();
129+
//
130+
// GraphicsContext g = getGameScene().getGraphicsContext();
131+
//
132+
// double sx = dx;
133+
//
134+
// if (sx < 0)
135+
// return;
136+
//
137+
// g.drawImage(bgImage, sx, 0, 1280 - sx, 720,
138+
// 0, 0, 1280 - sx, 720);
139+
//
140+
// g.drawImage(bgImage, 0, 0, sx, 720,
141+
// 1280 - sx, 0, sx, 720);
142+
}
143+
144+
public static void main(String[] args) {
145+
launch(args);
146+
}
147+
}

0 commit comments

Comments
 (0)