The CodeCraft programming game.
Scala GLSL HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
collisions/shared/src
core
docs
graphics
physics/shared/src
project
scalajs-test/src/main
testai/src/main/scala/cwinter/codecraft/testai
util
.gitignore
.scalafmt
README.md
build.sbt

README.md

Welcome! Join the chat at https://gitter.im/cswinter/CodeCraftGame Maven Central

This is the official repository for the CodeCraft Programming Game. If you want to know how to use CodeCraft, you should have a look at this tutorial.

How to build

CodeCraft uses sbt. Most build tasks are straightforward. sbt compile compiles the root project, sbt test runs all the tests, sbt publishLocal publishes the project to your local ivy repository. To start a predefined game, run sbt 'project testai' run.

Repository structure

The project is split into several submodules, each of which resides in a separate folder:

Project Contents
collisions Simple grid based collision detection.
core Implementation of core game mechanics, AIs and public API.
docs Root page for autogenerated ScalaDocs.
graphics OpenGL based graphics engine, 2D primitives library and models for all game objects.
physics Collision detection and physics engine.
scalajs-test Basic webpage that runs a game using the Scala.js version of CodeCraft.
testai Main method to run a predefined game.
util Various maths and utility functions.

Within most of the projects, there are three source directories (js, jvm and shared). This is to allow for compilation to JavaScript using Scala.js. The bulk of the code is inside the shared directories, with only some platform specific code residing in js and jvm.

IDE Setup

IntelliJ

You need to have the Scala plugin installed.
FileNewProject from Existing Sources.. → select root directory → Import project from external modelSBTNext → keep default options unless you have a reason to change them → Finish

Tested on versions 15 and 2017.

Eclipse

I don't use Eclipse, but presumably this is relatively straightforward as well. If you figure it out, please make a pull request to update these instructions.