
Mastermind 2D in Unity teaches you to build interactive buttons, scene loading, timers, scoring, and animations while implementing game mechanics, modes, and win loss feedback.
Learn the Unity setup for a 2D Mastermind game, focusing on console visibility, arranging scene and game views, organizing project folders, and configuring the canvas with resolutions and aspect ratios.
Set up a 2D mastermind pearl in Unity by importing textures, converting to sprites, using the sprite editor, and composing a pearl with a glass overlay inside a canvas.
Create a 2D drag system in Unity using begin, drag, and end handlers on pearls in a Canvas; store position, move with the pointer, and snap back on release.
Scale the canvas with screen size to fit pills and slots in the play field. Organize UI with a spacer, vertical layout group, and grid layout group for 80x80 slots.
Update the playfield by resizing pills and slots to fit a tighter grid and adjust solution box. Tweak the play background and vertical layer group to support the drop-to-slots mechanic.
Implement a drag-and-drop 2D system in Unity, using four slots, snap pearls to slots, and instantiate new pearls on drop for seamless gameplay.
Learn to organize and instantiate color pearls with a prefab system in Unity Mastermind 2D, assign unique IDs, and build a dragging box for comparisons with a solution box.
Build a solution box with a grid layout of five 90x90 slots and a spacer, enabling image slots and a script to generate a riddle by code.
Pick random pearls from an array, place them into the solution box slots, store their IDs in a separate list, and initialize a cgi script named riddle maker.
Create a riddle function that uses a for loop to iterate the pool, randomly pick items, instantiate them, parent to slots, and disable dragging on placed pills in 2d Unity.
Organize pearl pools using a grid layout group or horizontal layout with 80x80 cells and spacing. Drag pearls into the solution box and ensure proper anchoring and prefab updates.
Create a semi-transparent protector overlay to block dragging pills into slots, activated or deactivated to guide placement, and implement a dragging box on the holder to manage pills.
Attach the dragging box script to the holder, connect the protector, and initialize IDs, the check button, and the riddle 2D and hint boxes for gameplay.
Create a mastermind hint box in Unity using a grid layout with four pills inside a holder, plus a check button and hidden box for feedback.
Finalize the dragging box system by wiring the holder and slots, reading data from drops, populating pill IDs, and enabling the check button only when all four pills are placed.
Set up and wire drag-and-drop for mastermind 2d by assigning slot IDs, retrieving dragged item data, and enabling the check button only when all slots have nonzero IDs.
Implement a black hint check for mastermind 2d by comparing guess ids to riddle ids, tracking exact matches, and returning black and white hint counts to the dragging box.
Instantiate black pearls when hint equals two and white pearls when hint equals one in the hint boxes; use the create hint box function to pass the number.
Create and validate white pearl hints in a mastermind 2d game by implementing crosswise checks against black pearls, updating riddle state, and handling win conditions.
Build a game manager to control tries and timing, activate or deactivate protectors on dragging boxes, and update possible moves and input flow in Unity Mastermind 2D.
Reverse the try list to start at the bottom, then increment the current turn within the max turn. Update tries through the game manager and detect loss when exhausted.
Mastermind 2D teaches implementing basic win and lose conditions in Unity, including debugging, restart options, overlays, scoring, and communicating outcomes to players.
Mastermind 2D Unity lecture on win and lose protection explains updating the current turn, deactivating the current slot, and preventing invalid moves across debug and normal modes.
Mastermind 2D: show and hide the solution box with a multi-image sprite editor. Create open and idle animations and trigger with the animator to reveal the solution.
Trigger the solution box animation via code using the animator component, opening on win or lose, with a game manager check for remaining turns to control the open trigger.
Create a full-screen win/lose panel overlay in Unity 2d, darkening the playfield with a canvas image, showing win/lose text, turns taken, and time, plus retry and back to menu buttons.
Connect the wind panel's text fields and buttons to a win lose handler and game manager, updating turns taken, time taken, and score in real time.
Connect the game manager to a win/lose handler and update the win panel text with current turn and score on win or loss. Activate or deactivate the panel accordingly.
Learn to build a Unity 2D mastermind timer with a coroutine that increments play time every second, formats it as mm:ss, and updates a UI text in real time.
Wire on-click buttons in Unity to a windows handler, enabling a try again function that reloads the current scene and a back to menu function that loads a scene.
Explore calculating the score in a Unity mastermind 2D game by accounting for turns, play time, and a max ten thousand, via a function returning an int score.
Create a Unity 2D game menu by wiring an on-click play button to a menu handler script that loads scenes with scene management, and ensure scenes are in build settings.
Create a harder mastermind 2D mode by duplicating the scene, increasing pills from four to five, and updating the solution box, drag handling, and riddle data to support five slots.
Design an impossible mastermind mode with six pearls, six slots, a solution box, and a check button in a new scene, keeping the timer and responsive UI layout.
Remove all debug lines and clear the console, eliminate warnings, and thoroughly test the game across modes; show a help screen and current turn details for clarity.
Learn how to design a multi-mode menu in Unity Mastermind 2D by duplicating buttons, labeling normal, hard, very hard, and impossible modes, and wiring them to load corresponding scenes.
Adjust the height image animation by extending its anchor position so the high damage effect remains fully visible, reusing that position for related hider animations and ensuring proper scaling.
Conclude the complete series by inviting feedback and summarizing key learnings, then encourage publishing the game after optimizing timers, drag-and-snap pools, hints, and scoring.
In this Unity course you will learn how to create you own Mastermind Game in Unity Engine. You will learn how to write your own Scripts in C#.
Motivation
If you are struggling to finish your first game, i will lead you through the process of game creation. You will save a lot time, since i show you everything you need to create your own Mastermind Game.
If you are new to game creation i will show you how to structure, and work clean in your maybe first game, which you can show to anyone or even let other people play it.
About the Game
If you never heard about Mastermind, it is a combination puzzle game, where the player have to find a random "code" picked by the computer. They have 10 turns to find out the correct combination. They get hints with black and White pearls which showing up.
Black Pearl mean, correct pearl on correct position.
White Peal means, correct pearl on wrong positon.
But they don't know which is meant, so they have to find out that on their own as well.
Graphics
will not be covered to much
are available in the corresponding lessons to have material to work with
Design is totally up to you, you can even use your own Graphics
Unity
you will learn about the Inspector
how the Canvas System works
how to set up GameObjects
how to create Prefabs and what they are
C# (Monodevelop)
you'll learn about private and public Variables
you'll learn about List's and Array's
you'll learn about for-loops and nested for-loops
you'll learn how to create your own functions and neccesary arguments
you'll learn about Interfaces for Drag and Drop 2D Objects
you'll learn about if-conditions and expressions
Conclusion
In the end of this course you will have a fully functional Mastermind Game in 2D which you can (after you have created nice Menus, Buttons, and maybe additional content) upload to any Gaming Website, Google Playstore, Apple Store or even Windows Store or Steam.
Let's make your dream game a reality!!
Level: Beginner
Video Course Length: ~5.5 hours
Unity Version required: 4.6+