Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Showcase / 1010! - a Gosu Based Board Game
- - By shanko Date 2016-08-13 04:15
1010! is a single player, tile-based, board game played on a square grid of 10x10 cells. The player is presented with a random selection of tile patterns of various shapes, 3 at a time, which are to be placed on the board, one by one. If the tiles consume an entire row (or column), without any empty cells in between, the row (or column) is cleared up so that more tiles can be placed. Each cell consumed by the tile counts towards the score of the game. The aim is to place as many tiles as possible to increase the score. In its most simplest form, each cell adds 1 point to the score. A variation of the game can be to assign colors to the tile patterns and different points for each color.

The game logic is written in Ruby and has only one dependency:  gem gosu

Parent - - By jlnr (dev) Date 2016-08-13 17:53
Ah, turn-based 2D tetris, in a way! I think it's a clever concept, and it could work really well with some more polish.

The game would be much easier to play if one could see the currently selected tile as an overlay next to the mouse cursor.

The save-game code is really interesting, and you have some checks for mruby in there - have you built an mruby version a well?
Parent - - By shanko Date 2016-08-23 03:41
First off, @jlnr, apologies for responding so late ... I did not check the forum after posting, thinking that I would be notified by email if anybody commented. 

Thanks for looking at the code. Please check it out again as I did try adding some more polish. Implemented drag-n-drop of the tiles, although it could be made even better by using a more appropriate data structure to store the tile patterns. I did not put much thought to the choice of data structure when I started writing the game, as I was only focused on making it text based ... so yes, board.rb has a complete text based version in it. Bolting the Gosu based GUI on top of it came as an after thought... and some refactoring.

And yes, I intend to port the text based game on mruby - the default version which compiles out of the box, without the need of any additional gems. Then I will tackle porting the Gosu based version. Do you have any insight into that process?

Finally, what do you mean by "save-game code is interesting"? Interesting in what way? The mruby version is half baked and needs some serious thought if I want to stick to the "default mruby" concept. The ruby based version is simply marshaling the game object. Any suggestions on making it easier?

Again, thanks for your time and attention ... really appreciate your contribution to this forum.
Parent - By jlnr (dev) Date 2016-09-11 09:01
The drag and drop is nice but tiles do still appear at an unpredictable offset. And after dragging the pink L for a few times, I ended up with a pink square in the preview area - see screenshot.

I thought it was interesting that you use Marshal for saving, but only in MRI, not mruby. Later I found out that Marshal doesn't come with mruby by default. I guess that explains it :) If you want to keep mruby compatibility but don't want to use any mruby gems (Marshal, JSON, YAML etc.), then I think I'd just go with string parsing in both versions of Ruby. That would make it more consistent at least.

Re: mruby and Gosu, that doesn't work yet, sorry. I've given it a try when mruby was really new (and crashy) and then simply forgot about it. It's good to see that mruby has a better concept for gems now, but I'm not sure if wrapping a heavy C++ library like Gosu will be easy. It's definitely on my list of potential weekend projects, but that list hasn't gotten any shorter in the last years ;(
Up Topic Gosu / Gosu Showcase / 1010! - a Gosu Based Board Game

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill