We may earn an affiliate commission when you visit our partners.
Sunny Valley Studio

Have you ever created a game prototype that was really cool but as you have started building on it every new feature seemed to introduce bugs in the old code? Or maybe this 1 feature that you had in mind and thought as being 2h of work to implement ended up taking 2 weeks?

Read more

Have you ever created a game prototype that was really cool but as you have started building on it every new feature seemed to introduce bugs in the old code? Or maybe this 1 feature that you had in mind and thought as being 2h of work to implement ended up taking 2 weeks?

If this sounds familiar I encourage you to take a look at this course. In this course we will learn best practices for programming games. We will focus on the general game structure, code structure and how to use design patterns in our game to solve different issues that will arise. By using Unit Tests we will create some degree of certainty that our code will run as it should even after adding new features and refactoring the previously written code.

Those are mostly overlooked topics in most courses on how to create games. There is a reason for it. They show you how to create a prototype. Your game prototype must be created fast, can be crude and can have bugs. It's role is to get you feedback if your game idea is promising.

My goal in this course is to give you an idea about broad range of topics mainly connected with programming. On an example of a city builder game we will look at how to use different design patterns, create unit tests and refactor the previously written code to account for the new features that we want to introduce into our game.

After receiving a couple of reviews I can see that sometimes I can go too fast through some aspects and I don't explain some more basic concepts of the code. Please take this into consideration that some intermediate knowledge of C# and a good understanding on how Unity editor works is crucial for you to get the most out of this course.

I hope that I can help you improve your coding skills where it comes to game development. At the same time I am sure that not everyone will be satisfied with my delivery and the quick pace at some points. Please know that you have 30 day to apply for a refund. I don't want anyone to feel dissatisfied with their purchase.

*This course is made using Unity 2019. You should be able to follow along using latest LTS (long term support) version of Unity 2019.

Enroll now

Here's a deal for you

We found an offer that may be relevant to this course.
Save money when you learn. All coupon codes, vouchers, and discounts are applied automatically unless otherwise noted.

What's inside

Syllabus

Introduction
Course Content
Check the result
Resources used in this course
Read more

PlayerStatusTest will fail at this point. I have added a package with a fix called "FIXPlayerStatusTestFail.zip"

PlacementManagerTests will fail if we run it. It is so because we have set Color.a =0.5 -> alpha channel of a color to be 0.5 so we can see better. To adjust it in the tests we simply have to change the alpha of a color before we compare it - ex:

Color color = Color.red;

color.a = 0.5f;

Assert.AreEqual(renderer.material.color, color);

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Focuses on game structure and design patterns, which are essential for creating maintainable and scalable game projects, especially for developers working on larger or more complex games
Emphasizes refactoring and unit testing, which are crucial for ensuring code quality and preventing bugs, making it valuable for developers aiming to improve their coding practices
Uses Unity 2019, which may require developers to use an older version of the engine, potentially missing out on newer features and improvements available in later versions
Requires intermediate C# knowledge and a good understanding of the Unity editor, which may pose a challenge for beginners or those with limited experience in game development
Employs a city builder game as a practical example, which allows learners to apply the concepts and techniques in a real-world scenario, enhancing their understanding and retention
Covers topics like object-oriented programming and SOLID principles, which are fundamental concepts in software engineering and can be applied to various game development contexts

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Improve unity game code quality

According to learners, this course offers a largely positive experience, particularly for those looking to move beyond basic game development tutorials. Many appreciate its unique focus on code quality, covering essential topics like design patterns, unit testing, and refactoring often overlooked in other courses. Students highlight the value of learning best practices to build more robust and maintainable games using a practical city builder project. However, some mention the pace can be fast and emphasize that it requires intermediate C# and Unity knowledge to succeed.
Concepts applied practically building a city builder game.
"Building the city builder game alongside the lessons really helped solidify the concepts for me."
"The project serves as a great vehicle for learning how to apply design patterns and refactoring in practice."
"It's useful to see these code quality principles applied step-by-step within a real game development context."
Explores design patterns and crucial unit testing for games.
"Glad this course included unit testing in Unity; it's rarely taught for game development but is so important."
"Understanding how to apply the State and Factory patterns through practical examples was a major takeaway."
"These topics like design patterns and refactoring are often skipped in other game dev tutorials I've taken."
Teaches best practices for clean, robust game code.
"Finally learning *how* to structure Unity code properly, not just getting a prototype working!"
"This course helped me write much cleaner, more maintainable code for my game projects."
"Applying the OOP and SOLID principles taught here made a huge difference in managing complexity."
Requires intermediate C# and Unity knowledge; pace can be fast.
"Beginners will likely struggle with this course; you definitely need solid intermediate C# and Unity basics before starting."
"The course moves quite fast at times, especially through coding sections, so be prepared to pause and rewatch frequently."
"You should already be comfortable navigating the Unity editor and basic scripting workflows."
"Some fundamental concepts could have been explained in slightly more detail for those less familiar with certain programming patterns."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Unity 2019 Learn to write better code making a City Builder with these activities:
Review C# Fundamentals
Strengthen your understanding of C# syntax and concepts before diving into Unity-specific code. A solid foundation in C# will make it easier to grasp the course material and write cleaner code.
Show steps
  • Review C# data types, variables, and operators.
  • Practice writing simple C# programs.
  • Study C# control flow statements (if, else, loops).
Practice Unity Editor Basics
Familiarize yourself with the Unity editor interface and basic workflows. Knowing how to navigate the editor will save you time and frustration during the course.
Browse courses on Unity Editor
Show steps
  • Create a new Unity project and explore the editor layout.
  • Practice creating and manipulating GameObjects.
  • Learn how to import and use assets.
Review 'Game Programming Patterns'
Deepen your understanding of design patterns by studying real-world examples. This will help you write more maintainable and scalable code for your city builder game.
Show steps
  • Read the chapters related to the design patterns covered in the course.
  • Try implementing the patterns in a small test project.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Implement a Simple Unit Test
Practice writing unit tests for a simple class in your city builder project. This will reinforce your understanding of unit testing principles and help you catch bugs early on.
Show steps
  • Choose a simple class in your project to test.
  • Write unit tests to verify the class's functionality.
  • Run the tests and fix any errors.
Review 'Clean Code'
Learn best practices for writing clean, readable, and maintainable code. This will help you write better code for your city builder game and other projects.
View CLEAN CODE on Amazon
Show steps
  • Read the chapters related to code style, naming, and functions.
  • Apply the principles to your own code.
Document Code Refactoring
Create a blog post or video explaining a refactoring you performed in your city builder project. This will help you solidify your understanding of refactoring techniques and share your knowledge with others.
Show steps
  • Choose a refactoring you performed in your project.
  • Explain the problem you were trying to solve.
  • Describe the steps you took to refactor the code.
  • Share your blog post or video online.
Contribute to a Unity Open Source Project
Contribute to an open-source Unity project related to city building or game development. This will give you valuable experience working on a real-world project and collaborating with other developers.
Show steps
  • Find an open-source Unity project on GitHub or GitLab.
  • Identify a bug or feature you can contribute.
  • Submit a pull request with your changes.

Career center

Learners who complete Unity 2019 Learn to write better code making a City Builder will develop knowledge and skills that may be useful to these careers:
Game Programmer
A game programmer brings video game concepts to life through code. This course, centered around building a city builder game in Unity, directly aligns with the skills a game programmer needs. You will learn how to implement game mechanics, handle user input, and manage game states. The course emphasizes best practices for programming games, focusing on general game structure, code structure, and design patterns. As a game programmer, you'll especially appreciate the sections on refactoring, unit testing, and object oriented programming which helps build a solid foundation for creating robust and maintainable game systems. Further, this course may allow a game programmer to better organize their code making them a more efficient programmer.
Mobile Game Developer
Mobile game developers create games for smartphones and tablets. This course is directly relevant to the work of a mobile game developer. By creating a city builder game, you will learn how to apply game mechanics, handle user input, and optimize performance for mobile platforms. The course emphasizes best practices for programming games, focusing on general game structure, code structure, and design patterns. The mobile game developer may be able to use the material in the course to better structure their code. The course's use of Unity means that you can deploy to a variety of different platforms.
Indie Game Developer
Indie game developers work independently or in small teams to create and publish their own games. This course focused on building a city builder game, provides a comprehensive foundation for indie game development. The course explores how to implement game mechanics, handle user input, and manage game states. As an indie game developer, you will find value in the sections on game and code structure, design patterns, unit testing, and refactoring. Taking this course can help indie game developers produce a stable game. The course is taught using the Unity game engine, making it highly relevant to the kind of tools available to indie game developers.
Gameplay Programmer
Gameplay programmers are responsible for implementing the interactive elements of a game. This course provides a thorough introduction to the systems and patterns needed to create compelling gameplay. The course's emphasis on game and code structure, along with the use of design patterns, helps a gameplay programmer create maintainable and scalable systems. The gameplay programmer benefits from the hands-on experience on implementing game mechanics such as structure placement, camera movement and state management. This course may be valuable to a gameplay programmer who is searching to improve their code's architecture.
Software Engineer
Software engineers design and develop software applications. This course, while focused on game development, provides valuable insights into software engineering principles which may make you a better software engineer. By focusing on creating a clean structured codebase, the material in this course will help make the software engineer more mindful of their code. The course covers object oriented programming principles, design patterns, unit testing, and refactoring, all essential skills for building scalable and maintainable software. The software engineer can use what they learned in this course to better approach large codebases and manage complexity. Furthermore, the hands-on experience of building a city builder provides practical application of these concepts making them stick.
Software Developer
Software developers build software applications. This course uses a practical example of a city builder to give context to software development concepts which may be useful to the software developer. The course covers a broad range of topics connected to programming, including design patterns, unit testing, and refactoring. All of which are applicable to more than just game development. The software developer benefits from learning about clean code and object oriented programming, so they can apply these techniques to other software projects. The course will make the software developer more familiar with the Unity game engine.
Augmented Reality Developer
Augmented reality developers create applications that overlay digital content onto the real world. This course provides value to the augmented reality developer because augmented reality applications are typically built using game engines like Unity, which the course focuses on. The course will allow the augmented reality developer to implement user interfaces and handle user input. In turn, they can apply these skills to develop engaging and interactive augmented reality experiences. Learning more about object oriented programming may give the augmented reality developer an edge.
Application Developer
Application developers create applications for computers and mobile devices. This course provides a foundation for understanding software architecture, design patterns, and unit testing, all of which have relevance to application development. The course's use of Unity gives the application developer experience with a popular cross platform development environment. Learning C# and how to use it with Unity can be useful as the application developer goes on to create rich user interfaces and manage application state. Using examples from game development, this course can make the application developer a more well rounded engineer.
Technical Designer
A technical designer bridges the gap between design and programming in game development. This course may be useful for a technical designer by providing them with a deeper understanding of the technical constraints and possibilities when building game mechanics. The course's focus on code structure, design patterns, and refactoring may allow the technical designer to communicate more effectively with programmers and contribute to the technical design process. Specifically, the course's detailed walkthrough of building a city builder game, including implementing features like structure placement, camera movement, and UI elements, provides practical examples that a technical designer can draw upon.
Virtual Reality Developer
Virtual reality developers create immersive experiences for virtual reality headsets. This course is directly applicable to the work of a virtual reality developer because virtual reality experiences are typically built using game engines like Unity, which the course focuses on. The course may allow the virtual reality developer to implement 3D environments and handle user input within a virtual reality context. In doing so, they can apply these skills to develop engaging and interactive virtual reality experiences. This course may allow the virtual reality developer to better structure their code.
Tools Programmer
Tools programmers create software that helps other developers create games. This course, while not explicitly focused on tools development, can be helpful for a tools programmer by providing them with a deeper understanding of the challenges and workflows involved in game development. The course's focus on code structure, design patterns, and refactoring may allow a tools programmer to design and build better tools that integrate seamlessly into the game development pipeline. By learning how to write better code, the tools programmer can streamline game creation. Understanding how to use Unity and C# in order to achieve one's goals is at the heart of this course.
Technical Artist
Technical artists bridge the gap between artists and programmers, ensuring art assets work seamlessly in a game engine. This course may be useful to the technical artist because it helps them better understand the technical aspects of game development. The course may help the technical artist communicate effectively with programmers and optimize art assets for performance. This course can make the technical artist more familiar with Unity. The technical artist can improve their understanding of game architecture by learning how to use C# and Unity.
Simulation Engineer
Simulation engineers create computer models for training and analysis. This course may be useful to simulation engineers by improving their software development skills. The course's coverage of object oriented programming and unit testing may allow the simulation engineer to better approach problems within their field. The simulation engineer can use the course material to improve the reliability of their simulations. Taking this course may allow the simulation engineer to better structure their code within the Unity game engine.
Data Scientist
Data scientists analyze and interpret complex data. While seemingly unrelated, this course can be useful for a data scientist interested in the growing field of game analytics or simulation. The course's focus on creating game systems and generating data through gameplay may allow the data scientist to gain a better understanding of data pipelines. They may then apply this to analyze player behavior, optimize game design, or build predictive models. Data scientists can use the Unity game engine to create simulations.
QA Tester
QA testers are responsible for finding and reporting bugs in software. This course, while not explicitly focused on testing, may be helpful for a QA tester by providing them with a deeper understanding of software development principles. The course's focus on unit testing may allow a QA tester to write better test cases. The course provides a practical understanding of creating software and identifying potential issues. In addition, the QA tester may gain familiarity with Unity.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Unity 2019 Learn to write better code making a City Builder.
Provides a comprehensive overview of design patterns commonly used in game development. It will help you understand the design patterns discussed in the course and apply them effectively to your own projects. This book is valuable as additional reading to provide more depth to the course. It is commonly used by industry professionals.
Provides principles and practices for writing clean, maintainable code. It will help you improve the quality of your code and make it easier to understand and modify. This book is valuable as additional reading to provide more depth to the course. It is commonly used by industry professionals.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser