All courses

C# Basics for Game Makers

Go from zero to real C# by making game stuff: health bars, loot, damage and bosses. Write a line, press Run and see what it does.

143 lessons, about 29 h 55 min

Guest mode. Chapter 1 is fully playable. Sign up to open the rest and keep your progress.

Your first program

14 lessons, about 2 h 14 min

Print text, see how statements run in order, read compiler errors, use comments and build a title screen.

  1. What is a programming language? Demo, +25 XP, 3 min
  2. The editor and the console Demo, +25 XP, 2 min
  3. Hello, World! Demo, +25 XP, 7 min
  4. Printing a line Challenge, +20 XP, 8 min
  5. Statements run in order Challenge, +20 XP, 8 min
  6. Write vs WriteLine Challenge, +20 XP, 10 min
  7. Predict the output Predict, +15 XP, 12 min
  8. Printing a text box Challenge, +20 XP, 9 min
  9. Fixing compiler errors Challenge, +20 XP, 9 min
  10. Comments Demo, +25 XP, 8 min
  11. Commenting out code Challenge, +20 XP, 10 min
  12. ASCII art Challenge, +20 XP, 10 min
  13. Quiz: printing and errors Quiz, +15 XP, 13 min
  14. Chapter project: Title screen Boss, +100 XP, 25 min

Variables and types

16 lessons, about 2 h 55 min

Store values in named variables: whole numbers, decimals, text, single characters and true or false. See how numbers are stored in bits and bytes, and how to pick int, uint or long.

  1. What a variable is Demo, +25 XP, 8 min
  2. Joining text and numbers Challenge, +20 XP, 9 min
  3. Declare now, assign later Demo, +25 XP, 8 min
  4. Predict the output: changing values Predict, +15 XP, 14 min
  5. Text in string variables Challenge, +20 XP, 9 min
  6. Decimals and booleans Challenge, +20 XP, 9 min
  7. char and float Challenge, +20 XP, 9 min
  8. Quiz: choosing a type Quiz, +15 XP, 13 min
  9. Bits and bytes Challenge, +20 XP, 11 min
  10. int, uint, long: picking a number type Challenge, +20 XP, 12 min
  11. Predict the output: number types Predict, +15 XP, 11 min
  12. Naming variables Challenge, +20 XP, 9 min
  13. Using var Challenge, +20 XP, 9 min
  14. Constants with const Challenge, +20 XP, 10 min
  15. Fixing type errors Challenge, +20 XP, 9 min
  16. Chapter project: Character sheet Boss, +100 XP, 25 min

Math and operators

17 lessons, about 3 h 14 min

Do math in C#: operators, order of operations, division and remainder, casting, rounding and the Math methods. Learn what happens when a number overflows, and when to use float, double or decimal.

  1. Math with variables Demo, +25 XP, 7 min
  2. Updating a variable Challenge, +20 XP, 9 min
  3. Shortcut operators Challenge, +20 XP, 11 min
  4. Parentheses in formulas Challenge, +20 XP, 10 min
  5. Quiz: order of operations Quiz, +15 XP, 13 min
  6. Predict the output: integer division Predict, +15 XP, 12 min
  7. Uses for the remainder Challenge, +20 XP, 10 min
  8. Integer and decimal math Demo, +25 XP, 10 min
  9. Casting a double to an int Challenge, +20 XP, 10 min
  10. Rounding numbers Challenge, +20 XP, 10 min
  11. Math.Min and Math.Max Challenge, +20 XP, 10 min
  12. Percentages Challenge, +20 XP, 10 min
  13. Distance between two points Challenge, +20 XP, 10 min
  14. Overflow and wraparound Challenge, +20 XP, 12 min
  15. Spot the bug: unsigned subtraction Challenge, +20 XP, 11 min
  16. float, double and decimal Challenge, +20 XP, 13 min
  17. Chapter project: Combat round Boss, +100 XP, 26 min

Strings

12 lessons, about 2 h 24 min. Pro chapter

Names, dialogue, damage popups, quest cards and scoreboards are all text. Build it, format it and line it up.

  1. String interpolation Demo, +25 XP, 10 min
  2. Expressions inside {} Challenge, +20 XP, 10 min
  3. Predict the output: escape sequences Predict, +15 XP, 12 min
  4. Escapes and verbatim strings Challenge, +20 XP, 9 min
  5. String methods and Length Demo, +25 XP, 11 min
  6. Length, ToUpper and Trim Challenge, +20 XP, 9 min
  7. Replace, Contains and StartsWith Challenge, +20 XP, 11 min
  8. IndexOf and Substring Challenge, +20 XP, 11 min
  9. Formatting numbers Challenge, +20 XP, 10 min
  10. Lining up columns Challenge, +20 XP, 11 min
  11. Quiz: strings Quiz, +15 XP, 14 min
  12. Chapter project: Quest card Boss, +100 XP, 26 min

Decisions

14 lessons, about 3 h 8 min. Pro chapter

Make your game react: if, else, switch, comparisons and true or false logic.

  1. Running code with if Demo, +25 XP, 11 min
  2. Predict the output: comparisons Predict, +15 XP, 15 min
  3. if and else Challenge, +20 XP, 10 min
  4. else if chains Demo, +25 XP, 13 min
  5. Ranks and boundary values Challenge, +20 XP, 12 min
  6. Spot the bug: the unreachable branch Challenge, +20 XP, 15 min
  7. Nested if statements Challenge, +20 XP, 13 min
  8. Logical operators Challenge, +20 XP, 12 min
  9. Under the hood: how the computer decides Challenge, +20 XP, 13 min
  10. switch statements Challenge, +20 XP, 12 min
  11. Switch expressions and the ternary operator Challenge, +20 XP, 11 min
  12. Comparing strings Challenge, +20 XP, 10 min
  13. Quiz: reading conditions Quiz, +15 XP, 13 min
  14. Chapter project: Shop checkout Boss, +100 XP, 28 min

Loops

14 lessons, about 2 h 59 min. Pro chapter

Repeat work without repeating code: while, for, break and continue, waves and timers.

  1. while loops Demo, +25 XP, 11 min
  2. for loops Challenge, +20 XP, 11 min
  3. Predict the output: loop counts Predict, +15 XP, 16 min
  4. Using the loop counter Challenge, +20 XP, 10 min
  5. Loop variables and scope Demo, +25 XP, 12 min
  6. Running totals Challenge, +20 XP, 11 min
  7. Building a line with a loop Challenge, +20 XP, 11 min
  8. break and continue Challenge, +20 XP, 12 min
  9. do-while loops Challenge, +20 XP, 11 min
  10. Nested loops Challenge, +20 XP, 12 min
  11. Under the hood: counting steps Challenge, +20 XP, 11 min
  12. Spot the bug: the extra wave Challenge, +20 XP, 11 min
  13. Quiz: loops Quiz, +15 XP, 13 min
  14. Chapter project: Wave defense Boss, +100 XP, 27 min

Methods

14 lessons, about 3 h 4 min. Pro chapter

Package code into named actions you can reuse: parameters, return values and scope.

  1. Writing and calling a method Demo, +25 XP, 12 min
  2. Parameters and arguments Challenge, +20 XP, 10 min
  3. Return values Challenge, +20 XP, 12 min
  4. Math methods and overloads Demo, +25 XP, 12 min
  5. Methods that return bool Challenge, +20 XP, 11 min
  6. Predict the output: scope Predict, +15 XP, 14 min
  7. Predict the output: parameters are copies Predict, +15 XP, 14 min
  8. Default values and named arguments Challenge, +20 XP, 11 min
  9. Methods that call methods Challenge, +20 XP, 12 min
  10. Passing a Random into a method Challenge, +20 XP, 12 min
  11. Under the hood: the call stack Challenge, +20 XP, 13 min
  12. Spot the bug: the heal that does nothing Challenge, +20 XP, 10 min
  13. Quiz: methods Quiz, +15 XP, 14 min
  14. Chapter project: Combat calculator Boss, +100 XP, 27 min

Collections

14 lessons, about 3 h 3 min. Pro chapter

Hold many things at once: arrays, List and Dictionary for inventories, waves and lookups.

  1. Arrays Demo, +25 XP, 11 min
  2. Predict the output: array indexes Predict, +15 XP, 14 min
  3. Looping over an array Challenge, +20 XP, 12 min
  4. Finding the largest value Challenge, +20 XP, 11 min
  5. Lists Challenge, +20 XP, 11 min
  6. Removing and finding items Challenge, +20 XP, 12 min
  7. Spot the bug: removing while looping Challenge, +20 XP, 11 min
  8. Dictionaries Demo, +25 XP, 12 min
  9. Dictionary lookups Challenge, +20 XP, 12 min
  10. Under the hood: memory and lookup speed Challenge, +20 XP, 15 min
  11. Split and Join Challenge, +20 XP, 12 min
  12. Sorting Challenge, +20 XP, 10 min
  13. Quiz: collections Quiz, +15 XP, 13 min
  14. Chapter project: Inventory manager Boss, +100 XP, 27 min

Classes and objects

14 lessons, about 3 h 23 min. Pro chapter

Build your own types: fields, properties, constructors and methods for heroes and enemies.

  1. Defining a class Demo, +25 XP, 11 min
  2. Making several objects Challenge, +20 XP, 10 min
  3. Methods on objects Challenge, +20 XP, 11 min
  4. Constructors Challenge, +20 XP, 12 min
  5. Properties Demo, +25 XP, 13 min
  6. Encapsulation Challenge, +20 XP, 13 min
  7. Under the hood: references and null Challenge, +20 XP, 17 min
  8. Predict the output: objects Predict, +15 XP, 16 min
  9. Lists of objects Challenge, +20 XP, 16 min
  10. Spot the bug: every goblin took the hit Challenge, +20 XP, 13 min
  11. Static and instance Challenge, +20 XP, 12 min
  12. Printing objects with ToString Challenge, +20 XP, 15 min
  13. Quiz: classes and objects Quiz, +15 XP, 15 min
  14. Chapter project: Hero class Boss, +100 XP, 29 min

Inheritance and interfaces

14 lessons, about 3 h 31 min. Pro chapter

Share and swap behavior: enums, structs, inheritance and interfaces.

  1. Enums Demo, +25 XP, 12 min
  2. Switching on an enum Challenge, +20 XP, 13 min
  3. Predict the output: structs and classes Predict, +15 XP, 15 min
  4. Inheritance Demo, +25 XP, 13 min
  5. Derived classes and base Challenge, +20 XP, 13 min
  6. virtual and override Challenge, +20 XP, 14 min
  7. Under the hood: how the right method gets called Challenge, +20 XP, 15 min
  8. Spot the bug: the dragon that attacks like a goblin Challenge, +20 XP, 13 min
  9. Abstract classes Challenge, +20 XP, 11 min
  10. Interfaces Challenge, +20 XP, 13 min
  11. is, as and pattern matching Challenge, +20 XP, 16 min
  12. Quiz: inheritance or interface Quiz, +15 XP, 15 min
  13. Ready for Unity Challenge, +20 XP, 15 min
  14. Final project: Dungeon run Boss, +100 XP, 33 min

© 2026 Xero Media LLC. All rights reserved.