cswinter / codecraftgame   0.7.0

Website GitHub

The CodeCraft programming game.

Scala versions: 2.11
Scala.js versions: 0.6

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.