Java implementation 2048 small game "code"

Source: Internet
Author: User

New Year's Day just past, wish everyone happy New Year!

Feeling 2017 is really going too fast ...

As previously said, the first version of the game was actually written in May last year, in fact, it has realized the main function, and then went through several updates, added the Undo function, joined the exit to record the game progress, re-open the last progress continues, and soon before the game interface style adjusted a bit , and then yesterday joined the mobile sound, feel that actually took a little time, the whole game is now more complete. Yesterday, just after the end of the final exam, today idle nothing is sent to let everyone see. The code is still on my GitHub, because too many, inconvenient to send here.

Let's take a look at the latest fourth edition of the game interface.

This is the start of the game interface, because I last played when there is progress, so there will be a hint

This is the game interface, the top is the score and history of the best scores, the next line is the current time

The game of the block is not a picture, but a button, so it is not possible to manually achieve the animation effect of movement, moving up a kind of flash feeling. Also please do not click on the block, because it is a button, will listen to click, get focus, and then the entire interface will not listen to the keyboard, it will not be able to move. And then the point is that each time the new box is randomly generated, the value is random, and feel more simple to play than the original, you are messy can also persist for a long time, but if you want to win should not be simple, the original should be what algorithm to control the location and value of each block generated, to increase the difficulty, At present I do not have this aspect of thinking, not to think about this. That's all we have to say at the moment.

What is the problem through my e-mail to ask me.

In addition, look at the beginning of a few version of the game main interface, too kill Matt has wood, in fact, just modify the program default style, a few lines of code, but the change is quite large.

Code, see my Github:https://github.com/jiaxintse/2048game.

Java implementation 2048 small game "code"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.