Coder Social home page Coder Social logo

fortran-gaming / blocktran Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 1.0 1.73 MB

Falling-block object-oriented Fortran game, resizable playfield

Home Page: https://fortran-gaming.github.io/blocktran/

License: Apache License 2.0

CMake 19.15% Fortran 77.16% C 2.88% GDB 0.08% C++ 0.73%
modern-fortran tetris-game object-oriented-fortran game

blocktran's Introduction

BlockTran

DOI Actions Status

Text/console falling-block tetromino game written in object-oriented Fortran 2008.

BlockTran gameplay demo

  • user-configurable playfield size
  • Logs pieces played to blocktran.log so you can recreate memorable games.
  • uniform random game piece generation.
  • clean, object-oriented Fortran 2008 syntax
  • Curses (Ncurses, PDcurses) used for display, called directly from Fortran code.

Build

BlockTran works on Mac, Linux, native Windows, Cygwin, Windows Subsystem for Linux. Requires a Fortran compiler and CMake. Known to work with GCC Gfortran and Intel oneAPI (Classic or LLVM).

cmake -B build
cmake --build build

or using Fortran FPM:

fpm build
fpm run

The main executable file is build/blocktran. You can copy this file to your Desktop or wherever you like.

Linux / macOS

Ncurses is required. Alternatively, PDCurses + X11 development libraries are required for building on Linux.

Install X11 on Linux:

dnf install libX11-devel libXt-devel libXaw-devel ncurses-devel
# or
apt install libmxu-dev libxpm-dev libxt-dev libxaw7-dev libx11-dev

on macOS:

brew install libxt libxaw libx11

Play

difficulty level

adjust cadence of falling blocks with -d option, including decimal point:

blocktran -d 1.2

Higher number increase difficulty. Must include decimal point.

Playfield size

specify width and height of the playfield with -s option:

blocktran -s 20 15

play against computer

The computer player is rudimentary.

blocktran -p 2

debug mode

Debug logging is enabled by:

blocktran --debug

Controls

Other "secret" cheat keys exist! You can also use arrow keys.

Key Effect
W Rotate piece
A/D Left and right respectively
S Move down faster
Q or Esc Exit the game

Notes

Block distribution is uniformly random as confirmed by:

./blockrand

References

blocktran's People

Contributors

lewisjb avatar scivision avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

saeedtaghavi

blocktran's Issues

add topics

I suggest adding the topics game, games so that the repo will appear if someone searches language:fortran topic:game

auto-PDCurses CI debug

In "develop" branch, system NCurses worked on laptop for Windows and Linux for GCC, but fails on CI when using system NCurses.
Perhaps try on local Mac. Add logging to CI to diagnose failure.

Consider putting PDCurses autobuild in CI.

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.