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

New
CommunityNews
A new study looks into the dematerialized office, where sensorial experiences such as touch, taste, smell, and sensations of hot or cold ...
New
First poster: bot
nim-lang/Nim. Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages lik...
New
First poster: bot
Typing is Hard Type Checking and Type Inference Common terms Completeness Soundness Decidability Hindley-Milner Type System Dependent t...
New
First poster: bot
One of Haskell’s features that I really liked was list comprehensions, so I was very pleased to discover how nice Julia’s comprehensions ...
New
First poster: bot
In this episode, we look at some common functionality that we got with Rails UJS and what it looks like to reimplement these with Hotwire...
New
First poster: bot
Metaprogramming in Nim #1 Introduction. In this video i will show you and teach you about Nim’s Metaprogramming features/capabilities. E...
New
CommunityNews
By the end of this guide we’ll have a minimal, working implementation of a small part of Lua from scratch.
New
First poster: bot
Building a Neural Network in Pure Lisp without Built-in Numbers using only Atoms and Lists. A neural network written in pure Lisp withou...
New
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1033 17470 383
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
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
Fl4m3Ph03n1x
Background Lately I am in a quest to find a good quality TTS ai generation tool to run locally in order to create audio for some videos I...
New