All Projects → cSquaerd → Cursatetra

cSquaerd / Cursatetra

Terminal-bounded block-based puzzle game written in Python/Curses

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Cursatetra

Ao Server
Server for Argentum Online
Stars: ✭ 32 (-11.11%)
Mutual labels:  game
Yh
a tech demo for a bullet hell game. for the full game visit https://gilmi.me/nyx
Stars: ✭ 34 (-5.56%)
Mutual labels:  game
Mud1
Essex MUD1 by Trubshaw and Bartle
Stars: ✭ 35 (-2.78%)
Mutual labels:  game
Marmoset
Marmoset is a single-player implementation of the card game SET.
Stars: ✭ 32 (-11.11%)
Mutual labels:  game
Hs Quake 3
Quake 3 map viewer written in Haskell
Stars: ✭ 33 (-8.33%)
Mutual labels:  game
Hinterland
2D top-down shooter game
Stars: ✭ 34 (-5.56%)
Mutual labels:  game
Hs Flatris
An implementation of Flatris using Haskell and Miso
Stars: ✭ 31 (-13.89%)
Mutual labels:  game
Pioneer
A game of lonely space adventure
Stars: ✭ 979 (+2619.44%)
Mutual labels:  game
Expo Stack
🎮🧱 stack game clone made in expo (ios, android, web), three.js, react native
Stars: ✭ 34 (-5.56%)
Mutual labels:  game
Tgm
Team Game Manager - Minecraft PVP Suite
Stars: ✭ 35 (-2.78%)
Mutual labels:  game
Vainglory
(*DEPRECATED*: The API no longer exists, so this will no longer work) A Javascript API Client wrapper for Vainglory
Stars: ✭ 32 (-11.11%)
Mutual labels:  game
Openetg
Stars: ✭ 32 (-11.11%)
Mutual labels:  game
Dungeonfs
A FUSE filesystem and dungeon crawling adventure game engine
Stars: ✭ 979 (+2619.44%)
Mutual labels:  game
Gameoverlay
🎮 GameOverlay using CEF with support for common rendering backends
Stars: ✭ 32 (-11.11%)
Mutual labels:  game
Games
Your own games website, filled with open source goodness! Automated installation of a plethora of open source web games. Fully customizable.
Stars: ✭ 35 (-2.78%)
Mutual labels:  game
Pacgo
A Pac Man clone written in Go (with emojis!)
Stars: ✭ 961 (+2569.44%)
Mutual labels:  game
Dxopal
Game development framework for Opal, API compatible to DXRuby
Stars: ✭ 34 (-5.56%)
Mutual labels:  game
Rlcard
Reinforcement Learning / AI Bots in Card (Poker) Games - Blackjack, Leduc, Texas, DouDizhu, Mahjong, UNO.
Stars: ✭ 980 (+2622.22%)
Mutual labels:  game
Lol Chime
🔔 A cross-platform(Linux, Windows, OSX) terminal utility that notifies the user with a bard chime when their friends are out of the game.
Stars: ✭ 35 (-2.78%)
Mutual labels:  game
Erewhon Game
Video game about programming your spaceships to destroy other programmed spaceships o/
Stars: ✭ 35 (-2.78%)
Mutual labels:  game

CursaTetra

Banner Image

A terminal-bounded block-based puzzle game written in Python/Curses

This game is dedicated to Alexey Pajitnov, original author of Tetris. This version features:

  • 80x24 character resolution
  • Colored pieces
  • Nintendo-style scoring
  • Three randomizer algorithms:
    • A 7-Bag piece randomizer
    • A random.randint() shuffle (a.k.a. "true") randomizer
    • A T.G.M.-inspired randomizer
  • A "ghost piece" to help guide your aim
  • A holding feature to save crucial pieces for when needed
  • A high score file (JSON format)
  • A settings file with preferred difficulty entries (JSON format)
  • T-Spin detection and score reward
  • The traditional 20-block high playing board

The goal is simple: rotate and move pieces as they fall, line up ten blocks in a row to clear a row, and keep going until the board tops out.

(Banner picture depicts the game running in Cool Retro Term, found here)

How to run

  • From the directory/folder where you have all the .py files, run python cursatetra.py

Gameplay GIF

Experimental Features

  • Compatibility with windows-curses (Just needed extra entries in the cellValues dictionary because the color attributes are encoded differently in windows-curses)

Bugs (Present)

  • None that I can find (emphasis on that last part)

Bugs (Fixed)

  • [Introduced after upgrading to Python 3.8] Invoking the undraw() method on a piece, specifically during an invocation of move() on said piece, would cause the piece's color data to remain behind, causing the blank space to not register as such. This was game breaking. Was fixed by ensuring that a Curses color_pair is passed to the calls of addch() in the drawPiece() method. In particular, color_pair 0 is passed for when cells are to be made blank via invoking undraw()
  • Disabling the ghost piece feature when the piece fully overlaps the ghost piece's position will delete (?) the piece. Fixed by making a default settings value such that the toggle key is disabled (can be re-enabled by editing settings.json

Piece development documentation

Piece orientations

  • H : horizontal (default)
  • V : vertical
  • HP : horizontal, pi radians around (180 deg)
  • VP : vertical, pi radians around (180 deg)

class Piece: for active block data

  • Valid Constructor Values:

    • y: [1, 19]
      • Smallest block height-wise is Square, S, and Z; All take up two cells vertically
    • x: [1, 10]
    • pID: {'C', 'S', 'Z', 'L', 'R', 'I', 'T'}
    • orient: {'', 'H', 'V', 'HP', 'VP'}
      • Null-orientation is only valid for the Square
  • Methods & Valid Values:

    • draw(): Draws the piece on the board
    • undraw(): Erases the piece from the board
    • getGhostDepth(): Determines the y-position of the ghost piece
    • drawGhost(): Draws the ghost piece on the board
    • undrawGhost(): Erases the ghost piece from the board
    • getNewOrient(rotDir): Gets the new orientation for the piece based on rot. dir.
      • rotDir: {'CW', 'CCW'}
        • Clockwise or Counter-Clockwise
        • Only needed for L, R, and T pieces
    • rotate(rotDir): Rotates the piece in the indicated rot. dir.
      • rotDir: See notes in getNewOrient
    • move(direction): Moves the piece in the indicated direction
      • direction: {'L', 'R', 'D'}
        • Left, Right, or Down
    • canRotate(rotDir): Returns True if the piece can rotate in the indicated rot. dir.
      • rotDir: See notes in getNewOrient
    • canMove(direction): Returns True if the piece can move in the indicated direction
      • direction: See notes in move

Piece designations & diagrams

Based on specification in Game Boy version

  • Note: The orientation of the pieces may seem backwards at first glance; Consider it in terms of the orientation of an underline below the text character that identifies a piece

  • C : Square

    • Diagram:
       012345
     0.[][]
     1.[][]
     2.
    
  • S : S-piece

    • Diagrams:
      • Horizontal
         012345
       0.
       1.  [][]
       2.[][]
      
      • Vertical
         012345
       0.[]
       1.[][]
       2.  []
      
    • Observations:
      • Rotates about (2:3, 1) Clockwise (???)
  • Z : Z-piece

    • Diagrams:
      • Horizontal
         012345
       0.
       1.[][]
       2.  [][]
      
      • Vertical
         012345
       0.  []
       1.[][]
       2.[]
      
    • Observations:
      • Rotates about (2:3, 1) Clockwise (???)
  • L : L-piece

    • Diagrams:
      • Horizontal
         012345
       0.  []
       1.  []
       2.  [][]
      
      • Vertical
         012345
       0.
       1.[][][]
       2.[]
      
      • Horizontal-Pi
         012345
       0.[][]
       1.  []
       2.  []
      
      • Vertical-Pi
         012345
       0.    []
       1.[][][]
       2.
      
    • Observations:
      • Rotates about (2:3, 1) Both Ways
  • R : Reversed L-piece

    • Diagrams:
      • Horizontal
         012345
       0.  []
       1.  []
       2.[][]
      
      • Vertical
         012345
       0.[]
       1.[][][]
       2.
      
      • Horizontal-Pi
         012345
       0.  [][]
       1.  []
       2.  []
      
      • Vertical-Pi
         012345
       0.
       1.[][][]
       2.    []
      
    • Observations:
      • Rotates about (2:3, 1) Both Ways
  • I : Line

    • Diagrams:
      • Horizontal
         01234567
       0.  []
       1.  []
       2.  []
       3.  []
      
      • Vertical
         01234567
       0.
       1.
       2.[][][][]
       3.
      
    • Observations:
      • Rotates about (2:3, 2) Clockwise (???)
  • T : T-piece

    • Diagrams:
      • Horizontal
         012345
       0.
       1.[][][]
       2.  []
      
      • Vertical
         012345
       0.  []
       1.[][]
       2.  []
      
      • Horizontal-Pi
         012345
       0.  []
       1.[][][]
       2.
      
      • Vertical-Pi
         012345
       0.  []
       1.  [][]
       2.  []
      
    • Observations:
      • Rotates about (2:3, 1) Both Ways
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].