Code Monkey home page Code Monkey logo

riverraidrust's Introduction

River Raid Rust

Screenshot

What is it

A rewrite of the classic game river raid, in Rust. Also I am screen casting all of it.

For fun and education.

How to play

  • The player P tries to stay inside the river while avoiding enemies E.

  • Use w,a,s,d or (,,,) to move.

  • Use Space to shoot them.

  • Collect fuel F by passing through it or shoot it to get extra scores.

  • You can pause the game by pressing p and exit by pressing q

Good Luck 👍

Installation

$ git clone https://github.com/jadijadi/riverraidrust.git
$ cd riverraidrust
$ cargo run

Contributing

Because the development process is supposed to be streamed, you should raise an Issue before implementing any new feature. If I find a feature to be sufficiently important, I may prefer to implement it myself during a recording, allowing the audience to observe the process and learn from it. Thank you for understanding.

riverraidrust's People

Contributors

10xcomrade avatar 6arare avatar arvmor avatar immmdreza avatar jadijadi avatar mehdivakili avatar panoschagias avatar sajadadineh avatar shayan15sa avatar siavoosh avatar stupidprogrammer4 avatar tt-abdulhaq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

riverraidrust's Issues

add description to the end screen

We have to inform the player why she is dead. A description should be passed to the end screen describing the cause of death; say "fuel finished", "hit enemy", "Players choice" or whatever. make it cute and fun.

(suggestion) show highscore

Show the best score and player's score in the game over screen. Make it clear if player scored a new highscore. Highscore should be kept consistent for future sessions.

(suggestion) accelerate ship when holding a move key

Accelerate the avatar's speed when the player holds down a move key, instead of a constant speed (remember to reset the speed when stopping). This would greatly improve the game feel and control if polished enough.

(suggestion) add restart button

Pressing 'R' key could be used to restart the game (reset score, reset fuel, refresh map, refresh player and enemies position, delete any bullet etc.)

(suggestion) add moving enemies

It would be a nice challenge to shoot (and of course implement) moving enemies. There could be various types of enemies with different movement patterns (vertical, horizontal, or anything in between)

question: Pause Menu

I was wondering if it is possible to create a pause menu with crossterm.
The idea came from those dialog boxes we see in curses apps, who seem like popup illusions, but I don't know if crossterm has this functionality.
Any ideas?

River goes too much left after a while ( does not go right )

River goes too much left after a while and never goes to the right again
which may be an annoying experience
i think i've found the origin
check this code snippet :

    // draw the map
    for l in 0..world.map.len() {
        sc.queue(MoveTo(0, l as u16))?
            .queue(Print("+".repeat(world.map[l].0 as usize)))?
            .queue(MoveTo(world.map[l].1, l as u16))?
            .queue(Print("+".repeat((world.maxc - world.map[l].1) as usize)))?;
    }

i think the line :
.queue(Print("+".repeat((world.maxc - world.map[l].1) as usize)))?;
causes this behavior.

Panic because of cannot sample empty range

panicked as soon as game started with

Pthread 'main' panicked at /Users/jadi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand-0.8.5/src/rng.rs:134:9:+++++++++++++++++++          +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++cannot sample empty range    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Bomb entity (suggestion)

Bomb entity can be added to game in order to blow a radius and player can't pass too close to it. if so player dies. Bombs can be introduced by an integer like "5" and subtract every frame and eventually go off when reached "0" and in the meanwhile if player was too close (1 cell away for example) he/she dies.

(just trying to find a better use of function "hit_with_margin" added in PR #10 & #21 )

some times game panics

@thread 'main' panicked at src\main.rs:137:41:
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `C:\Users\intel\Desktop\riverraidrust-main\target\debug\riverriderust.exe` (exit code: 101)

fine tune the fuel

if you played the game, and have ideas about the fuel start and fuel addition values, please comment.

(Suggestion) Movement acceleration

Currently, moving the player quickly is challenging.

To achieve this, you must either rapidly press the arrow keys to move the player in a particular direction, or if you hold the arrow keys down, the player starts moving with occasional lags, advancing pixel by pixel, which renders the game unplayable.

My suggestion is to introduce acceleration to the player's movement. When holding down an arrow key, the player's speed should increase gradually, depending on the duration of the key press. Releasing the key should reset the acceleration to zero.

This adjustment would allow players to evade enemies and navigate around obstacles more smoothly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.