Coder Social home page Coder Social logo

game-of-life's Introduction

Conway's Game of Life

Windows implementation of this game in Python in which you can

  • create and run any game configuration
  • move around the field
  • start/pause the game
  • save the current field as a snapshot
  • create a custom brush pattern and draw with it (also you can save your patterns)
  • change
    • color of brush (different colors are mixed during the game)
    • the scale
    • game speed
  • roll back time
  • do something else

Now about the controls

control action
LMB add/remove a living cell
LMB (holding) draw a line of living ones
RMB (holding) movement across the field
Scrolling the mouse wheel increase/decrease the field
Spacebar start/pause Conway's game
Left/right arrow slow down/speed up the game twice
P or MMB toggle pattern mode on/off
Upper/lower arrow switch between patterns
R rotate the pattern 90 degrees clockwise
E or button on the top right toggle eraser mode on/off
G toggle grid mode on/off
1, 2, 3, 4, 5, 0 drawing colors (0 is false: i.e. does not participate in the game)
K , CTRL+K clear living / false cells
I or button on the top right inventory with your patterns (the last one opened is used)
CTRL+S or button on the top right save the field and patterns
CTRL+Z roll back to the last save
V, B time travel (note: it's not saved)
H change the hiding mode of icons (in the field)
ESC exit the current window (in the field: exit the application)

Notes

This implementation is only for Windows, but it doesn’t seem to take much time to adapt to other platforms.

You can download the EXE file from Releases or run main.py after installing the necessary libraries by this command:

pip install pygame; pip install pypiwin32

I used pyinstaller to create the EXE file by main.spec and following commands:

pip install pyinstaller
pyinstaller -F main.spec

Also just saying that the __parameters__ file is a save file, it is created and then overwritten every time you save.

game-of-life's People

Contributors

petsernik 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.