Assignment 1 - Retro Game
This is a 2D game developed for my creative coding in unity class. This game consists of 6 levels which progressively continue to get difficult. The objective is to gather the maximum amount of points in the game. The wolf gathers two kinds of objects in this game. The eggs that he eats and bonus coins which have double the score of the eggs. Each level gets unlocked by a key to the door. The key can be found in a treasure box placed somewhere on the screen. The levels in this game are generated by code using Instantiate in Unity, however I struggled and failed with creating a state vector for the game. Due to that, some items do get spawned over one another that may lead to unexpected outcomes.
SUCCESSES.
I was able to successfully integrate sound into my game. Using triggers, collisions and collider functions I was able to create sound and update scores in my game. I was able to maintain a public level and score state in my game. This allowed me to increase the speed of movement of my enemies level 4 and onwards. I also used random functions and sin functions to programmatically determine where the elements in the game were to be spawned.
SETBACKS AND LESSONS:
I wanted to focus on developing a programmatic way to create levels in this game so that i could generate infinitely many levels without worrying about designing each individual level. This was an ambitious task as I do not have any recent experience of coding in C# and this is my first time using Unity. I started off by using the scene manager’s createScene method but quickly ran into problems with the build settings. I started exploring if i could write a custom bundler to use whatever scenes i populated in the build, but i was not successful. Afterwards i created 6 levels and programmatically spawned elements in them. I wanted to create a two dimensional state vector that maintained the state of the coordinates in the grid that had been occupied by the spawned elements but i was not able to figure out how to do it. In the end, I spawned each element randomly and iterated over groups of current elements to check if their coordinates clashed with each other. In case of a clash i would assign a random coordinate to the newly spawned element as well. But this is not a foolproof method. As i checked for clashes over separate loops, I was unable to create a system where by use of random, two elements might overlap each other.
NEXT STEPS:
I would definitely develop a state vector for the game so that I can programmatically spawn elements without having them overlap each other. I would also want to add some physics to the game and add obstacles in different levels.
Comments
Log in with itch.io to leave a comment.
This game is simple and fun. I like that you set the enemies to move to increase the vividness of the picture. It would be better if you could let the character move downward without having the head going down.
The wolf is a kind of evil charming, lol. And I really love the shifting obstacles, which not only adds the good visual instruction but also make it hard.
I felt " Too easy" at first then, it got graduallu difficult to escape each level because I became obsessed with obtaining all the goodies and the key on each level. then I realised I really liked this game because all the game objects are randomly put whenever I restarted the game. it made me continued to play. the music is sort of hypnotizing lol.
Thanksss. I struggled with the random instance part because sometimes I would instantiate things overlapping each other. The music featured in the game is my own. You can check it out here. https://open.spotify.com/track/60iG3Z14QtUT6jQ1S43ho2?si=4f9753bf75d145b4