Re: Clone of 2048



Hi all,

I (finally) finished the first version of a Gnome's 2048 clone. It is
available in [0]. I have not tagged it nor I have made an official
release, as I plan to add some more features before doing so, e.g.
detect when there are not any possible moves. However, as it is now it
is testable. Needless to say, any comments and patches are very much
appreciated.

I ended up using Clutter and drawing the tiles. I also added animations,
although I'm thinking of adding a setting to disable them in order to
speed up game.

Right now, the algorithm that places a new tile in the grid simply tries
different random positions. This may be improved in order to maximize
players' satisfaction.

Future work:
- Add 'game over' detection.
- Try to polish the game algorithm (grid.vala). I'm quite sure I have
duplicated code unnecessarily.
- Write help.
- Make a release.

Future future work:
- Add support for gestures.
- Migrate to git.gnome.org (?).
- Add support for color themes (?).
- Better algorithm to decide where to place a new tile.

Thank you very much for your answers.

Best regards,
Juan.

[0] https://github.com/juanrgar/gnome-2048

On Tue, 2014-12-02 at 00:10 +0100, Arnaud Bonatti wrote:
Hi Juan.

I had in mind to write a 2048 for GNOME during summer, but finally did
Taquin[1] instead. ^^ It would be great if you can work on a
gnome-2048, it’s a fun game and is totally in the scope of GNOME games
I think.

I don’t know much about Clutter, so I can’t help you with this
library. If it’s so easy to write with it, go with that. If you don’t
think it’s so easy, I’d prefer you just use Cairo in a GtkDrawingArea,
as I’m not sure what’s the long-term plan concerning Clutter. But
please, use just Gtk (with CSS) for the games controls and things like
that.

With Cairo only, it seems complicated to draw the chars with Pango
without having them floating[2]. That’s the reason why I use an image
file in Taquin for now, even if I plan to change that (and I use
bitmaps, that’s bad, I should use svgs, but had bugs with them).
Drawing chars is ideally the way to go, so you may try that, whatever
library you’re using.

Concentrate first on the game itself, I’ll have some concerns about
integrating it into a bigger Minigames application. We should talk
about that on IRC one day.

If you want to work on gestures, by the way, I didn’t implement them
on Taquin for now. As it hasn’t a bugzilla entry[3], there’s no bug
opened for that now, but I could explain you what I’ve in mind on IRC
if you’re interested working on it.

Good code and have fun!

[1] https://git.gnome.org/browse/gnome-taquin/
[2] https://bugzilla.gnome.org/show_bug.cgi?id=734800
[3] https://bugzilla.gnome.org/show_bug.cgi?id=739810





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]