Coder Social home page Coder Social logo

world-simulation-java's Introduction

Life simulation

The subject of objected oriented programming(OOP)

The goal of the project is to write an object-oriented life simulation application in Java. For visualization of the simulation the graphical library Swing is used.

The application implements 2 main classes of organisms:

  • Animals
  • Plants

These classes are expanded into subspecies, which have their own behavioral and characteristic features. The player can control the movement of the person. Also, the person has a special ability when activated which he can pass 2 squares for 1 move. When activated, it works for 5 rounds. And the next 5 rounds can't be activated. It is also possible to add an organism to a specific position. To do this, click on the place where you want to add an organism, and in the menu that appears, select the creature you want to add.

There are 2 methods available to control the simulation:

  • With buttons in the graphical interface
  • With keys on the keyboard

The application also allows you to save and load the current state of the simulation. On startup, the simulation world is filled with creatures in random order

Key Bindings

Hotkeys can be viewed in the application by pressing the button Show hint or in the table above

Key Action
Space Go to the next round
U Use special ability
S Save current state to file
L Load current state from file
Arrows Move around the field

Installation

To run the application locally you need to clone the repository.

$ git clone https://github.com/greedann/World-simulation-java.git
$ cd World-simulation-java

The build application uses maven to build the application. Therefore, you need to build the application using maven to run it. To build use jdk 19 or higher.

world-simulation-java's People

Contributors

greedann avatar dependabot[bot] 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.