Tetris OOP in Harbour – Code + Roadmap

120 views
Skip to first unread message

Marcos Jarrin

unread,
Sep 6, 2026, 7:27:42 PMSep 6
to Harbour Minigui
I'm sharing a complete Tetris game built with Object-Oriented Programming for Harbour and MiniGUI Extended.

🔗 Repository:
https://github.com/marcosjarrin/harbour-tech-manual-and-examples/tree/main/examples/games

Main features:
- Full game engine (7 pieces, collisions, scoring, Game Over)
- OOP architecture (easy to maintain and extend)
- Double buffer (smooth animation)
- Internationalization (ES, EN, PT)
- Real-time background color change

How to contribute:
Check the `roadmap.md` file for a detailed analysis and a prioritized list of improvements: levels, next piece preview, sounds, high scores, and more.

Download it, try it out, and help make it better. All contributions are welcome!

Best regards,  
Marcos Jarrín

Grigory Filatov

unread,
Sep 7, 2026, 7:31:35 AMSep 7
to Harbour Minigui
Hello Marcos,

Thank you so much for your contribution!

I really appreciate your efforts.

Sorry, but the first time I tried to compile I got the following number of warnings:

Harbour 3.2.0 (r2607071000)
Copyright (c) 1999-2026, https://harbour.github.io/

tetris_piece.prg(68) Warning W0001  Ambiguous reference 'TTETROMINO'

No code generated.

tetris_board.prg(229) Warning W0001  Method <ShiftLinesDown( nRow )> not declared or declaration mismatch in class <TBoard>

No code generated.

tetris.prg(43) Warning W0006  Procedure returns value

i18n.prg(266) Warning W0005  RETURN statement with no return value in function

tetris.prg(222) Warning W0006  Procedure returns value

tetris.prg(255) Warning W0006  Procedure returns value

tetris.prg(285) Warning W0006  Procedure returns value

tetris.prg(304) Warning W0006  Procedure returns value

tetris.prg(323) Warning W0006  Procedure returns value

tetris.prg(342) Warning W0006  Procedure returns value

tetris.prg(361) Warning W0006  Procedure returns value

No code generated.
hbmk2[demo]: Error: Running Harbour compiler job #1. 1

No code generated.

tetris_game.prg(267) Warning W0003  Variable 'HDC' declared but not used in function 'TTETRISGAME_CHANGEBACKCOLOR(238)'

tetris_game.prg(267) Warning W0003  Variable 'BTSTRUCT' declared but not used in function 'TTETRISGAME_CHANGEBACKCOLOR(238)'

tetris_game.prg(509) Warning W0005  RETURN statement with no return value in function

No code generated.

Hope this helps improve the code.

Best regards,
Grigory

понедельник, 7 сентября 2026 г. в 01:27:42 UTC+2, marcos...@gmail.com:

Marcos Jarrin

unread,
Sep 7, 2026, 12:18:24 PMSep 7
to Harbour Minigui
Hello Grigory

Thank you for the bug report. The mistake I made was that when compiling, I set it to not take warnings into account.


"tetris_board.prg(229) Warning W0001  Method <ShiftLinesDown( nRow )> not declared or declaration mismatch in class <TBoard>"
Method <ShiftLinesDown( nRow )> was not declared in the class, now fixed


"tetris.prg(43) Warning W0006  Procedure returns value"
"Procedure" does not return a value and I had "RETURN NIL"


tetris_game.prg(267) Warning W0003  Variable 'HDC' declared but not used in function 'TTETRISGAME_CHANGEBACKCOLOR(238)'
tetris_game.prg(267) Warning W0003  Variable 'BTSTRUCT' declared but not used in function 'TTETRISGAME_CHANGEBACKCOLOR(238)'
I removed the unused variables, they were left over from a previous version


tetris_game.prg(509) Warning W0005  RETURN statement with no return value in function
It now returns a value

I compiled it with the "Strong" option
Everything compiles correctly

I have already uploaded the fixes to GitHub

Sincerely

Marcos Jarrin

Marcos Jarrin

unread,
Sep 7, 2026, 1:12:50 PMSep 7
to Harbour Minigui
Hello everyone

The tictoc example also had warnings, they have already been fixed and updated.

fix: resolve compilation warnings in tictoc.prg

- Removed unused variable 'NCOMBO' in function CHECKWINNER (W0003)
- Removed unused variable 'NJ' in function CHECKWINNER (W0003)
- Now compiles without warnings

Sincerely

Marcos Jarrin

Rolando Avecilla

unread,
Oct 8, 2026, 8:11:35 PMOct 8
to Harbour Minigui
I could not find the HBP file,, so I created one. It compiled, and I was able to play it. I discovered a bug: suddenly, during play, the score would turn to 0.

I will try to fix it when I have he time.

Thanks for the game of Tettris.

Reply all
Reply to author
Forward
0 new messages