CommunityNews

CommunityNews

Tutorial: Writing a Tiny Rust Game Engine for Web

In this tutorial we’ll use the Rust programming language to code a tiny game engine. Our game engine will respond to key presses, draw rectangles, and define a structure that could accomodate a larger engine.

Our engine will use no code other than Rust’s standard library and the APIs the browser provides us. It will compile near-instantly (less than a second on my computer) and be about 130 lines of code total.

If you aren’t familiar with Rust it’s a relatively new programming language that runs fast and helps you write better code.

This tutorial includes some Javascript and web code, but the general ideas apply to non-web as well.

To follow along you should already know the basics of programming. This tutorial is written to be legible for a Rust beginner and skimmable for a Rust expert.

Let’s begin!

Read in full here:

https://ianjk.com/game-engine-in-rust/

This thread was posted by one of our members via one of our news source trackers.

Where Next?

Popular Backend topics Top

First poster: bot
It’s Time to Say Goodbye to Docker. Docker is not the only containerization tool out there and there might just be better alternatives… ...
New
First poster: OvermindDL1
What we can learn from “_why” the long lost open source developer… Code might not last forever, but _why proves you can have an impact t...
New
First poster: bot
GitHub - cshum/imagor: Fast, Docker-ready image processing server written in Go and libvips, with Thumbor URL syntax. Fast, Docker-ready...
New
First poster: bot
For the first 8 or so years of my programming experience, while I was an undergraduate and later graduate student, working in the experim...
New
First poster: bot
Ruby: How to Run a Rack app in a Background Thread. Stubbing and mocking are fine, but sometimes you want to test full integration. This...
New
First poster: adamaiken89
PHP: Frankenstein arrays. PHP has become quite a nice language, but there are some ugly legacies left from the past. Like the deceptive ...
New
New
First poster: bot
IS C++ DOOMED?. I was bored so wrote a contiguous queue in C++ ( ). These are my thoughts from that exercise. INTRO I’ve written a lot o...
New
First poster: bot
clog/LEARN.md at main · rabbibotton/clog. CLOG - The Common Lisp Omnificent GUI. Contribute to rabbibotton/clog development by creating ...
New
First poster: bot
GitHub - nim-works/nimskull: An in development statically typed systems programming language; with sustainability at its core. We, the co...
New

Other popular topics Top

Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1143 25883 760
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
hilfordjames
There appears to have been an update that has changed the terminology for what has previously been known as the Taskbar Overflow - this h...
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New