
Learn to ask questions, access starter projects and GitHub scripts, review code changes, and use video q&a to search or post questions and request refunds within 30 days.
Discover how to add a starter project to Unity Hub by unpacking the zip, creating a project folder, loading the project, and testing the main menu scene.
Explore a starter Unity project layout, scenes, and gameplay, and learn to refactor for maintainability with object oriented programming to extend enemies and weapons and manage score across levels.
Explore why object oriented programming improves maintainability by refactoring a single big enemy class into a unit base class with inherited archers, warriors, and mages, guided by a unit manager.
Class acts as a blueprint for objects, defining data and behaviors. Objects share a class but maintain their own state, and Unity uses inspector to set data.
Encapsulation bundles data and behaviors, shown by a mover class handling speed and rigid body movement. It decouples input from movement, enabling reuse for player and enemy.
Explore how inheritance enables data and behavior reuse across weapons like swords and bows. Define an abstract weapon with protected data and an abstract attack method that subclasses implement.
Explore inheritance in unity by comparing abstract classes and interfaces, implement the I weapon interface with perform attack, and use enable and upgradable interfaces to add behavior without shared data.
Explore polymorphism by showing how a player uses an abstract weapon class to perform attacks, swapping swords, bows, or spears at runtime for flexible, maintainable code.
Explore composition as building an object from reusable parts, contrasting it with aggregation and inheritance. See how weapon modifiers in a hierarchy add elemental damage to games while favoring composition.
Assess when object oriented programming benefits a Unity prototype and when to keep it simple. Learn refactoring, modular design, and model–view–controller patterns to prepare for growth.
The lecture analyzes refactoring the shooting system to support multiple weapons, using object oriented concepts like encapsulation and composition to enable spread, double, and burst shot patterns.
Plan a modular solution by decoupling weapon logic from the player using composition and an abstract attack pattern, applying single responsibility and other solid principles for maintainability.
Refactor the Unity player by encapsulating shooting logic into a weapon class within a weapon system namespace, highlighting object oriented principles and separation of concerns.
Refactor the weapon system into an abstract attack pattern as a scriptable object, with protected attack delay and audio SFX and a public abstract perform method.
Learn to implement multiple attack patterns for a Unity ship by inheriting from an abstract attack class, creating double barrel, spread, and burst patterns, and spawning projectiles from rotated barrels.
Design a burst attack by extending the attack pattern to spawn three projectiles with offset and rotation, and share a common projectile across attack patterns for weapon swapping.
Learn how bullet projectiles collide with a meteorite to change direction and with enemies or players to lose lives, using a unified, object-oriented approach to projectile collision in Unity.
Explore implementing a common hittable interface in unity using c# to let projectiles interact with enemies and players by calling getHit with damage and sender info, enabling easy extension.
Leverage unity’s layer collision matrix to control collisions between player, bullet, enemy, and enemy bullet, then implement the IHittable interface on projectiles and destroy them on hit.
Refactor player and enemy scripts to implement the AI hittable interface, encapsulate health, get hit feedback, and death logic, and streamline on trigger enter handling.
Implement a meteorite object in Unity that is pushed by a bullet, with bounce behavior on players and enemies, using a kinematic rigidbody and box collider.
Create a meteor object in Unity with a sprite, circle collider, and kinematic Rigidbody2D; rotate, move, and bounce it using a reusable AI-capable interface.
Learn how object oriented programming improves visual and audio feedback for collisions in a Unity game while refactoring the health and feedback systems for better maintainability and reuse.
Explore component-based architecture and composition over inheritance in Unity, replacing rigid inheritance with reusable health components attached to game objects, accessed via the inspector, and driven by Unity events.
Extract the health system from the player and enemy into a dedicated health class, encapsulating logic for reuse and exposing hittable behavior with Unity events for death and hit.
Refactor the player and enemy scripts to use a shared health component, initialize health values, and drive on death events with get hit feedback and UI updates.
Refactor the health system to use a dedicated feedback system that triggers visual effects and audio on hit and death, creating reusable feedback prefabs for player and enemy interactions.
Wire enemy feedback with prefabs, adding hit and death audio and visual effects, and remove delayed destruction in favor of immediate removal after feedback.
Learn to implement bullet feedback by wiring SFX and VFX to a bullet's death event and attaching a reusable health component, with prefab variants for reuse.
Discover how object oriented programming decouples enemy behavior to add new enemy types and make the system more maintainable using abstraction, encapsulation, and composition.
Explore why inheritance can create duplication in enemy behavior and learn to replace it with a component-based approach in Unity, using small action scripts for shooting, movement, and aiming.
Refactor the enemy by extracting movement into a dedicated MovementAction component, encapsulating rigidbody movement and speed, enabling object-oriented, modular behavior and preparing to refactor shooting next.
Refactor enemies into shoot and aim actions, wire a weapon system, and enable enemies to look at and shoot at the player using updated update logic and attack patterns.
Swap in a new enemy prefab, update its sprite and collider, and swap the enemy script to test a melee variant, then implement wave movement using amplitude and frequency.
Implement a sine-wave enemy movement in Unity by creating a movement script, refactoring the enemy spawner to use a random enemy from a list, and embrace modular, object-oriented design.
Learn how to apply object oriented programming in Unity through prototyping, planning with UML diagrams, and apply design patterns to expand features like enemies, weapons, and inventory.
Improve your coding skills by learning Object Oriented Programming and how to apply it in Unity.
All the theory is explained on game-related examples and next we use a Hands-On project - a prototype of a 2D Shoot 'Em Up game to learn how to apply what we have learned in a Unity project.
Do you find it difficult to add new Enemies, Weapons or new Game Mechanics to your game? Do you spend more time fixing bugs than actually testing the new feature that was meant to take you few minutes to add? If so I bet that you will benefit a lot from learning OOP!
Instead of talking about generic concepts like Animal-Dog or Person-Employee we will use game-related examples like implementing different weapons to your game or how to add multiple different enemies to your project.
This course is made out of 2 parts:
Theory Part:
In Section 1 I will explain WHAT is Object-Oriented programming:
Encapsulation
Abstraction
Inheritance
Polymorphism
*We will also talk about composition and why "prefer composition over inheritance" is a GOOD advice.
Practical Part:
NEXT we will work on a HANDS-ON project by implementing new features and seeing HOW and WHY to apply OOP solution. We will explore why a prototypical code will fail when we want to expend our game with new features and I will show you HOW to use OOP to enable us to easily add new weapons, enemies and other features that we want to have in our game.
There is no way to learn OOP just by exploring theory. You need to PRACTICE and explore some game dev related examples to get a feel for how to apply OOP in your code ?
We will tackle the most common game dev tasks:
Adding different weapons to your game
Adding a new game mechanic
Making tour code more component-based
Adding a new enemy
What you can expect from the course: ?
5h of video content
Learning OOP can be done only through practice. After you watch the theory (Section 1) I have prepared few example problems related to Game Dev so that you can PRACTICE what you have learned.
A Fully working Shoot'em up game prototype
Theory (WHY) is useless if you don't know how to apply it in practice.
I have prepared a working prototype of a small game that we will refactor so that you can learn HOW to use OOP and WHEN to do it.
Project files and scripts
For each video where we write some code I will provide a github link so that you can view the changes in the code as well as my full project that you can open in unity to find any issue / difference / bug that you might have.
My help
If you don't understand something just ask here in the comment section or on courses Discord channel. I do my best to daily answer any question.
30-Days refund policy
If you don't enjoy the course let me know and I will issue a refund if you are within the 30 days from the date that you made the purchase.
Sunny Valley Studio has already helper more then 4350 students in addition to almost 10 000 subscribers on my YouTube channel to improve there C# coding skills and there knowledge about Unity by showing how to make 2D Platformer, a Juicy 2D shooter game or a 3D Survival game as video courses. On YouTube you can find everything from how to create Minecraft-like voxel world, a turn-based 2d game or an inventory system.
Hi! I'm Peter and will be your instructor.
I am passionate about programming and Unity (worked for about ~5 years as a programmer / unity dev) and I will do my best to help you to develop game dev and programming skills that you can use to make your own games or to get a job in a game dev studio as a programmer )
See you in the course!