-
-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from AlmasB/0.3.4
0.3.4
- Loading branch information
Showing
814 changed files
with
4,167 additions
and
22,185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ public class BasicGameApp extends GameApplication { | |
## Getting Started | ||
|
||
* Written tutorials - [Wiki](https://github.com/AlmasB/FXGL/wiki) | ||
* Video tutorials - [YouTube](https://www.youtube.com/watch?v=mPE8p8p_YjQ&list=PL4h6ypqTi3RTiTuAQFKE6xwflnPKyFuPp) | ||
* Video tutorials - [YouTube](https://www.youtube.com/playlist?list=PL4h6ypqTi3RTiTuAQFKE6xwflnPKyFuPp) | ||
* The [Samples](fxgl-samples) module is constantly updated with feature demos | ||
* Advanced examples - [FXGLGames](https://github.com/AlmasB/FXGLGames) | ||
* Pre-built game demos (standalone .jar) - [Games](https://github.com/AlmasB/FXGLGames/tree/master/binaries) | ||
|
@@ -64,7 +64,7 @@ public class BasicGameApp extends GameApplication { | |
<dependency> | ||
<groupId>com.github.almasb</groupId> | ||
<artifactId>fxgl</artifactId> | ||
<version>0.3.3</version> | ||
<version>0.3.4</version> | ||
</dependency> | ||
``` | ||
|
||
|
@@ -76,19 +76,14 @@ repositories { | |
} | ||
dependencies { | ||
compile 'com.github.almasb:fxgl:0.3.3' | ||
compile 'com.github.almasb:fxgl:0.3.4' | ||
} | ||
``` | ||
|
||
## Uber jar | ||
|
||
Latest pre-compiled uber jar can be found in [Releases](https://github.com/AlmasB/FXGL/releases) | ||
|
||
## Download Count | ||
|
||
* GitHub Releases (uber jar): ![Github Releases](https://img.shields.io/github/downloads/AlmasB/FXGL/total.svg) | ||
* Maven Central: 16.05.2017 ![Maven](https://img.shields.io/badge/downloads-~170%2Fmonth-green.svg?style=flat) | ||
|
||
## Contribution | ||
|
||
[Contribute](CONTRIBUTING.md) to FXGL, or support FXGL on [Gratipay](https://gratipay.com/FXGL/). | ||
|
@@ -97,6 +92,5 @@ Alternatively star the repo to show interest. | |
## Contact | ||
[![Chat](https://badges.gitter.im/AlmasB/FXGL.svg)](https://gitter.im/AlmasB/FXGL) | ||
[![Gmail](https://img.shields.io/badge/[email protected])](https://plus.google.com/+AlmasB0/about) | ||
[![Google+](https://img.shields.io/badge/Google+-AlmasB-red.svg)](https://plus.google.com/+AlmasB0/about) | ||
[![Survey](https://img.shields.io/badge/Feedback-SurveyMonkey-red.svg)](https://www.surveymonkey.com/r/BH6LLPM) | ||
[![Survey2](https://img.shields.io/badge/Feedback-Google%20Forms-red.svg)](https://goo.gl/forms/6wrMnOBxTE1fEpOy2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ The MIT License (MIT) | ||
~ | ||
~ FXGL - JavaFX Game Library | ||
~ | ||
~ Copyright (c) 2015-2017 AlmasB ([email protected]) | ||
~ | ||
~ Permission is hereby granted, free of charge, to any person obtaining a copy | ||
~ of this software and associated documentation files (the "Software"), to deal | ||
~ in the Software without restriction, including without limitation the rights | ||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
~ copies of the Software, and to permit persons to whom the Software is | ||
~ furnished to do so, subject to the following conditions: | ||
~ | ||
~ The above copyright notice and this permission notice shall be included in | ||
~ all copies or substantial portions of the Software. | ||
~ | ||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
~ SOFTWARE. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>fxgl-framework</artifactId> | ||
<groupId>com.github.almasb</groupId> | ||
<version>0.3.3</version> | ||
<version>0.3.4</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,7 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* FXGL - JavaFX Game Library | ||
* | ||
* Copyright (c) 2015-2017 AlmasB ([email protected]) | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* FXGL - JavaFX Game Library. The MIT License (MIT). | ||
* Copyright (c) AlmasB ([email protected]). | ||
* See LICENSE for details. | ||
*/ | ||
|
||
package com.almasb.fxglgames.breakout; | ||
|
@@ -65,11 +45,11 @@ | |
public class BreakoutApp extends GameApplication { | ||
|
||
private BatControl getBatControl() { | ||
return getGameWorld().getEntitiesByType(BreakoutType.BAT).get(0).getControlUnsafe(BatControl.class); | ||
return getGameWorld().getEntitiesByType(BreakoutType.BAT).get(0).getControl(BatControl.class); | ||
} | ||
|
||
private BallControl getBallControl() { | ||
return getGameWorld().getEntitiesByType(BreakoutType.BALL).get(0).getControlUnsafe(BallControl.class); | ||
return getGameWorld().getEntitiesByType(BreakoutType.BALL).get(0).getControl(BallControl.class); | ||
} | ||
|
||
@Override | ||
|
@@ -159,7 +139,7 @@ protected void initPhysics() { | |
getPhysicsWorld().addCollisionHandler(new CollisionHandler(BreakoutType.BALL, BreakoutType.BRICK) { | ||
@Override | ||
protected void onCollisionBegin(Entity ball, Entity brick) { | ||
brick.getControlUnsafe(BrickControl.class).onHit(); | ||
brick.getControl(BrickControl.class).onHit(); | ||
} | ||
}); | ||
} | ||
|
26 changes: 3 additions & 23 deletions
26
fxgl-games/src/main/java/com/almasb/fxglgames/breakout/BreakoutFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,7 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* FXGL - JavaFX Game Library | ||
* | ||
* Copyright (c) 2015-2017 AlmasB ([email protected]) | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* FXGL - JavaFX Game Library. The MIT License (MIT). | ||
* Copyright (c) AlmasB ([email protected]). | ||
* See LICENSE for details. | ||
*/ | ||
|
||
package com.almasb.fxglgames.breakout; | ||
|
26 changes: 3 additions & 23 deletions
26
fxgl-games/src/main/java/com/almasb/fxglgames/breakout/BreakoutType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,7 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* FXGL - JavaFX Game Library | ||
* | ||
* Copyright (c) 2015-2017 AlmasB ([email protected]) | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* FXGL - JavaFX Game Library. The MIT License (MIT). | ||
* Copyright (c) AlmasB ([email protected]). | ||
* See LICENSE for details. | ||
*/ | ||
|
||
package com.almasb.fxglgames.breakout; | ||
|
32 changes: 6 additions & 26 deletions
32
fxgl-games/src/main/java/com/almasb/fxglgames/breakout/control/BallControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,26 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* FXGL - JavaFX Game Library | ||
* | ||
* Copyright (c) 2015-2017 AlmasB ([email protected]) | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* FXGL - JavaFX Game Library. The MIT License (MIT). | ||
* Copyright (c) AlmasB ([email protected]). | ||
* See LICENSE for details. | ||
*/ | ||
|
||
package com.almasb.fxglgames.breakout.control; | ||
|
||
import com.almasb.fxgl.core.math.Vec2; | ||
import com.almasb.fxgl.ecs.AbstractControl; | ||
import com.almasb.fxgl.ecs.Control; | ||
import com.almasb.fxgl.ecs.Entity; | ||
import com.almasb.fxgl.physics.PhysicsComponent; | ||
|
||
/** | ||
* @author Almas Baimagambetov ([email protected]) | ||
*/ | ||
public class BallControl extends AbstractControl { | ||
public class BallControl extends Control { | ||
|
||
private PhysicsComponent physics; | ||
|
||
// @Override | ||
// public void onAdded(Entity entity) { | ||
// physics = entity.getComponentUnsafe(PhysicsComponent.class); | ||
// physics = entity.getComponent(PhysicsComponent.class); | ||
// } | ||
|
||
@Override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,14 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* FXGL - JavaFX Game Library | ||
* | ||
* Copyright (c) 2015-2017 AlmasB ([email protected]) | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* FXGL - JavaFX Game Library. The MIT License (MIT). | ||
* Copyright (c) AlmasB ([email protected]). | ||
* See LICENSE for details. | ||
*/ | ||
|
||
package com.almasb.fxglgames.breakout.control; | ||
|
||
import com.almasb.fxgl.app.FXGL; | ||
import com.almasb.fxgl.core.math.Vec2; | ||
import com.almasb.fxgl.ecs.AbstractControl; | ||
import com.almasb.fxgl.ecs.Control; | ||
import com.almasb.fxgl.ecs.Entity; | ||
import com.almasb.fxgl.entity.Entities; | ||
import com.almasb.fxgl.entity.GameEntity; | ||
|
@@ -37,7 +17,7 @@ | |
/** | ||
* @author Almas Baimagambetov ([email protected]) | ||
*/ | ||
public class BatControl extends AbstractControl { | ||
public class BatControl extends Control { | ||
|
||
private static final float BOUNCE_FACTOR = 1.5f; | ||
private static final float SPEED_DECAY = 0.66f; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,20 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* FXGL - JavaFX Game Library | ||
* | ||
* Copyright (c) 2015-2017 AlmasB ([email protected]) | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* FXGL - JavaFX Game Library. The MIT License (MIT). | ||
* Copyright (c) AlmasB ([email protected]). | ||
* See LICENSE for details. | ||
*/ | ||
|
||
package com.almasb.fxglgames.breakout.control; | ||
|
||
import com.almasb.fxgl.app.FXGL; | ||
import com.almasb.fxgl.ecs.AbstractControl; | ||
import com.almasb.fxgl.ecs.Control; | ||
import com.almasb.fxgl.ecs.Entity; | ||
import com.almasb.fxgl.entity.component.ViewComponent; | ||
|
||
/** | ||
* @author Almas Baimagambetov ([email protected]) | ||
*/ | ||
public class BrickControl extends AbstractControl { | ||
public class BrickControl extends Control { | ||
|
||
private int lives = 2; | ||
|
||
|
@@ -49,7 +29,7 @@ public void onHit() { | |
lives--; | ||
|
||
if (lives == 1) { | ||
ViewComponent view = getEntity().getComponentUnsafe(ViewComponent.class); | ||
ViewComponent view = getEntity().getComponent(ViewComponent.class); | ||
view.setView(FXGL.getAssetLoader().loadTexture("breakout/brick_blue_cracked.png", 232 / 3, 104 / 3)); | ||
} else if (lives == 0) { | ||
getEntity().removeFromWorld(); | ||
|
Oops, something went wrong.