Recent

Author Topic: 2048 game  (Read 5035 times)

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
2048 game
« on: October 05, 2019, 03:42:04 pm »
https://app.zdechov.net/2048
Open source Lazarus/FPC implementation of classic block sliding puzzle game called 2048. https://en.wikipedia.org/wiki/2048_(video_game)
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.
« Last Edit: November 08, 2019, 09:23:12 pm by Chronos »

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: 2048 game
« Reply #1 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..
« Last Edit: October 05, 2019, 03:55:31 pm by lainz »

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: 2048 game
« Reply #2 on: October 05, 2019, 04:20:43 pm »
Try with arrow keys, you'll understand it yourself soon. :D
Read: https://en.wikipedia.org/wiki/2048_(video_game)#Gameplay
Rather addictive.
« Last Edit: October 05, 2019, 04:24:16 pm by Zoran »

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: 2048 game
« Reply #3 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:

https://github.com/mehmetulukaya/mu2048

« Last Edit: October 05, 2019, 06:55:34 pm by tr_escape »

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: 2048 game
« Reply #4 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.


lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: 2048 game
« Reply #5 on: October 06, 2019, 03:41:39 pm »
Very addictive game, I reached 256  :)

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: 2048 game
« Reply #6 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 :) https://www.youtube.com/watch?v=1g1HCYTX3Rg&t=589s
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.


jamie

  • Hero Member
  • *****
  • Posts: 6091
Re: 2048 game
« Reply #7 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!
The only true wisdom is knowing you know nothing

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: 2048 game
« Reply #8 on: November 08, 2019, 09:24:06 pm »
New improved version released. Changes since 1.0.0 version:

Quote
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.

 

TinyPortal © 2005-2018