The idea to write this puzzle game appeared around November 2016. I must say that I have never achieved much success in assembling a real cube. My personal best has never been less than a minute. But the device itself in the early 80s made a strong impression on me.
The idea was not to repeat numerous imitations of a real cube in 3D, but to make it unfold into a plane so that all six faces could be seen at once:
Xcode was chosen as the development environment, and Swift as the language. By that time, I already had experience with this environment and language, so the coding itself should not cause any particular difficulties. Although, some aspects of the algorithmic nature required hiking and thinking about them. Here is just one example: at each step (move) of the user, you need to check the composure of the cube. If you solve the problem in the forehead, then you can simply run through the elements of the arrays and compare them to the same.
The initial array (the cube is assembled, as at the very beginning of the game) is presented in the form:
')
var Tnew = [ [[1, 1, 1], [1, 1, 1], [1, 1, 1]], // [[2, 2, 2], [2, 2, 2], [2, 2, 2]], // [[3, 3, 3], [3, 3, 3], [3, 3, 3]], // [[4, 4, 4], [4, 4, 4], [4, 4, 4]], // [[5, 5, 5], [5, 5, 5], [5, 5, 5]], // [[6, 6, 6], [6, 6, 6], [6, 6, 6]] // ]
After the assembly, you can get the permutations of the rows in any order, for example, like this:
var Tnew = [ [[5, 5, 5], [5, 5, 5], [5, 5, 5]], // [[3, 3, 3], [3, 3, 3], [3, 3, 3]], // [[1, 1, 1], [1, 1, 1], [1, 1, 1]], // [[4, 4, 4], [4, 4, 4], [4, 4, 4]], // [[2, 2, 2], [2, 2, 2], [2, 2, 2]], // [[6, 6, 6], [6, 6, 6], [6, 6, 6]] // ]
But at this location, we must assume that the cube is also successfully assembled.
For better immersion in the task, a simple and cheap version of the cube was bought on the market. And creativity began ... with the study of the real cube. Faces assigned numbers, rows and columns on the edges - coordinates.
At the same time, the movement of the row or column should set in motion the “related” rows or columns. Just like in an adult cube - you move one thing - the "neighbors" are also involved in the movement.
But when using% device% we, if we think about it, it is very fleeting and not very deep. For us, this is part of the picture of the world, which is not particularly surprising. Another thing - a software model! Here it is necessary to create an artificial reality, and therefore it is necessary to fully understand the "real reality".
Dozens of sheets were drawn and painted. Sometimes notes or ideas had to be written down simply on what was on hand, so that later not to lose them for good. And somewhere to the beginning of April, a working prototype of the program turned out. The cube could be collected. But the rule 20 to 80 (or its version 30 to 70) worked to the fullest. It was necessary to finish a lot of service trifles: a build timer, a move counter, some kind of alarm about the end of the build, connect the Game Center. And think about possible monetization. That would be a very nice bonus.
As a result, somewhere by mid-May, the program was ready so that it could be started to be tested not only on the developer’s device. A developer’s account was paid for and a few selected from different cities and villages of the planet got the opportunity to “spin” a flat cube on their devices (the program was distributed via Test Flight).
As for the localization, I immediately decided not to make any inscriptions on the screen and thus escape from this problem. While this is a success.
The screen is very minimalistic. The user sees the classic cube scan on a plane in the form of a cross, four buttons: collect a cube, tangle the cube, change the background and show the Game Center. Well, at the top there are two counters: moves and time. Time starts only after pressing the button "Confuse". If the user has confused the cube himself and then assembled - only moves are considered.
Impressions of the program at the "audience"
Naturally, I was always interested in the opinions of those who tested the program. Someone said that the cube should be made in 3D, to which I replied that such options for the cube in AppStore already exist and I have no interest in making their next clone. Apparently the very magic word "3D" already somehow attracted people and they considered it a good idea. Someone immediately understood the idea of ​​a sweep. However, observations of testers have shown that the transition "3D -> 2D" for most normal people causes not illusory difficulties. Even those who are fairly easy to collect a real cube, could not immediately collect even one facet correctly. Not to mention further assembly. However, everyone can try it for themselves.
It's fun to watch Game Center. More precisely for the emergence of new users in it. This thing is just unreal cool! I made two tables in GC: build time and number of moves. Anyone who collects the whole cube enters them. And if with further assemblies, some result will be improved, then it will remain in the corresponding table. For quite a long time in the tables there were only my results, recorded from devices of different testers under their names. And I slowly began to give up on humanity. And not so long ago a character completely unknown to me got into the tables. At first he was in both tables in the bottom lines. Then he began to move confidently upwards. After about a couple of days, he took the top lines of both tables with rather amazing results: 1 minute 40 seconds and 80 steps. However, his record is still not broken by anyone in the framework of Flat Cubik.
And more recently, a second (!) Gathering one appeared, which gathered Flat Cubik in 25 minutes 01 second and 254 turns. And while ranked sixth in the ranking. At the same time, he does not show perseverance in improving his achievements. At least the best results from him does not appear.
What is now and future plans
The first version of the program hit the App Store in the last days of June.
The first mistake was to put a price of $ 1 on the program. The first day brought 6 paid downloads, then the number of downloads dropped to 2.
Can this be considered a failure? Very similar to that ... Later the game was free and currently has about 200 downloads.
There was no advertising anywhere. With the exception of a short message in the iXBT conference (inside one of the MacLife themes).
In the future we plan to add a banner AdMob. There was an idea to make undo for user moves. As well as certain variants of hints moves. So far, with tips, everything is at the same stage of walking and thinking. Those who know how to build a cube, understand that from the current state you can come to the assembled in completely different ways.
Yes, at least here is a small example: rearrangement of 3 angular elements: I know the option in 22 moves and the option in 8 moves. I myself use 8-hodovka.
Or the assembly strategy itself: the simplest one is layered. Starting, for example, with a white cross, then the corners, then the second layer, and then the third. But sooner or later, you can try to go on the option: 6 crosses (all faces), and then 8 corners. In general, there are many ways.
In development is now a version for Android. Well, now the program is completely free and available in AppStore for all devices with iOS 10 installed. I will be glad to see new people in GC tables.
PS: iOS 10 was chosen after losing a few days to find a problem in Apple’s internal libraries (I can write a separate note about this later). It was found that the problem is missing in iOS versions starting from 10. In order not to bypass the problem in earlier versions of iOS, it was decided that Flat Cubik would work on devices with iOS10 +.
PS2: Cube assembly demo