Introduction

This book will walk you through the creation and design of a basic 3D game using the Phantom game engine.

Why Rust?

Rust is a great alternative to C/C++! A few of the benefits:

  • It provides a smooth workflow for developers with clear, specific error messages from the compiler
  • rustup and cargo make managing rust toolchain installations and rust projects straightforward
  • The lints from clippy help to improve the code quality and catch certain common mistakes
  • rustfmt handles formatting the code and code style
  • Memory safety. Code written outside of unsafe blocks is checked by the borrow checker

Getting Started

Dependencies

This project requires the Rust programming language.

Development Environment Setup

Using vscode and rust-analyzer with the rust-analyzer vscode extension is recommended. However, any Rust development environment you are comfortable with will work.

The official Rust book is a great resource if you are new to Rust.

Quick Windows Setup

On windows, installing programs can be trickier than on other platforms. It is recommended to use a package manager such as Scoop or chocolatey.

First, make sure PowerShell 5 (or later, include PowerShell Core) and .NET Framework 4.5 (or later) are installed. Then run:

# Install scoop
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

# Scoop uses git to update itself and 7zip to extract archives
scoop install git 7zip 

# Install the project's dependencies
scoop install rustup

# Set the stable rust toolchain as the default toolchain
rustup default stable

# Install vscode, kept in a separate bucket called 'extras'
scoop bucket add extras
scoop install vscode