Keep Calm and Bounce on Mushrooms
It has been a few days since my last update, but i have been working on my game continuously since my last blog post. I simply haven’t had time to write-up a blog because of work and other commitments. So today i am able to show off a few cool new features.First i have now included garbage piles and flowers to the game world of TRASHTASTIC. These items pop-up in real time to the players actions, if the game world is slowly getting dirtier and dirtier, the player will start to see garbage piles more frequently. In contrast, if the player is cleaning up the game world like a pro, they will see flowers start to pop-up all over the lovely green grass.
The second item i have added to my game since my last update is super serious bouncy mushrooms for the player to jump around on. These will be used so player can reach higher platforms and hidden areas! The bouncing effect was actually quite difficult to achieve, unity’s official physics material was not performing as i wanted, and to create an effect exactly as i wanted i had to script the whole reaction myself. It ended up coming out perfectly on my Android test build. However it’s a tad jarring when i test on my PC, this isn’t a huge issue since the game is only being released on Android devices, it will just make testing my game a little bit ugly. The animated GIF i included in this blog is recorded from my PC, which i am a bit underwhelmed by, i would have rather shown off the finished mushroom from an Android device as that is where the animation and effect truly shine.
Writing the script to have garbage and flowers appear was quick and easy. Based on my last post about my texture arrays, these assets use the exact same array to decide when to appear in game. I set a variable (the score) and away i go. There are three different stages for the assets to appear, split into three different scripts. This helps populate the world incrementally instead of everything showing up on the screen at once. Both the flowers and garbage were also given a clean “sparkle” and dirty “splat” when they appear as a bit of extra animation and juice. The mushroom was difficult to get working mainly because the functions in the script were updating once per frame, and since TRASHTASTIC runs at thirty frames per second, the function is called thirty times a second, or once every 0.03~ seconds. The script was asking the game engine to perform an action so rapidly that the engine was doubling up and causing the event to happen multiple times in a single function call. This was problematic, and caused issues when the player wouldn’t bounce at all, or bounce too high. To fix this i had to create a boolean in the script to make ask the first function to pass a message along to a second. By creating a boolean and opening a second function on contact with the mushroom, the engine is forced to play the function through once completely before trying to execute the same function a second time.
This is a very exciting stage for me. All the features for TRASHTASTIC are complete. Now i begin stage and level design. This shouldn’t take too long and very soon TRASHTASTIC will be in beta, which is very close to release! I would like to ask for assistance with beta, if anybody would like to test and provide feedback i would appreciate any and all the help i can get. Once i have a few levels implemented and functioning i will be releasing a new test build onto this blog. If you would like to try the game today however, you can still access the early pre-alpha build on my first update here! Thanks for reading!