Crates.io | rusty_sword_arena |
lib.rs | rusty_sword_arena |
version | 2.0.0 |
source | src |
created_at | 2018-07-03 21:23:04.818603 |
updated_at | 2020-02-29 20:25:18.530389 |
description | Library/repository for the half-day Rust tutorial teaching you how to make a game client in Rust. |
homepage | https://conferences.oreilly.com/oscon/oscon-or/public/schedule/detail/75769 |
repository | https://github.com/CleanCut/rusty_sword_arena |
max_upload_size | |
id | 72795 |
size | 555,971 |
This is the companion repository to the half-day tutorial for OSCON 2019. (The links you need during OSCON are in the Resources section at the bottom)
Just watching the training will be entertaining and informative, but you will truly learn a lot more if you actually dig in and do some coding! This repository is for you hands-on-learners who are ready to roll.
I use macOS, and that is what I developed Rusty Sword Arena on. Everything ought to be able to work on major Linux distributions and Windows. Please do the following preparation before OSCON so we can focus our time on learning Rust. Please contact me ASAP if you have trouble with anything on this page.
We will be using Rust 1.35.0 or newer for Rusty Sword Arena.
Get Started
button and follow the instructions to install Rust for your operating system.
You should get somewhat similar output (versions may be newer) if you run commands like the ones below. If you get a
version older than 1.35.0, then run rustup update
to install a newer version.
$ rustc --version
rustc 1.35.0 (3c235d560 2019-05-20)
$ cargo --version
cargo 1.35.0 (6f3e9c367 2019-04-04)
If you have any trouble with installation or running the commands above, please contact me before OSCON!!!
ZeroMQ 4.1.x or later is used under-the-hood for networking. It's abstracted away, so you will not actually deal with it other than making sure the library portion of it is installed so Rust can find it.
On Linux, the alsa development libraries are needed for sound.
macOS
Make sure you have Homebrew installed and then run
brew install pkgconfig zmq
CentOS
# czmq-devel is in EPEL (Extra Packages for Linux), so if you haven't installed it, do
sudo yum install -y epel-release
# ...then you can actually install the dependencies
sudo yum install -y czmq-devel alsa-lib-devel
Debian/Ubuntu
Run the following AND follow the instructions for Debian/Ubuntu in the
ZeroMQ's download documentation (you might need to create an
/etc/apt/sources.list.d/zeromq.list
file if you don't have a sources.list
file on Debian 9) :
sudo apt install libasound2-dev
sudo apt install pkgconf
Other Operating Systems
Follow the instructions in ZeroMQ's download documentation 4.1.x or later for your operating system.
THIS IS THE IMPORTANT PART! Following these steps will download a few hundred dependencies, which is really important to do before OSCON because when a hundred people do it at the same time at the conference the IT folks freak out and scold me. :wink: Also, this will ensure that you have a working environment so that you will be able to listen during the tutorial instead of trying to get this stuff working.
cargo run --bin server
Ctrl-C
cargo run --bin client -- YOURNAME localhost
YOURNAME
with your own name, for example: Nathan
Escape
key.Ctrl-C
in its terminal window.If you got through all those steps without anything crashing, then you are all ready for OSCON. We are going to learn Rust while making our own game client similar to this reference implementation. ✨🎉✨
Please do each of the following before OSCON (see the How To Learn Rust page for details on all of these)
cargo new message
cd message
cargo run
src/main.rs
and change the message.cargo run
again to see your new message.Now you are ready for the tutorial! You are going to make your own game client far Rusty Sword Arena!