S2D CLI

Installation & Usage

Get started with S2D CLI by installing the tool and creating your first S2D project.

🔗 Prerequisites

Before installing S2D CLI, ensure you have the following installed:

Platform-specific requirements:

🔗 Installation

S2D CLI is distributed via Coursier. This is the recommended and only supported installation method:

Install via Coursier

cs install s2d --contrib

This will make the s2d command available globally on your system.

Alternative: Build from Source (Not Recommended)

If you need to build from source for development purposes:

git clone https://github.com/FinochioM/S2D_CLI.git
            cd S2D_CLI
            sbt publishLocal

🔗 Verification

Verify your installation by running the help command:

s2d --help

You should see output similar to:

S2D - Scala 2D Native Library CLI Tool

            Usage:
            s2d --generate    Generate a new S2D project template
            s2d --help        Show this help message

🔗 Basic Usage

S2D CLI provides two main commands:

Generate a new project

s2d --generate

Show help

s2d --help

Cancel operation

During project generation, you can type cancel at any prompt to exit.

🔗 Your First Project

Let's create your first S2D project:

  1. Run the generator:
    s2d --generate
  2. Follow the prompts:
    • Enter project name (e.g., "my-first-game")
    • Choose build system (scala-cli recommended for beginners)
    • Enter project path (or press Enter for current directory)
  3. Navigate to your project:
    cd my-first-game
  4. Run the project:
    # For scala-cli projects:
                scala-cli run .
    
                # For sbt projects:
                sbt run

Your S2D window should open displaying a blue background. You're now ready to start building your game!

For more details on project structure and customization, see the Project Generation guide.