Skip to content

๐ŸŽฎ๐Ÿ’ป A 2D Rougelike/Action-Platformer Game made in Unity

Notifications You must be signed in to change notification settings

O1Wilson/Eternal-Labyrinth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Eternal Labyrinth

2D rougelike/action-platformer. This game explores complex systems in C# using the Unity Engine, Featuring a sophisticated movement system, diverse characters with unique abilities, custom items each with their own interaction + synergy, and animation + SFX implementation.(Coming Soon).

Please check out the orginizational methods I used inside the assets folder, every thing is neatly organized including the code! Check out the parent classes I use for the player to allow for expansion later if decided.

Code Snippets

Below I have attached various code snippets which I feel best showcase this project, please explore the unique systems in full for a better understanding of the skills that I can provide!

Character Abilites

Below here is the code I use for the players main attack. This attack is rather simple and uses a collider sphere to detect enemies inside a radius. If there are enemies inside the collider the "TakeDamage()" method will be called inside the enemies script with the correct damage information.

PrimaryCode

PrimaryGif.mp4

Below here are the two scripts I use to instantiate a Wave Prefab.

You can see in the first snippet the code I use to scale the prefab using a lerp function that is based around a multiplier calculated elsewhere in the script, You can see that I have set scale factors in order to limit the size of the prefab.

In the second snippet you can see the code that actually registers and damges enemies, additionally it will reset the "bloodGauge" variable which is used to determine the player multiplier. These snippets combined will allow the player to shoot a scaling wave projectile.

SecondaryCode SecondaryPrefabScript

SecondaryGif.mp4

Below is a three part system which in short allows for the player to drain their "bloodGauge" for damage immunity. Before explaining the code, bloodGauge refers to resources dropped from slain enemies, and caps at default 100.

The first Code Snippet is the method I use to begin the Immunity Coroutine, there are three parameters that need to be set inorder to run the coroutine, Cooldown, Blood Storage, Input. I also added a feature to end the coroutine early inorder to save resources.

The second snippet is the core function for the actual ability. You can see at the top I set two bools to true, "isDraining" is used to determine when the coroutine is actually running, and damageImmune prevents the player from taking damage in another method. Afterwards I start a while loop which drains the bloodGauge by a specific amount aslong as there is value to drain from. Then once the value has been depleted it set the bools back to false and sets the ability on cooldown.

Finaly in the third snippet I have attached the actual code which determines the Gauges. The blood gained is determined on the enemy script once it dies, but in this script I use a lerp function to interpolate between a damage multiplier of 1 and 10 based on the percentage of the Gauge.

UtilityCalled UtilityCode BloodGauge

UI and Movement

Below are the two snippets I use to calculate level, and scale based on that calculation

The first code snippet is rather simple, I use the MathPow Function to exponentially scale the level based on the amount of xp. So each level interval is progressivley harder to reach

The second snippet is also simpler than it seems, inside the method I set static variables which are used to multiply the level and add it towards the players stats, additionaly I have set the "priorLevel" variable to prevent the values from repeatedly being applied

LevelCalc LevelScaleCode

Below is how I display the character information above from the player scripts into a Unity Canvas.

PlayerUIscript HealthBar LevelBar

Below you can see the implementation of CoyoteTime, and Jump buffering. I have added these features to improve user input, allowing for more seamless gameplay.

JumpingCode

Below is my code for Wall Jumping. You can see how ive implemented jump duration, counters, and power which again allows for more seamless gameplay with wall jumps.

WallSlideCode WallJumpCode

Enemy

Below is the code I use to damage and kill an enemy.

EnemyScript

Releases

No releases published

Packages

No packages published