Giter Club home page Giter Club logo

rusty-city's Introduction

Rusty City

A work in progress sand simulation game

Controls

  • Enter: Reset universe
  • Mouse Wheel: Change brush size
  • 0: erase
  • 1: use Sand
  • 2: use Water
  • 3: use Wall
  • Space Pause
  • Right Arrow Next Frame (only when paused)

Debug

Click on top of the fps counter to show the debug window

rusty-city's People

Contributors

lsroa avatar mrmarble avatar semantic-release-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

lsroa

rusty-city's Issues

Using floats was a bad idea

Probably when I convert f32 to i32 enough decimals are being lost causing the cell matrix to lose cells.

Hypothesis based on the inclination of the white strips and the fact that the number of white bands changes depending on the window size

imagen

Broken erase brush

Buffer overflow

You can "erase" particles even in the background and therefore make a buffer overflow in the particles vec

How to reproduce it

  • Erase particles until you reach 0

Peek 2021-06-01 10-57

Check for Empty Cell

These changes introduced in pr #1 fixed two bugs but created a new one.

let current_specie = self.get_cell(px, py).specie();
if mat == current_specie {
continue;
} else {
self.cells[i] = Cell::new(mat, self.generation)
}
if mat == Species::Empty {
self.non_empty_cells -= 1;
} else if !(current_specie != Species::Empty) {
self.non_empty_cells += 1;
}

Now you can "paint" over an existing cell which is not a desired behavior.
We should change this to check for Species::Empty

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.