This week, a lot had to be done because the final deadline is coming close very fast.
First of all, I implemented a shop system from scratch. The shop system allows the player to buy new cosmetic skins for the player to use in game. I implemented that the player gets one coin for each 10th shape it passes (I also marked those with another color) and the player gets a special sound when passing such a hole). The device of course remembers what the player has bought over different sessions. Store prices are easily adaptable, when changing the price, the text will adapt too.
Next thing to do was implementing some feedback we got. When the player opens the game for the first time, the game detects whether the players phone has a gyroscope or not. If it has one, it allows the player to choose between gyroscope controls or slider controls. When the phone does not have a gyroscope, the game notifies the player that slider controls have been enabled (accelerometer was just too inaccurate).
I also switched out all of the UI with a better, aspect ratio independent UI made by the artists. A lot of bugs got fixed too (like the annoying button that seemed pressed when it wasn’t on the main menu, the multiplier animation that stopped working, colors of the materials that unity interpreted wrong, the sound that restarted playing when pressing play again ) and performance increased too when optimizing the code. We also got a fully functional sound system now that can work via canvasses, different canvasses can have different sounds (but don’t have too).
I added some sweet player feedback too,each time a player adds 1 to his/her multiplier that is at least 5, a voice will encourage the player with “Amazing”, “incredible!” etc.
This week I focused on implementing the new UI elements, applying feedback from Flega café, polishing, bug fixes and some performance.
First of all I got rid of the pause button on the upper right corner of the screen, we got the feedback that it would be more convenient of you would just press anywhere on the screen that is not used (in the middle circle when on slider controls and anywhere but on the left side for gyro controls). Next thing to do was adding convenient ways to go back to the main menu from any other UI canvas. I added buttons for this and also added support for Android’s ‘back’ button to go back to the main menu. We were also told that the splash screens were a little to long so I altered that animation.
I rewrote the sound system to be reusable instead of only having a background system. When doing this I also implemented a mute button in the setting UI which can be used to toggle the game’s sound on and off. Also added methods to play one-shot sounds with optional delay, this will be used when scoring or achieving something. I also cleaned up code and optimized on the most obvious places so we get a slightly better frame rate.
To fit the current control UI mock-up the artists had made, I had to alter the way how controls are selected, I made a simple system to switch between gyro controls and slider controls. I also implemented the store UI, it is not very useful at the moment because we still have to add coins and a reward system, but it is there and it scales nicely.
And to finish this week, I fixed the device orientation lock. Now, the game will adapt its orientation to how the player is holding the phone. If this would be annoying during gameplay, you can of course simply disable screen rotation on your android phone.
I worked a lot on the project this week, mainly because I wanted it to be bug free before the start of Flega. I started with one of my bigger tasks: implementing the new UI (screenshots can be seen on the artists blog.). As I have set up the UI managing myself, this went pretty quickly.
Next up was the return button on android, I added functionality to it so that the player can now go back to the main menu at any given time when he is in game. To prevent the player pressing this accidentally, I have provided a confirmation screen. From this confirmation screen the player can either go back to the game or leave to the main menu.
The next thing I did was implementing what happens when you die. Before this week, you would just get a message with “You lost” and that’s it. Not only the teachers, but also all of my friends who played the game asked what their score was when they died. So I implemented a system-independent hi score that tracks your best score and shows you what score you achieved when you died.
I then fixed the animations, for some reason the animation that handled the transition between the main menu and the in game screen only played the first time you would press play. I tracked this bug down and fixed it, as it was a pretty deep bug I decided to fix it at the core instead of just patching it, which demanded some rewriting of the manager.
I fixed the UI messages that get displayed platform independently, PC and Android get different texts also the score multiplier now gets applied when you die. Also tweaked the gyroscope handling.
And last but definitely not least, I implemented the touch handling and the UI player feedback for it. If your phone does not support gyroscope or you just hate rotating your phone to play a game, you can now disable the gyroscope option in the settings and you can play the game with your fingers. This system was a real problem to tackle, I had to make sure that the rotating was not too sensitive when you travel a long distance with your finger but at the same time you still want to be able to do high precision last second tweaking.
The following gif is recorded using Unity Remote (because the touch rotation does of course only work with a mobile phone as controlling unit, keep in mind that the Unity Remote connection has some delay on it, which makes it super hard to play from the remote but it is the only way to record).
This week I focused on adding some handy features the teachers asked us about. For example I made a new menu state that responds to the return button on the android phones. Players can now go back to the main menu at any time they want. There’s still need for tweaking with the delay on the return button for confirmation. I also implemented the touch anywhere in the middle to pause and resume the game. Also changed the way the animations are handled.
Made the navigating between UI states cleaner and more user (programmer) friendly, because this was what caused the 2-hour-fix-simple-bug. I removed the user interface and functionability of the right part of the screen to make room for a new and better system.
This week I implemented the user interface that the artists had made.
It turned out that device independent scaling was way more of a pain than expected. Once I got it perfectly on desktop and phone, it turned out badly on tablets. I spend some time adapting it and cutting in a way that it fits nicely on all devices now. It did take me quite a while but it was worth it, the game is starting to get shape. Badum tss.
Made few improvements to the UI and state flow, you can now go from reset screen to the main menu screen. Added an option for the player in the options menu to enable or disable gyroscope. If the gyroscope is disabled, you can play with the arrow buttons on the in-game UI. I added these and their functionality as well this week. It is now easy to rotate without gyroscope
I also added the right settings for the android build and a temporary logo 🙂 Improved loading time too by compressing audio.