perky / zig-tetris

A simple tetris clone written in zig programming language.

Home Page:https://www.youtube.com/watch?v=AiintPutWrE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tetris

A simple tetris clone written in zig programming language.

Multi-Threaded Fork.

This fork seperates rendering and logic into two seperate threads. The tetris logic is done in simulationLoop and the rendering in renderLoop.

This fork also adds automatic input recording. It records all keyboard input and then when you quit the application, saves it to a file. You can then replay those inputs by launching the application with the recording file as an argument.

Controls

  • Left/Right/Down Arrow - Move piece left/right/down.
  • Up Arrow - Rotate piece clockwise.
  • Shift - Rotate piece counter clockwise.
  • Space - Drop piece immediately.
  • Left Ctrl - Hold piece.
  • R - Start new game.
  • P - Pause and unpause game.
  • Escape - Quit.

NEW

  • L - Playback current recording.
  • K - Pause playback and continue playing from current state.
  • J - Restart and begin a new recording.

Dependencies

Building and Running

zig build run

To playback a recording pass the file as an argument.

tetris.exe example_recording.tetris

About

A simple tetris clone written in zig programming language.

https://www.youtube.com/watch?v=AiintPutWrE

License:MIT License


Languages

Language:C 85.1%Language:Zig 11.0%Language:Objective-C 3.7%Language:CMake 0.2%