Closed rubyFeedback closed 2 years ago
Cool!
I got an initial version of Tetris working (without the scoreboard or menus): https://github.com/AndyObtiva/glimmer-dsl-libui/blob/28396dedb0d3ec4213ac94d20f922c36f13c11a6/examples/tetris.rb
I added the games you mentioned to TODO.md (Tetris, Tic Tac Toe, and Snake)
I will close this issue once I have made releases with these games.
An improved version of Tetris has been released with a bevel-block 3D look:
A version just got released with a score board on top, including a next tetromino preview:
The Tetris example is done in the latest release. It now has option menus and a high score dialog.
Wow!
Tic Tac Toe has been implemented and released.
Snake has been implemented test-first following the MVP (Model / View / Presenter) architectural pattern and released in v0.2.22.
Snake Screenshot:
Snake Game Over Screenshot:
With that, the issue request is fully addressed.
Happy Glimmering!
Heya Andy,
I saw that you have tetris for glimmer-dsl-swt here:
https://github.com/AndyObtiva/glimmer-dsl-swt/blob/v4.18.3.1/samples/elaborate/tetris.rb
I was wondering whether this could be added to libui too.
I think in the simplest way, we could simulate a tetris by having buttons placed in a grid; and then these buttons may have differential text (even if we may not be able to use colours; but perhaps we can use unattributed string for colours there). So the "tetris blocks" would then just be simulated via buttons. Of course I suppose we could use the drawing area too; you did the circle example, but I was mostly wondering for a minimal example. (Minimal so as to minimize time investment to it.)
Actually, I came from the point of view of "would it not be nice if there would be games in libui", and here I was thinking of simple games, such as tic tac toe, or snake (where the snake eats an apple and gets bigger on a 2D map).
At any rate, please feel free to ignore/disregard; it's more an idea of "when you have some time and are bored" then perhaps that could be added to glimmer-dsl-libui. Thank you for reading this suggestion either way!