CosPlay comes with a number of built-in ready to play games:
CosPlay also comes with many examples for each functional area. The source code for these examples is shipped with the project (see org.cosplay.examples
package) and can be also found on GitHub.
If you have CosPlay project in IDE you can review the source code and run each example right from IDE. Each example is a simple Scala application with the main(...)
method. The easiest way to run examples from the command line is to use SBT or Maven. First, clone and build the CosPlay Git repository (this needs to be done only once):
# One-time Git clone & build: $ git clone https://github.com/nivanov/cosplay.git $ cd cosplay $ sbt package
Assuming you are in cosplay
folder use the following table to run examples:
Example |
---|
Built-In Terminal Emulator
By default, all examples start in the system terminal. If you want to run these examples in the built-in terminal emulator you need to add emuterm
as a program argument. Depending on how you start the example - SBT, Maven, IDE or straight command line - this is done differently. For example, to run video example using built-in terminal emulation:
$ sbt "project cosplay; runMain org.cosplay.examples.video.CPVideoExample emuterm"