Snake is a built-in ASCII remake of the classic Snake game. This is relatively complete game. Entire game is less 300 lines of code showcasing basic mechanics of the CosPlay games as well as power of programmable shaders.
To play this game run the following commands:
# One-time Git clone & build: $ git clone https://github.com/nivanov/cosplay.git $ cd cosplay # To run the game: $ sbt "project cosplay; package; runMain org.cosplay.games.snake.CPSnakeGame"
# One-time Git clone & build: $ git clone https://github.com/nivanov/cosplay.git $ cd cosplay $ mvn package # To run the game: $ mvn -f modules/cosplay -P snake exec:java
From IDE just execute this class: org.cosplay.games.snake.CPSnakeGame
The game looks like that:
Built-In Terminal Emulator
By default, the game starts in the system terminal. If you want to run this examples in the built-in terminal emulator you need to add emuterm
as a program argument. Depending on how you start the game - SBT, Maven, IDE or straight command line - this is done differently. For example:
$ sbt "project cosplay; runMain org.cosplay.games.snake.CPSnakeGame emuterm"
mvn -f modules/cosplay -P snake exec:java -Dexec.arguments="emuterm"