Conway's Game of Life in Rust using Piston.
Features in-game cell painting and custom grids from files.
Mouse click
to paint cells.
Press C
to clear the grid.
Press F
to display FPS counter.
Press L
to toggle grid lines.
Press P
or to pause.
Press R
to randomise the grid.
The game can be modified by passing command line flags.
--width
to set window width in pixels. Default is 1280.
--height
to set window height in pixels. Default is 720.
For example:
./game_of_life --width 640 --height 480
---fullscreen
sets the window to full screen mode.
For example:
./game_of_life --fullscreen
--vsync
enables vsync.
For example:
./game_of_life --vsync
--map
followed by an image filename, generate grid from image. White pixels (i.e rgba[255, 255, 255, 255]) are dead cells, any other colours will be treated as living cells. Image file must match window height and width.
For example:
./game_of_life --map example_map.png
--ms
followed by a number, controls the number of milliseconds between each grid update.
For example:
./game_of_life --ms 30
--scale
followed by a number, controls the size of the cells in pixels. Scale must be divisible by window height and width.
For example:
./game_of_life --scale 8
- Window size command line flags (inc. start-fullscreen flag)
- Resize grid on window resize
- Custom colours
- Toggleable FPS counter on screen
- Toggleable on-screen game stats
- Obstacle blocks (maybe?)
- Refactor main.rs into main.rs and app.rs
Perfect DOS VGA 375 font by Zeh Fernando
Copyright P. Hughes 2019.
This project is licensed under the GNU General Public License v3.0. See LICENSE
for further details.