* Cantinho Satkeys

Refresh History
  • FELISCUNHA: ghyt74   49E09B4F  e bom feriado   4tj97u<z
    01 de Novembro de 2024, 10:39
  • JPratas: try65hytr Pessoal  h7ft6l k7y8j0
    01 de Novembro de 2024, 03:51
  • j.s.: try65hytr a todos  4tj97u<z
    30 de Outubro de 2024, 21:00
  • JPratas: dgtgtr Pessoal  4tj97u<z k7y8j0
    28 de Outubro de 2024, 17:35
  • FELISCUNHA: Votos de um santo domingo para todo o auditório  k8h9m
    27 de Outubro de 2024, 11:21
  • j.s.: bom fim de semana   49E09B4F 49E09B4F
    26 de Outubro de 2024, 17:06
  • j.s.: dgtgtr a todos  4tj97u<z
    26 de Outubro de 2024, 17:06
  • FELISCUNHA: ghyt74   49E09B4F  e bom fim de semana
    26 de Outubro de 2024, 11:49
  • JPratas: try65hytr Pessoal  101yd91 k7y8j0
    25 de Outubro de 2024, 03:53
  • JPratas: dgtgtr A Todos  4tj97u<z 2dgh8i k7y8j0
    23 de Outubro de 2024, 16:31
  • FELISCUNHA: ghyt74  pessoal   49E09B4F
    23 de Outubro de 2024, 10:59
  • j.s.: dgtgtr a todos  4tj97u<z
    22 de Outubro de 2024, 18:16
  • j.s.: dgtgtr a todos  4tj97u<z
    20 de Outubro de 2024, 15:04
  • FELISCUNHA: Votos de um santo domingo para todo o auditório  101041
    20 de Outubro de 2024, 11:37
  • axlpoa: hi
    19 de Outubro de 2024, 22:24
  • FELISCUNHA: ghyt74   49E09B4F  e bom fim de semana  4tj97u<z
    19 de Outubro de 2024, 11:31
  • j.s.: ghyt74 a todos  4tj97u<z
    18 de Outubro de 2024, 09:33
  • JPratas: try65hytr Pessoal  4tj97u<z classic k7y8j0
    18 de Outubro de 2024, 03:28
  • schmeagle: iheartradio
    17 de Outubro de 2024, 22:58
  • j.s.: dgtgtr a todos  4tj97u<z
    17 de Outubro de 2024, 18:09

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

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

Online mitsumi

  • Moderador Global
  • ***
  • Mensagens: 115401
  • 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