• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

nguillaumin/slick2d-maven: Maven distribution of the Slick2D Gava game developme ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

nguillaumin/slick2d-maven

开源软件地址(OpenSource Url):

https://github.com/nguillaumin/slick2d-maven

开源编程语言(OpenSource Language):

Java 99.8%

开源软件介绍(OpenSource Introduction):

Slick 2D Maven Distribution

The fastest and simplest way to start a new Slick 2D based game.

Build Status

Quickstart

You don't need to clone this repository to get started. The project archetype as well as the JARs are published in the official Maven repositories, so you can just follow the steps below from scratch. Clone this project only if you want to contribute to Slick2D or to the game archetype.

Pre-requisites:

  • Git, Java and Maven working
  • Slick 2D depends on javaws.jar which ships with the Oracle JDK (It's not available in the public Maven repositories). The pom.xml file references a local filesystem path to javaws.jar for that reason.
  • It won't work with OpenJDK for the reason above (Can be solved by providing javaws.jar separately). On some Linux distributions you can install Netx and change the system path to point to netx.jar. For example on Ubuntu the package to install is icedtea-netx-common and the jar is in /usr/share/icedtea-web/netx.jar.

Create a Slick 2D game

The command below is using archetypeVersion=1.0.0. Make sure you use the latest available version from Maven central

cd /home/<user>/projects/   -or-   cd C:\Users\<user>\Projects\

# You can omit the last 4 parameters for interactive mode
mvn archetype:generate -DarchetypeGroupId=org.slick2d -DarchetypeArtifactId=slick2d-basic-game-archetype -DarchetypeVersion=1.0.0 -DgroupId=com.me.game -DartifactId=game -Dversion=0.0.1-SNAPSHOT -Dpackage=com.me.game

cd game
mvn clean package

You'll end up with a packaged game in target/game-0.0.1-SNAPSHOT-release.zip. Just unzip and run game.sh (Linux) or game.bat (Windows). Alternatively, files are also available unzipped in target/game-0.0.1-SNAPSHOT-release/.

Run/Debug from Eclipse

Configuration-free with the awesome Maven Natives plugin ! Just hit the "Run" button !

Manual steps:

  • You must have the Maven Eclipse integration plugin installed (m2e)
  • Import the Maven project
  • Right-click on Game, Debug as, Java application
  • This will fail with java.lang.UnsatifsiedLinkError
  • Run mvn package once, the native libraries will get copied in target/natives
  • Edit your debug configuration (menu Run, Debug configurations...), on the "Arguments" tab, "VM Arguments" field, enter -Djava.library.path=target/natives
  • Click on "Debug" and you're all set !

Why ?

I believe making Slick 2D available through Maven will make life easier for users:

  • Clear versionning scheme
  • Very easy quickstart using Maven archetypes (see above)
  • Simplified dependency management, especially for the native libraries
  • Simplified game packaging

Upstream

It seems that the upstream Slick2D Mercurial repository is not updated any more, despite numerous bug reports and pull requests. Because of that, I'm now accepting patches that I'll integrate and release through Maven. I guess you could consider this project a fork of the official sources.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap