Snake implemented in rust.

Overview

rsnake - An implementation of classic snake in rust

This game was built using the piston_window window wrapper.

Download the game

If youre using mac-osx or windows you can either download this game as executeable here - otherwise you can build it locally with cargo.

# run the game
cargo run

# build a binary & execute it
cargo build --release
./target/release/rsnake

Keymap

  • W/A/S/D or Up/Left/Down/Right - Controll snake direction.
  • R - Restart the game.
  • ESC - Quit the game.

Known Flaws / ToDo List

  • R has no effect yet.
  • There should be an endscreen with restart / quit buttons.
  • The fruit and snake could possibly spawn at the same coordinate / fruits can spawn inside the tail of the snake.
You might also like...
😠⚔️😈 A minimalistic 2D turn-based tactical game in Rust
😠⚔️😈 A minimalistic 2D turn-based tactical game in Rust

Zemeroth is a turn-based hexagonal tactical game written in Rust. Support: patreon.com/ozkriff News: @ozkriff on twitter | ozkriff.games | facebook |

⬡ Zone of Control is a hexagonal turn-based strategy game written in Rust. [DISCONTINUED]
⬡ Zone of Control is a hexagonal turn-based strategy game written in Rust. [DISCONTINUED]

Zone of Control The project is discontinued Sorry, friends. ZoC is discontinued. See https://ozkriff.github.io/2017-08-17--devlog.html Downloads Preco

The classic tetris game written in Rust using ncurses
The classic tetris game written in Rust using ncurses

tetris.rs This is the classic tetris game I wrote to have a bit of fun with Rust. Installation and playing cargo install --

The video game for Fonts of Power. A tabletop roleplaying game made in Rust with Bevy!

The code and rules for Fonts of Power, a tactical TTRPG / video game about exploring magical places. You can follow its development in our Discord ser

A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Data-oriented and data-driven game engine written in Rust
Data-oriented and data-driven game engine written in Rust

What is Amethyst? Amethyst is a data-driven and data-oriented game engine aiming to be fast and as configurable as possible. Principles These principl

Rust library to create a Good Game Easily

ggez What is this? ggez is a Rust library to create a Good Game Easily. The current version is 0.6.0-rc0. This is a RELEASE CANDIDATE version, which m

Minesweeper game developed with Rust, WebAssembly (Wasm), and Canvas
Minesweeper game developed with Rust, WebAssembly (Wasm), and Canvas

👉 click here to play the game 👈 Minesweeper game Revealing all the cells without hitting the mines is the task. Each number in the cell denotes how

A Gameboy emulator written in Rust
A Gameboy emulator written in Rust

An open source Gameboy emulator written in Rust that can use a command line interface as a screen and input device.

Comments
  • thread 'main' panicked at 'attempted to leave type `std::mem::ManuallyDrop<xlib::Xlib>` uninitialized, which is invalid'

    thread 'main' panicked at 'attempted to leave type `std::mem::ManuallyDrop` uninitialized, which is invalid'

    I'm new to Rust development and thought that modifying snake would be a nice starting project.

    Just cloned repo, downloaded dependencies, built it and tried to run. There wasn't any error on cargo run and cargo build --release, only a few formatting warnings. When trying to run produced binary, I'm getting the error below. Any chance you could help figure out the issue?

    By the trace it seems the problem is with Xlib. Does it need to be in specific version? Is it even Ok for linux?

    System: Ubuntu 20.04 (Linux meland 5.11.0-43-generic #47~20.04.2-Ubuntu SMP Mon Dec 13 11:06:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux) Cargo: cargo 1.54.0 (5ae8d74b3 2021-06-22)

    Backtrace:

    kretyn@meland:~/projects/rsnake$ RUST_BACKTRACE=1 ./target/release/rsnake 
    thread 'main' panicked at 'attempted to leave type `std::mem::ManuallyDrop<xlib::Xlib>` uninitialized, which is invalid', /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/mem/mod.rs:660:9
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
       1: core::panicking::panic_fmt
                 at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:92:14
       2: core::panicking::panic
                 at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:50:5
       3: x11_dl::xlib::Xlib::open
       4: winit::platform::platform::x11::xdisplay::XConnection::new
       5: std::sync::once::Once::call_once::{{closure}}
       6: std::sync::once::Once::call_inner
                 at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sync/once.rs:418:21
       7: winit::platform::platform::EventsLoop::new_x11
       8: winit::platform::platform::EventsLoop::new
       9: winit::EventsLoop::new
      10: glutin_window::GlutinWindow::new
      11: <glutin_window::GlutinWindow as window::BuildFromWindowSettings>::build_from_window_settings
      12: <piston_window::PistonWindow<W> as window::BuildFromWindowSettings>::build_from_window_settings
      13: rsnake::main
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    kretyn@meland:~/projects/rsnake$ 
    
    opened by laszukdawid 1
Owner
Maximilian Schulke
Maximilian Schulke
Snake Game in rust for the web

About This template shows how to create a web app using Yew and wasm-pack. ?? Usage ??️ Build When building for the first time, ensure to install depe

PsiAphex 1 Oct 24, 2021
A finnish version of the word guessing game Wordle implemented in Rust.

Sanuli A finnish version of the word guessing game Wordle implemented in Rust. Live version running at sanuli.fi. Quick start Follow Rust installation

Jaakko Husso 59 Nov 29, 2022
🚢 Battleship game implemented in Rust

?? Battleship game implemented in Rust. Fully playable between 2 players on the terminal. To play on the public instance: $ nc battleship.o

Orhun Parmaksız 55 Jan 2, 2023
Angolmois BMS player, Rust edition

Angolmois Rust Edition This is a direct, one-to-one translation of Angolmois to Rust programming language. Angolmois is a BM98-like minimalistic music

Kang Seonghoon 95 Oct 20, 2022
4fun open-source Cave Story reimplementation written in Rust

doukutsu-rs Download latest Nightly builds (Requires being logged in to GitHub) A re-implementation of Cave Story (Doukutsu Monogatari) engine written

null 564 Jan 1, 2023
A roguelike game in Rust

A fantasy deathcrawl in Rust Work in progress. To run, with Rust compiler and Cargo package manager installed: cargo run --release When building on W

Risto Saarelma 347 Nov 21, 2022
A Doom Renderer written in Rust.

Rust Doom A little Doom 1 & 2 Renderer written in Rust. Mostly written while I was learning the language about 2 years ago, so it might not the best e

Cristi Cobzarenco 2.2k Jan 1, 2023
ASCII terminal hexagonal map roguelike written in Rust

rhex Contributors welcome! Rhex is looking for contributors. See Contributing page for details. Introduction Simple ASCII terminal hexagonal map rogue

Dawid Ciężarkiewicz 137 Dec 2, 2022
An implementation of Sokoban in Rust

sokoban-rs This is an implementation of Sokoban in the Rust Programming Language. An example level: Build Instructions Before building sokoban-rs, you

Sébastien Watteau 137 Dec 23, 2022
A personal etude into rust software (RPG<-it's more fun to debug) development: Tales of the Great White Moose

TGWM (Tales of the Great White Moose) NB: Currently compiles. Should compile and run on both 1.28.0 and 1.31.1 if the Cargo.lock files are deleted. A

null 15 Nov 17, 2021