Giter Club home page Giter Club logo

particlesim's Introduction

Cellular automata / Falling sand

Screenshot

ParticleSim.SandLab.main is the entry point. This program is designed differently than the original architecture given in the document (I have been given permission to deviate).

Design

  • ParticleSim.Cell.getSurroundingCell This method looks for surrounding cells that either are any type on Cell's inheritance tree, accomplished with generics. This is used in ParticleSim.Cells.Fire to look for surrounding ParticleSim.FlammableCell
  • Each cell has a bitflag as does the program itself, this flag will be flipped when a cell is updated and the program's bitflag will be flipped once all updates are completed. This ensures a cell will not be updated twice after moving.
  • The buttons no longer register with index numbers, instead you register classes directly and they get added as buttons with their class name, this is made possible with generics.
  • Each pixel derives from Cell class and has its own update function that is called with each display update. Each pixel has a state such as Wood/FlammableCell having durability and a damage method.

Important notes

I was told not to modify ParticleSim.SandLab.run but the time loop was broken and the slider was useless. I implemented my own TPS system for world updates per second. I changed step to update for personal preference. Due to architecture design I had to add more fields to ParticleSim.SandLab, this includes new buttons and bounds checking methods or circular brush sizes. The slider on the bottom that should be used for speed but didn't work is now a brush size slider. ParticleSim.SandDisplay was also modified to accomodate these changes.

Running

I would have preffered to not need any build systems to make this function as it should but unfortunately with Java there is no such luck. This is bundled as a barebones maven project, as long as JDK and maven are downloaded/installed you should be able to run run.bat or run.sh in the root directory on your respective platform. A jar redistributable is attached in github releases if you do not want to manually compile it yourself.

particlesim's People

Contributors

jsh32 avatar

Stargazers

 avatar

Watchers

 avatar

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.