## SpaceFX
<br>
A simple tiny space game written in JavaFX.
The "dev" branch contains new developments that might come to the game later on. The "simpleversion" branch is like the name says more simple and should also run on
embedded devices etc.
The "master" branch now contains some more fun things like enemies attacking in waves, a level boss that needs more hits to kill, enemies that drop bombs and an
enemy boss that also fires rockets.
If you want to see/play it in a browser you can check it out at the [jpro demo page](https://demos.jpro.one/spacefx.html)
Donations are welcome at [Paypal](https://paypal.me/hans0l0)
### Desktop and Mobile
<p>Desktop<br><img src="https://raw.githubusercontent.com/HanSolo/SpaceFX/master/SpaceFX_Desktop.jpg" width=50%></img></p>
<p>iOS<br><img src="https://raw.githubusercontent.com/HanSolo/SpaceFX/master/SpaceFX_iOS.jpg" width=50%></img></p>
<p>Android<br><img src="https://raw.githubusercontent.com/HanSolo/SpaceFX/master/SpaceFX_Android.jpg" width=50%></img></p>
<p>Web<br><img src="https://raw.githubusercontent.com/HanSolo/SpaceFX/master/SpaceFX_Web.jpg" width=50%></img></p>
### Youtube video
I've recorded a little [video](https://youtu.be/Kc0lv3R5VG0) that shows the game in action.
### Requirements for building a native package
If you would like to build a native package you should have at least JDK 13 installed
on your machine. Make sure you run on Java13 and do a `gradle clean build jar` on the
command line and execute the build app script e.g. `bash build_app.sh`. If everything
worked ok you will find the native app in the folder `/build/installer`.
To build a native package you will need the early access release of the
jpackage tool. Please find more info [here](https://github.com/dlemmermann/JPackageScriptFX).
### master branch
This branch is using gradle for the build and it needs JDK 17 with OpenJFX 17.0.0.1.
On my machines I use [Zulu](https://cdn.azul.com/zulu/bin/) for the JDK 17 installation and
[OpenJFX](https://openjfx.io/) for the JavaFX installation.
You should be able to fork the branch and open the build.gradle file in your favourite IDE as a project to run it from the code.
To compile it you need to make sure you are on JDK13 and OpenJFX is installed, then execute the following on the command line.
OS X:
```
cd /PATH/TO/SpaceFX
./gradlew clean build
bash ./build_app.sh
```
Windows:
```
cd \PATH\TO\SpaceFX
.\gradlew.bat clean build
.\build_app.bat
```
Linux:
```
cd /PATH/TO/SpaceFX
./gradlew clean build
bash ./build_app_linux.sh
```
After that you will find the runnable jar file in
```
/PATH/TO/SpaceFX/build/libs
```
and the bundle created by the jpackage tool from JDK17 in
```
/PATH/TO/SpaceFX/build/installer
```
### mobile branch
This branch uses maven for the build and it needs at least JDK 11. In principle you simply have to follow the instructions
over at [github](https://github.com/gluonhq/client-samples) from Gluon to make it run on iOS and Android.
If you have the setup your system as mentioned on the github page with the Gluon examples you can build/deploy SpaceFX to your
device as follows. To build/run it on iOS you need to run it on a Mac and to build/run it on Android you need to run it on Linux.
First of all make sure you are on JDK11 and that you have installed all things described on github.
iOS:
Make sure your iPhone is registered as a developer device at [apple](https://developer.apple.com/) and is plugged into your Mac.
```
export JAVA_HOME=$GRAALVM_HOME
cd /PATH/TO/SpaceFX
mvn clean -Pios client:build
mvn -Pios client:run
```
The iOS spacefx.app file can be found at
```
/PATH/TO/SpaceFX/target/client/arm64-ios/
```
OSX:
```
export JAVA_HOME=$GRAALVM_HOME
cd /PATH/TO/SpaceFX
mvn clean client:build
```
The OSX spacefx binary can be found at
```
/PATH/TO/SpaceFX/target/client/x86_64-darwin
```
Android:
Make sure your Android phone is a developer phone and is plugged into your Linux machine.
```
export JAVA_HOME=$GRAALVM_HOME
cd /PATH/TO/SpaceFX
mvn clean -Pandroid client:build
mvn -Pandroid client:run
```
The Android spacefx.apk file can be found at
```
/PATH/TO/SpaceFX/target/client/aarch64-android/gvm/apk/bin
```
Linux:
```
export JAVA_HOME=$GRAALVM_HOME
cd /PATH/TO/SpaceFX
mvn clean client:build
```
The Linux binary can be found at
```
/PATH/TO/SpaceFX/target/x86_64-linux
```
Keep in mind that at the moment there is no support for sound when using the GraalVM/Substrate combo.
###Attention:
Because we use different build tools for the master and mobile branch at the moment it can lead to problems
in your favourite IDE when switching branches. To avoid those problems just keep the following steps in mind:
When switching from the master to the mobile branch you should follow these simple steps:
- remove the project from your IDE
- close your IDE
- switch branch from master to mobile
- remove files/folders like .gradle, .idea, /build and /logs
- start your IDE
- open the pom.xml file as a project
When switching from mobile to the master branch you should follow these simple steps:
- remove the project from your IDE
- close your IDE
- switch branch from mobile to master
- start your IDE
- open the build.gradle file as a project
### Run SpaceFX in the browser using jpro
To run SpaceFX in the browser you will need to set the used JDK to 11 in
the build.gradle file. In the future you will also be able to use JDK 13 etc.
More info on how to run a JavaFX application in the browser can be found
here [jpro](https://www.jpro.one/?page=docs/current/1.1/).
To make SpaceFX run in your browser you need to be on the master branch and execute the following steps:
Open the build.gradle file in an editor and comment out the line:
```
//mainClassName = "$moduleName/eu.hansolo.spacefx.SpaceFX"
```
Now enable the line:
```
mainClassName = "eu.hansolo.spacefx.SpaceFX"
```
On the command line execute:
```
cd /PATH/TO/SpaceFX
./gradlew jproRun
```
Open a browser and go to ```localhost:8080```
没有合适的资源?快使用搜索试试~ 我知道了~
只是一个用 JavaFX 编写 的简单的微型太空游戏_java_代码_下载
共243个文件
png:144个
wav:26个
java:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 51 浏览量
2022-06-24
17:21:14
上传
评论
收藏 176.77MB ZIP 举报
温馨提示
一个用 JavaFX 编写的简单的微型太空游戏。 “dev”分支包含稍后可能会出现在游戏中的新开发。“simpleversion”分支就像名字所说的更简单,也应该在嵌入式设备等上运行。“master”分支现在包含一些更有趣的东西,比如敌人在波浪中攻击,一个需要更多命中才能杀死的关卡老板,敌人投掷炸弹和一个也会发射火箭的敌人老板。 效果展示: https://raw.githubusercontent.com/HanSolo/SpaceFX/master/SpaceFX_Desktop.jpg 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
只是一个用 JavaFX 编写 的简单的微型太空游戏_java_代码_下载
(243个子文件)
startscreenAndroid.afdesign 12.44MB
halloffamescreenAndroid.afdesign 12.44MB
startscreenIOS.afdesign 12.43MB
gameoverIOS.afdesign 12.43MB
halloffamescreenIOS.afdesign 12.43MB
gameoverAndroid.afdesign 12.43MB
ArcadeBanner.afdesign 2.58MB
startscreen.afdesign 1.05MB
gameover.afdesign 1.05MB
halloffamescreen.afdesign 1.05MB
fighter.afdesign 238KB
buttons.afdesign 15KB
EnemyWaveBezier.afdesign 9KB
background.afphoto 4.38MB
torpedos.afphoto 556KB
build_app.bat 3KB
gradlew.bat 2KB
spacefx-mobile.css 717B
spacefx.css 717B
.gitignore 265B
build.gradle 3KB
settings.gradle 30B
gradlew 5KB
icon.icns 147KB
icon.ico 122KB
iTunesArtwork 290KB
iTunesArtwork@2x 846KB
gradle-wrapper.jar 54KB
SpaceFXView.java 144KB
WaveType.java 17KB
Config.java 15KB
InitialDigit.java 11KB
Level2.java 8KB
Level3.java 7KB
Level1.java 7KB
SpaceFX.java 6KB
PropertyManager.java 4KB
Helper.java 3KB
Level.java 1KB
Fonts.java 1KB
Difficulty.java 951B
WaveCoordinate.java 875B
Launcher.java 741B
module-info.java 276B
SpaceFX_Android.jpg 711KB
backgroundL3.jpg 394KB
backgroundL2.jpg 392KB
SpaceFX_Web.jpg 381KB
backgroundL1.jpg 370KB
SpaceFX_Desktop.jpg 350KB
SpaceFX_iOS.jpg 287KB
startscreen.jpg 101KB
gameover.jpg 101KB
halloffamescreen.jpg 97KB
startscreenIOS.jpg 67KB
gameoverIOS.jpg 66KB
halloffamescreenIOS.jpg 65KB
Contents.json 3KB
Contents.json 62B
README.md 6KB
RaceToMars.mp3 9.39MB
CityStomper.mp3 7.39MB
EnemyWave_Bezier_Calculation.numbers 198KB
Default-Info.plist 1KB
backgroundL3.png 2.71MB
backgroundL2.png 2.67MB
backgroundL1.png 2.44MB
enemyRocketExplosionL3.png 2.06MB
enemyBossExplosionL3.png 2.03MB
enemyBossExplosionL2.png 2.01MB
upExplosion.png 1.95MB
enemyRocketExplosionL2.png 1.94MB
enemyBossExplosionL1.png 1.92MB
levelBossExplosionL3.png 1.86MB
asteroidExplosion.png 1.83MB
levelBossExplosionL2.png 1.83MB
levelBossExplosionL1.png 1.76MB
enemyRocketExplosionL1.png 1.75MB
explosionL1.png 1.39MB
explosionL3.png 1.39MB
explosionL2.png 1.35MB
enemyBoss4L3.png 1.23MB
enemyBoss3L3.png 1.17MB
enemyBoss2L3.png 1.05MB
halloffamescreenAndroid.png 1MB
startscreenAndroid.png 1MB
gameoverAndroid.png 1021KB
enemyBoss4L1.png 915KB
enemyBoss1L3.png 868KB
enemyBoss3L1.png 867KB
enemyBoss2L1.png 832KB
enemyBoss4L2.png 825KB
enemyBoss3L2.png 819KB
enemyBoss2L2.png 789KB
app-store-icon-1024@1x.png 785KB
spaceshipUp.png 775KB
enemyBoss1L1.png 771KB
spaceship.png 748KB
enemyBoss1L2.png 739KB
spaceshipDown.png 718KB
共 243 条
- 1
- 2
- 3
资源评论
快撑死的鱼
- 粉丝: 2w+
- 资源: 9148
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功