* Cantinho Satkeys

Refresh History
  • JP: try65hytr Pessoal  4tj97u<z 2dgh8i k7y8j0
    Hoje às 04:41
  • romi: Beleza
    Hoje às 04:28
  • cereal killa: try65hytr pessoal  2dgh8i
    18 de Junho de 2026, 23:28
  • JP: dgtgtr Pessoal  2dgh8i k7y8j0 r4v8p
    18 de Junho de 2026, 19:48
  • joaozinho_bosco: boas tardes.......há quanto tempo
    18 de Junho de 2026, 14:35
  • j.s.: dgtgtr a todos  49E09B4F
    16 de Junho de 2026, 18:24
  • JP: try65hytr Pessoal  2dgh8i k7y8j0 classic
    16 de Junho de 2026, 05:44
  • j.s.: bom fim de semana  4tj97u<z
    13 de Junho de 2026, 11:23
  • j.s.: ghyt74 a todos  49E09B4F
    13 de Junho de 2026, 11:23
  • JP: try65hytr A Todos  4tj97u<z 2dgh8i k7y8j0 r4v8p
    12 de Junho de 2026, 05:28
  • JP: try65hytr Pessoal  2dgh8i k7y8j0 yu7gh8
    10 de Junho de 2026, 03:47
  • j.s.: passem por aqui [link]
    09 de Junho de 2026, 20:57
  • j.s.: um anonimo contribuiu com €10,00  h7t45
    09 de Junho de 2026, 20:56
  • j.s.: try65hytr a todos  49E09B4F
    09 de Junho de 2026, 20:56
  • m1957: Vamos todos colaborar para que o forum continue! Bom fim de semana.
    06 de Junho de 2026, 02:24
  • cereal killa: dgtgtr pessoal  49E09B4F
    04 de Junho de 2026, 14:49
  • j.s.: [link]
    03 de Junho de 2026, 10:01
  • j.s.: fica aqui a descrição do numero da conta
    03 de Junho de 2026, 10:00
  • j.s.: podem fazer, como tem sido sempre feito, por transferencia bancaria
    03 de Junho de 2026, 10:00
  • j.s.: por lapso não foi indicado  como podem ajudar o  forum
    03 de Junho de 2026, 09:58

Autor Tópico: Snake Game With Rust, JavaScript, and WebAssembly  (Lida 498 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Online mitsumi

  • Sub-Administrador
  • ****
  • Mensagens: 133578
  • Karma: +0/-0
Snake Game With Rust, JavaScript, and WebAssembly
« em: 29 de Junho de 2020, 12:16 »


Snake Game With Rust, JavaScript, and WebAssembly
MP4 | Video: h264, 1280x720 | Audio: AAC, 44.1 KHz, 2 Ch
Genre: eLearning | Language: English | Duration: 11 lectures (1h 13m) | Size: 268.6 MB
Build a Real Game With Rust and Javascript

What you'll learn:
Connect JavaScript and Rust with WebAssembly
Game Development Basics
Practical Applications of Vectors

Requirements
JavaScript Basics
Rust Basics

Description
In this course, we will build a Snake Game with Rust, JavaScript, and WebAssembly. We will learn how to export API implemented with Rust to JavaScript app. We will get to know canvas rendering, applications of vectors, and basics of game development so that at the end of the course, you can take the core of this project and improve it or create your game.

Before we start writing code, we need to have a clear vision of what we are going to build. Let's first decide on what features the game will have and how it will look like so that we can make a plan of action.

We are going to build a classic snake game that you can see on the screen. When the snake eats food, it becomes longer, and the score increases. If the snake heats the wall or bites the tail game is over. Additionally, we will allow the player to stop the game by pressing the space button. To keep the user motivated, we will save the best score and show it alongside the current one. We make sure that the game looks good on any screen size, be it a tiny mobile phone or a large TV.

We want each component of the game to be as independent as possible. We will implement the core logic of the game with Rust and will export API to JavaScript via WebAssembly.

The main thing that we will export from Rust is Game struct with a constructor and two public methods. The first method will receive a duration from the last update and direction that the user wants a snake to take. The second method will check if the game is over.

On the JavaScript side, we will run the game loop, call API methods, render all game elements, capture user input, and save the best score.

Now let's plan how we are going to make it all happen. First, we will install the tools needed for development and start the project. Then we will create an instance of the Game struct from JavaScript. Next, we will render all the objects of the game. Then we will implement logic to place food in a random place that is free from the snake. After that, we will start the game loop and make the snake move. Next, we will allow the user to control the snake direction and stop the game. After that, we will make that every time the snake eats the food, its tail grows longer. Finally, we will complete the development of the game by adding logic that will restart the game when the player lost and deploy the game.

All the source code you can find in the repository. Each part will have a link to the corresponding commit. There are a lot of things to cover in this short course, so let's jump in.

Who this course is for
Beginner Game Developers
JavaScript Developers
Rust Developers

Screenshots


Download link:
Só visivel para registados e com resposta ao tópico.

Only visible to registered and with a reply to the topic.

Links are Interchangeable - No Password - Single Extraction