Announcements => Third party => Topic started by: Chronos on October 05, 2019, 03:42:04 pm

Title: 2048 game
Post by: Chronos on October 05, 2019, 03:42:04 pm
Open source Lazarus/FPC implementation of classic block sliding puzzle game called 2048.
This game is nicely played on smartphones using touchscreen but it can be played with keyboard as well.
The game is pretty addictive. I wanted to know how easy is to implement such game. Or maybe even to extend it.
Title: Re: 2048 game
Post by: lainz on October 05, 2019, 03:51:51 pm
Thanks, never played this game but I will check it.

This should go in Games forum?

Edit: I don't know how to play it, can you give some information? I click the boxes and it does nothing..
Title: Re: 2048 game
Post by: Zoran on October 05, 2019, 04:20:43 pm
Try with arrow keys, you'll understand it yourself soon. :D
Read: (
Rather addictive.
Title: Re: 2048 game
Post by: tr_escape on October 05, 2019, 06:44:20 pm
I was trying something new about this game (not same project) but not finished on the computer play side: (

Title: Re: 2048 game
Post by: Chronos on October 05, 2019, 07:00:35 pm
It may be posted in games section but this is just announcement so this section is ok as well.

I should add some instructions how to play it. What would be useful for new players. It was just quick few days activity. And as usual last 20% of work takes 80% of time :)

A game like this would be good candidate for game contest. Even it wouldn't be original, it would take short time to make and its fun to play :)

Install 2048 game to your smartphone and you will go to sleep pretty late :) It can be well played in a bed.

Title: Re: 2048 game
Post by: lainz on October 06, 2019, 03:41:39 pm
Very addictive game, I reached 256  :)
Title: Re: 2048 game
Post by: Chronos on October 06, 2019, 04:43:44 pm
I will try to implement some strategy for computer player. Probably something deterministic, some rules to follow rather then neural network and some sort of AI. But using neural network AI with genetic algorithms can be also fun as you can see in this video :)
At least important thing is to set good fitness function. Then learning process should be straightforward.

Anyway, this is nice game which can be easily implemented in just few hours and there are many possibilities how to improve that game and make it more complicated. In Android play store there are lot of clones and some of them have more game modes. Games like 2048+, 2048++. 2048X, 2048 plus, super 2048, and so on. Perhaps something like multiplayer can exist. But if tiles placement is random then there is no need to play it at the same time. Even if both players would have same pseudorandom generator with same initial seed, then it would be still random.

Title: Re: 2048 game
Post by: jamie on October 06, 2019, 09:56:13 pm
As I have said many times before....

 There are 10 types of programmers in this world, those that know binary and those that don't!
Title: Re: 2048 game
Post by: Chronos on November 08, 2019, 09:24:06 pm
New improved version released. Changes since 1.0.0 version:

Version 1.2.0 (2019-11-08)

* Added: Animation of tiles merge.
* Added: Animation of appearance of new tiles.
* Added: Support for dark theme.
* Added: Support for selectable skins of tiles. Tile values are now representing normal sequence of numbers. If power of two is selected, values are recalculated for rendering and score.
* Added: Key buffer to capture consecutive key presses even with slow animation.
* Added: Read Me file.
* Modified: Use just 2048 for application name.
* Modified: Draw board rounded corners.
* Modified: Make tiles rectangle with rounded corners.
* Fixed: Unable to move tiles in 2x2 board size.
* Fixed: Board border width.
* Fixed: Tile margin not calculated correctly for different canvas sizes.
* Fixed: Wrong slash symbol in path for storing moves history to registry.

Version 1.1.0 (2019-10-13)

* Added: New form accessible from menu Tools - Moves history with game moves history.
* Added: Computer player accessible from Tools menu in Debug mode. It is not able to win game yet.
* Added: Help windows with instructions how to play.
* Added: With 10% chance create new random tile with value 4 instead of 2.
* Modified: Fixed tiles move animation.
* Fixed: Update previous board state for undo only if board is really moved.