
Begin your journey in Unity with a beginner's guide to completing a 2D platformer in C sharp, covering setup, Discord community support, and reference project materials.
Set up a fresh 2D Unity project with a practical layout and switch the game view to full HD, then tailor the package manager to remove visual scripting.
Import the Unity package into the assets folder to bring in art, audio, and fonts for the project. Discover royalty-free Pixel Frog assets and free asset packs.
Set up a new 2D scene in Unity with platforms and a player, using sprites and a parent‑child arrangement, then adjust the main camera size for a practical view.
Apply Rigidbody 2D and colliders to a Unity character, adjust capsule and box colliders, and tune gravity scale, collision detection, and interpolation to keep the player upright and grounded.
Create a scripts folder, add a C# script named player controller, attach it to the player, and learn MonoBehaviour, start, and update functions that run each frame.
Expose a public move speed and a public rigidbody 2D reference, then move the player horizontally by setting velocity to the horizontal input times move speed.
Add a jump force and apply it to the player's rigidbody when the jump button is pressed down, updating the y velocity while preserving the x velocity.
Introduce a run speed and active speed for your 2D platformer, with active speed defaulting to move speed. Hold left shift to switch from move speed to run speed.
Build a reliable ground check in a 2D Unity platformer using a ground check circle and ground layer mask to enable jumps only when grounded, preparing for a double jump.
Add a can double jump boolean to the player controller, enabling a second jump only after leaving the ground and resetting it after the airborne jump.
Refactor duplicate jump logic into a custom void function called jump, then call it from update to improve maintainability and prepare for future features like sounds or particle effects.
Create idle, run, jump, and fall animations in Unity, connect them with an animator controller, and tune three-frame spacing while avoiding recording from overriding physics.
Set up the Unity animator to switch between idle, run, jump, and fall using speed, is grounded, and y speed, with no exit time and instant transitions.
Connect the animator to the player controller and drive animations by updating speed, is grounded, and y speed from the rigidbody velocity, using the abs function to handle left-right movement.
Flip the character by adjusting the player's local scale, using velocity x to set scale to (1,1,1) or (-1,1,1), and keep facing when velocity is zero so objects flip together.
Create and integrate a double jump animation in Unity, using a boolean to activate during the second jump and reset on landing.
Attach a camera control script to the main camera to make it follow the player using a target transform, keeping the z position at -10 for proper 2d visibility.
Learn to constrain a 2d platformer camera by freezing vertical or horizontal movement with public booleans, storing the starting position, and updating the transform to keep x or y fixed.
Resolve camera jerky movement in your 2D platformer by moving the camera follow logic into late update, so the camera updates after the player has moved.
Learn to clamp a camera within a defined area in Unity by using two points as min and max bounds, and detach clamp handles from the camera.
Adjust the camera clamp by computing half height from orthographic size and half width from aspect, then offset bounds so the bottom corner aligns with the target.
Visualize the clamp area in the editor by drawing a cyan box with min and max points using on draw gizmos, aiding testing and platform placement.
Master level creation with Unity’s 2D tile map, create a main tiles palette, import sprite tiles, and organize them in assets for painting the scene.
Create a rectangular tile map, add a tile map collider 2D and a composite collider, set the rigid body to kinematic, and assign the ground layer for accurate physics.
Save the test level, remove stray squares, block edges with tiles, paint walkable surfaces, and then brighten the camera background with a blue color for a more standout look.
Add a background for a 2d platformer by creating a BG with sky and tree line layers, set sorting layers and order, and align with the camera.
Learn to implement parallax in a Unity 2D platformer by moving the sky and distant trees relative to the camera, using a parallax speed setting.
Discover how to create repeating background in a Unity 2D platformer by using a tree line mover script that repositions objects when they exceed a max distance from the camera.
Implement spikes as danger with a box collider 2D set as a trigger; use on trigger enter 2D and a player tag to damage and deactivate the player.
Attach a player health controller to manage current and max health, initializing current health to max. Expose a public damagePlayer function and call it to reduce health when hitting spikes.
Implement a singleton in Unity by exposing a public static instance of the player health controller. Use Awake to assign the instance and access it to damage the player efficiently.
Deactivate the player when health reaches zero via the player health controller, clamp health to zero, and set the game object active false as a temporary solution before checkpoints.
Implement a health UI by setting up a Unity UI canvas, event system, and anchor rules, and display ten heart icons in the top-left corner to reflect health.
Create a UI controller script to manage heart icons via an image array in Unity, exposing the hearts, locking the inspector, and populating the array by dragging icons.
Create a singleton UI controller to show player health as heart icons, updating display via health input and a for loop to enable or disable each heart.
Display empty hearts to show maximum health as players take damage, using full and empty heart sprites updated by current and maximum health in Unity.
Enable a grace period after damage with an invincibility length and a countdown in update using Time.deltaTime; damage only applies when the counter reaches zero.
Enhance invincibility feedback by tinting the player with a normal color and a fade color via the sprite renderer, then count down the invincibility timer and reset the color.
Add a player_knockback animation and an is knocking back trigger to knock back from any state on damage, using backward velocity and half jump force via the health controller.
Learn to stop player control on damage using a knockback counter, apply directional knockback velocity, and refine hit animations with transition timing to create responsive damage feedback.
Fix the double jump bug by replacing the is double jumping boolean with a do double jump trigger in the animator, and update transitions to use the trigger.
Fixes a jittery parallax background movement by synchronizing background updates with camera motion using a static singleton and a dedicated move background function, with null checks for levels without parallax.
Add health by implementing an add health method that increases current health up to max, updates the display, and tests with an editor-only H key.
Create a health pickup in Unity by adding circle collider 2D as a trigger, animate a heart, heal the player via health controller on entry, and destroy the pickup afterward.
Prevent wasting health pickups by collecting only when current health is not equal to max health, using a Unity C# guard in the health controller.
Create a health pickup burst in Unity with a circle shape and pixel art sprites, using random lifetime, gravity, and a single burst with stop action set to destroy.
Create a prefab for the health pickup effect, store it in assets, and instantiate copies into the scene with proper position and rotation to spawn the effect on pickup.
Build and test a full health pickup in Unity by creating a prefab with a trigger collider, assigning a health pickup script and effect, and restoring max health.
Set up a checkpoint system to respawn at multiple spots by creating a checkpoint object with an inactive, activating, and active flag state, controlled by a flag active bool.
activate the checkpoint when the player enters a trigger, using a checkpoint script that tracks isActive and updates the animator flag to ensure only one checkpoint is active.
Implement a checkpoint manager that auto-detects checkpoints, deactivates all others when a new checkpoint activates, and tracks the active checkpoint for reliable respawns.
Create a life controller to manage player lives and respawn at the active checkpoint, initializing the respawn position to the player's start and restoring full health.
Add a two-second respawn delay using a coroutine in the life controller to deactivate the player, wait, then reposition at the previous checkpoint, improving clarity and game feel.
Implement a kill plane below the level with a trigger box collider 2D and use the life controller to instantly respawn the player, resetting velocity to zero.
Implement a life system by adding a public int current lives variable (default 3), decrementing on death, and allowing respawn only while current lives > 0.
Display lives in the UI of a Unity 2D platformer with the lives image and a Text Mesh Pro counter, using Futile Pro as a TMP asset with an outline.
Link the lives text to the UI controller using Text Mesh Pro, convert the current lives to string, and update the display whenever lives change.
Create a full-screen game over UI in Unity for a 2D platformer, featuring a game over text and restart and main menu buttons as a reusable prefab with sprite-swap visuals.
Activate the game over screen on player death and restart the level by reloading the current scene with a restart function connected to the restart button.
Reuse the health pickup effect to create death and respawn visuals in a Unity 2D platformer. The life controller spawns them at the player's position, using quaternion identity for rotation.
Create a collectibles system in Unity: a singleton collectibles manager tracks collectible count and grants value from each pickup, using trigger detection, prefabs and prefab variants, and a pickup effect.
Implement an extra life system by using a collectible threshold, for example 100; when reached, subtract the threshold, grant a life, and update the life display.
Display collected item counts in the UI by showing a fruit icon and a live text in the top-right, updating via the update collectibles method connected to the collectibles manager.
Create an enemy rock that patrols between points, uses a horizontal capsule collider for a physical presence, and features idle and move animations.
Move an enemy in a Unity 2D platformer with patrol points and a patrol script to travel between points. Use time.deltaTime to keep movement speed consistent across frame rates.
Learn to build a Unity 2D enemy that moves between patrol points using vector3.distance and checks proximity. Wrap the index to zero when the end is reached to prevent errors.
Implement a wait-at-points mechanic for a 2d platformer enemy in Unity, using time at points and a wait counter to pause at each waypoint before moving on.
Configure the enemy's animator to switch between idle and move using an isMoving bool, with no exit time and no transition duration, and flip the sprite for patrol direction.
Add a generic enemy controller in Unity 2D platformer to damage the player on collision enter 2D, detect the player, and call the player health controller to apply damage.
Defeat enemies by stomping on them with a trigger box collider that destroys the enemy on trigger enter, then bounce the player with a public jump for extra mobility.
Add a one-time enemy death animation in Unity by flashing white on hit, triggering a defeated trigger, disabling damage, waiting to destroy, and stopping movement.
Learn how to create your very own platformer game using Unity and C#, an industry-standard program used by many large gaming studios and indie developers across the world.
In this course you won’t just be learning programming concepts, but tying these concepts to real game development uses. You will have access to a course forum where you can discuss the topics covered in the course as well as the next steps to take once the course is complete.
This course has been designed to be easily understandable to everyone, so whether you’re a complete beginner, an artist looking to expand their game development range or a programmer interested in understanding game design, this course will help you gain a greater understanding of development.
At the end of this course you will have developed the ability to create such game elements as:
Coding with c#, building from the basics up
A character with full movement, running, jumping & double-jumping capabilites
Collectibles such as fruit & extra health
Parallaxing background effects
moving & flying enemies
Level Mechanics like Spikes, moving platforms, crushing blocks & more
A checkpoint system with respawning and extra lives
Full user Interface with interactive menus
Creating levels with tilemaps
Full health & damage system with player knockback
Transitioning through multiple levels
A unique and challenging boss battle
A complete music and sound effects system
And much more!
The course also includes a complete version of the final project to use for your own reference to ensure everything in your game works as it should!
Start learning today and let me help you become a game developer!