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.

Popular Backend topics Top

New
First poster: bot
For the first time in the history of TIOBE’s index, Java has slipped out of the top two, leaving Python to occupy the spot behind reignin...
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
CommunityNews
Tails is a minimal, fast Forth-like interpreter core. It uses no assembly code, only C++, but an elegant tail-recursion technique inspire...
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
CommunityNews
GitHub - mthom/scryer-prolog: A modern Prolog implementation written mostly in Rust… A modern Prolog implementation written mostly in Ru...
New
First poster: bot
GitHub - nanobowers/py2cr: Python3 to Crystal Translation using Python AST Walker. Python3 to Crystal Translation using Python AST Walke...
New
First poster: bot
Writing a Game Boy Emulator in OCaml. For the past few months, I have been working on a project called CAMLBOY, a Game Boy emulator that...
New
CommunityNews
The other day I got a mail from Dean Galvin from Rowan University. Dean was doing an Erlang project so he asked “What example program wou...
New
First poster: bot
Some Thoughts on Zig — Sympolymathesy, by Chris Krycho. One of the biggest things Zig has going for it—especially compared to Rust—is th...
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’...
1021 17084 374
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
AstonJ
Or looking forward to? :nerd_face:
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1134 25459 753
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New