Join Nathan Stocks for a fast-paced, entertaining, curiously-informative, hands-on even deeper dive into the Rust programming language. This is the second course in the Ultimate Rust series following the Ultimate Rust Crash Course. If you like that course, you'll love this one.
Join Nathan Stocks for a fast-paced, entertaining, curiously-informative, hands-on even deeper dive into the Rust programming language. This is the second course in the Ultimate Rust series following the Ultimate Rust Crash Course. If you like that course, you'll love this one.
This is a hands-on course. Not only are there targeted exercise for each topic discussed, there are also a series of project scenarios that walk you through using what you've learned to put together playable game prototypes that work on macOS, Linux, and Windows. These projects will make use of Rusty Engine, a game engine developed specifically for this course to keep game engine concepts to a minimum so you can focus on using exactly what you learned in this course.
Rust is a systems programming language that eliminates entire classes of bugs and security vulnerabilities, has zero-cost abstractions like C and C++, is fun to program in, and lets systems programmers have nice things. No wonder Rust is gaining traction in spaces as diverse as game engines, high-performance computing, embedded devices, and web programming. Learn how to write high-performance code without the worry of crashes or security vulnerabilities. Join a vibrant community of developers where diversity, inclusion, and just plain being nice are all first-class objectives.
Introduce myself and what this course is all about!
In this video:
What this course is all about
Why it's so fun
Game prototype teaser (using Rusty Engine!)
Show how to find the repository containing the exercises.
How to write idiomatic code (write code like a professional).
In this video:
rustfmt
clippy
attributes
This exercise gives you an opportunity to use rustfmt and clippy to take a terrible mess of code and make it look snazzy.
How to document your code and generate a documentation web site using inline comments in your code and "cargo doc".
In this video:
Helpful options you should use
Inner & Outer documentation comments
Rust-flavored markdown syntax
This exercise walks you through documenting an undocumented library, and generating a web site with images and intra-doc links!
How to publish a crate on crates.io.
In this video:
How to set up your account with crates.io
Cargo.toml configuration
cargo publish
A placeholder for a future crate publishing exercise, if they introduced namespaces for publishing crates.
How to use closures.
In this video:
What a closure is
Syntax
Gotchas
How to use those closures we just talked about in iterators. A bit of functional programming.
In this video:
Iterators
Iterator adapters
Iterator consumers
An exercise to use a bunch of closures in a bunch of iterators.
A tour of some of the most common traits from the standard library.
In this video:
How to derive a trait
How to manually implement a trait
Examples of deriving or implementing some of the most common traits from std
This exercise walks you through defining a trait and then using it.
How to create error types for your library in 5 (and a half) steps.
In this video:
How to group errors
Error trait
thiserror crate
How to handle errors that you receive.
In this video:
panic
"?" try operator
anyhow crate
Define an error type. Create the error. Handle the error!
How to write and run unit tests for your code.
In this video:
#[cfg(test)]
#[test] functions
cargo test
How to write and run integration tests for your code.
In this video:
The "tests/" directory
Running your integration tests
Finding your test output
How to write and run benchmark tests for your code.
In this video:
Criterion
How to get started writing benchmarks
Why benchmarks are so cool (HTML reports)
Write some unit tests and integration tests!
How simple logging works in Rust.
In this video:
log crate
log macros
env_logger
Use logging macros in a library, configure a binary to output the log info to stderr, see the difference in output at different log levels.
How to spawn, manage, and join threads.
In this video:
Why use threads
thread spawning
passing data to / from a thread at creation / joining
How Crossbeam channels can be used to communicate between threads.
In this video:
crossbeam crate
bounded vs unbounded channels
the Send trait
Spawn threads and use channels to communicate between them.
Overview of the project section.
How to set up and configure a project to use Rusty Engine.
How to initialize Rusty Engine within your project.
How to define a custom struct to store your game state.
How to define a game logic function and add it to your game.
How to create and manipulate sprites in your game project.
How to deal with colliders and collisions in your game project.
How to handle keyboard input in your game project.
How to handle mouse input in your game project.
How to create and manage text in your game project.
How to handle music and sound effects in your game project.
How to use timers in your game project.
A bit more about the Engine struct and the Game struct that weren't covered elsewhere.
The common setup that needs to be done before starting any Game Scenario project:
Add Rusty Engine as a dependency to Cargo.toml
Download the asset pack
Set up main.rs
Compile and run the project
This is a full walkthrough the Road Race game scenario from Rusty Engine's list of scenarios. This assumes that you've done the "common setup" from the video of the same name.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.