A key component of Lament is being able to respawn and upgrade the player, allowing for more replayability and decision making during play. However, in order to upgrade the player character, the player must have resources to spend in order to do so, which are the Terra Shards.

Terra Shard Research
One of the resources used in player upgrades are Terra Shards, which are explained in the GDD which I have analysed in this Research Post:

Player Inventory
In order to track how many Terra Shards the player has I created a separate C# script called PlayerInventory:
This script has a public int currentTerraShards which tracks how many Terra Shards the player collects.
The Start() method sets this amount of Terra Shards collected to zero.
I also wrote a method called takeTerraShards(int pickupTerraShards) which takes an int as an input and adds that amount to the currentTerraShards count.

Terra Shard prefab
However, this takeTerraShards() method has to be called somehow, to do this I created a gameobject prefab called TerraShard. In the Start() method, an int pickupTerraShards is randomly set between 1 – 5 (As outlined in the GDD), which is how many Terra Shards it will rewards the player with if picked up.
Also, there is a CircleCollider2D set to trigger attached to the gameobject. In the OnTriggerEnter2D() method, it checks of the other gameobject colliding with it is the player. If it is it will call the takeTerraShards() method in the PlayerInventory script with the randomised pickupTerraShards int as its input.

Bug Fixing
After our UI Designer, implemented a pause menu when the player presses escape, I noticed that it doesn’t prevent the players inputs. Allowing the player to move around and attack (Even when using left-click to press buttons in the pause menu).

In order to fix this I set the Time.timeScale to zero whenever the pause menu was active, preventing time from passing within the game. Then resetting Time.timeScale to 1f whenever the pause menu was inactive.
Furthmore, I put the logic to disable enemy scripts into their own methods called stopEnemies() and startEnemies() so that they are only called once (Whenever the pause menu was active) instead of constantly checking whether they should be called, optimizing the games performance with less constant checks in the Update() method.


Pitfall Interaction
After developing the Pitfall obstacle prefab, we decided to alter the player interactions with the pitfall by allowing the player to dash over them. This would add a new layer of skill expression into the game.


To do this, I altered the the pitfall script, specifically in the OnTriggerEnter2D() method. Now it would first check if the player was dashing before executing the rest of the code, if the player was dashing, none of the pitfall code would be executed:

Attack Range



As per feedback from the playtest and discussion in the group, players had felt that hitting enemies was much too difficult. In order to remedy this, I made all four of the attack hitboxes larger by 20%. To do this, I locked the scale of the transform components of the hitboxes (Making all the axis scales change by the same amount) and increased the scale from ‘1’ to ‘1.2’

Pitfall Interaction – Pt 2

After altering the Pitfalls due to feedback from the playtest, the player would now have to be able to dash through the pitfalls, while being unable to walk through them. This seems like two features that would counteract one another, but this is explained in this Development Post.
Quality of Life Changes
Due to feedback from playtesters, we decided to change small aspects of the player to make the game more forgivable, this is common practice in many games to make the game less frustrating to players.

Bug Fixing – Pt 2

This first bug was due to the attack being dependant on where the player was facing, in the PlayerControllerNew script, this was set by the player’s most recent movement input. However, if the player attacked before they moved, their isAttacking bool would be stuck as true, causing the player to be unable to move if this were to happen. To fix this I set the player to face one direction in the Start() method.
