The Gruen Effect - Progress Devlog 4


This week I mainly focused on the incorporation of player abilities, the next major step in making this game just that, a game. Since I wanted the player to pick the weapons that they use up and have them be expendable (removed from the player after one use), I first needed a way to keep track of the player's inventory (of sorts) before any kind of physics or projectiles were implemented. I decided to assign four keys to hypothetical item slots, and my plan was to have it so that when the player approaches a shelf and hits the key corresponding to an empty slot, that slot gets filled with whatever item was displayed on that shelf. The player can then press that button to use the item, and the slot becomes empty again.

After some thinking about some ideas for the item storage system, including using the names of the items in a slot as Strings within the code that were then assigned to variables. In the end I went for something slightly simpler, having a integer variable correlating with each key and then representing the item with a number from one to four. From there, I could check the value of that number when the button was pressed to determine which item is in said slot (if there is an item).

https://i.imgur.com/EFHa3yb.mp4

The Milk item was simple enough, it essentially boiled down to dropping a collider wherever the player was at the time of use. With this system in place, I was able to get to work on making functional projectiles for the Soda item, and I had two methods I messed around with implementing. The first of these would be to get the projectiles to launch by directly giving them velocity and a direction to fire by use of Vectors and complex mathematics. However, I very quickly found myself out of my depth with mathematical concepts I could not understand, and also discovered that in Unity those values on an object were not accessible in the way I thought they were initially. 

This led me to a simpler but much less sophisticated option, and that was just to apply a large force to the projectile shortly after spawning it in the direction the player was facing. In the end, this solution worked perfectly and the lack of finesse in the launching the projectiles didn't matter (they only need to be around for several seconds anyway, so that level of control that I was originally going for would never be used).

https://imgur.com/gallery/3if0CTC

From this point, completing item implementation is a simple case of smaller versions of the Soda item for the Cashew item, and a melee weapon similar for the Baguette item.

Files

TGE 1.zip 3 MB
Sep 12, 2021
TGE 1.1.zip 4 MB
Sep 12, 2021

Get The Gruen Effect

Leave a comment

Log in with itch.io to leave a comment.