A quick port of "A first-person engine in 265 lines" from JavaScript to Java using the libGDX framework.
Switch branches/tags
Nothing to show
Clone or download
Latest commit ff60672 Jun 6, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android Initial commit Jun 6, 2014
core Initial commit Jun 6, 2014
desktop Initial commit Jun 6, 2014
gradle/wrapper Initial commit Jun 6, 2014
html Initial commit Jun 6, 2014
ios Initial commit Jun 6, 2014
.gitignore Initial commit Jun 6, 2014
LICENSE Add license Jun 6, 2014
README.md Add screenshot to README Jun 6, 2014
build.gradle Initial commit Jun 6, 2014
gradle.properties Initial commit Jun 6, 2014
gradlew Initial commit Jun 6, 2014
gradlew.bat Initial commit Jun 6, 2014
settings.gradle Initial commit Jun 6, 2014

README.md

Raycaster

This is a quick port of "A first-person engine in 265 lines" from JavaScript to Java using the libGDX framework.

Screenshot

Porting details

Besides the obvious changes in rendering and input code there is four new types introduced that in the original code are represented either as an Array or Object.

  • Point
  • Projection
  • Ray
  • Step

Building

To test it out download the repository and build it using gradle.

Requirements

The following instructions assumes you are in the root folder of the project, eg.

$ git clone https://github.com/walle/raycaster.git
$ cd raycaster

The first time you build the project is going to take a while since all dependencies are downloaded, will be faster after that.

Building the desktop version

The easiest way to test the project is on desktop, just run

$ ./gradlew desktop:run

Building the Android version

Make sure you have the Android SDK and have created an AVD. http://developer.android.com/sdk/index.html#download Start the emulator with your AVD and have it running before building the project. Eg.

$ cd /path/to/android/sdk
$ tools/emulator -avd my_avd_name -gpu on

When you see the emulated home screen, run the gradle task

$ ./gradlew android:installDebug android:run

Building the web version

$ ./gradlew html:superDev

Then open your browser to http://localhost:8080/html/

Building the IOS version

To build the IOS version it's required to use OS X. Also to have Xcode installed, install it from the AppStore. When you have Xcode installed, make sure you have the iOS Simulator installed, otherwise install it. Xcode -> Preferences -> Downloads Then run the gradle task to start the simulator.

$ ./gradlew ios:assemble launchIPhoneSimulator

License

The code is under MIT license, ported from JavaScript.

The images used are from the article http://www.playfuljs.com/a-first-person-engine-in-265-lines/.