Windows Phone 2048 source code on

Source: Internet
Author: User

Small dream today 2048 of the game source code to share, actually feel this weight in the algorithm, the UI is very simple, and almost no use of what Windows Phone API. Small dream Encounter the most important problem is the handling of touch events, I just started to think of is the manipulation series of events, but in the test did not know why I set the Manipulationdelta,manipulationstart, Manipulationcompleted unexpectedly all have no reaction, I thought WP8.1 not support, so all touch events tried all over, to the last found when the Manipulationmode set to "All", finally have a reaction, (of course, This is not necessarily all, set to the touch events you support, such as panning, rotating.  Want to ask: is it necessary to set manipulationmode and then manipulation to react? The result of my test is that it has to be. So I used Manipulationstart and manipulationcompleted and get touch start and end coordinates, but when finished, found the game although normal operation, but the reaction is super slow, obviously delayed about 1 seconds. I began to think that there is a problem with the algorithm, too much time, so I saw a lot of other people open algorithms, found that the complexity of the same. The last thought of the trigger sequence of touch events, manipulationcompleted time comparison, perhaps this reason. So I want to use the Manipulationdelta incident to try to see if the response will be faster, the result is indeed fast, but a touch will trigger multiple times. The workaround is to use its complete () method, which completes the touch without triggering the inertia time.

Another small problem is that when the layout generates 16 small squares, I use a button in the grid to implement it. It is important to note that the button itself has a default property of Margin,padding,borad, as well as a transition animation between the state attribute and the state, and we should remove or modify these properties if we want to implement the grid effect in 2048. And the grid has the default margin attribute, and we have to get rid of it.

As for the complete implementation of the 2048 process, write it another day.

Welcome everybody to spit groove and suggestion, the source code also has many improvement place, the small dream also will revise in.

Source: Windows Phone 2048 (you can just sign up, no other restrictions.) )

Windows Phone 2048 source code on

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.