In this course we will cover the development of an iOS sliding puzzle game using Xamarin and C#.
This course is best suited for beginner programmers or mobile developers planning to move on to Xamarin and cross platform development.
Throughout the course, we will cover a wide range of topics such as interface design in Xamarin, dynamic outlet creation, game logic and user interactions. I have included all of the assets that we use in this series and also I make my own project available to you at the end of each lesson.
This course is meant to act as an introductory Xamarin C# learning experience. By the end of the course, you should be able to develop a variety of interfaces and games logic and you should have gained an intermediate understanding of various methods for handling touch events. This should take you no longer tan 4 hours in total and I guess you should be able to finish it in one afternoon.
I should mention that while this course is a beginner level, it does NOT cover matters such as basic programming concepts. It assumes you have some familiarity with the basics of a programming language. If you wish to start with this course and don't have any programming background, you should prepare yourself to spend a little longer to understand and follow through the lessons.
I wish you the best throughout your development and if you had any issues, please drop me a line.
In this lesson, we will do a quick review of the what the app entails, the interface to develop and compile the app as well as the programming language used. By the end of this lesson, you should have an overall understanding of the following components:
a) the assets that are used in this project
b) a grid making system where the pieces of the text labels are placed on different seizes of grids
c) a randomization system where the blocks of the text labels are randomized on the background.
d) an empty block finder strategy where the adjacent blocks can move to.
e) a touch detection system
f) a timer system and a reset button
In this first coding lesson, we will cover how to build a new UIView, a Button and a Label for our time.
In this lesson, we will discuss how to understand the size of our screen and how to adjust the X, Y, width and height of our different outlets.
In this lesson, we will apply the appropriate constraints to our outlets to make sure they simulate similarly on all different devices.
In this lesson, we will do a quick overview of how our tiles are actually located in our UIView.
In this lesson, we will write the code for developing the UILabels that will work as the tiles of our game and place them on the game view.
In this lesson, we will write the arrays to appropriately store the tiles and their location in the view.
In this lesson, we will remove one title from our view to make sure the game is actually playable. This will make sure that there is at least one empty spot at the beginning of the game.
In this lesson, we will randomize the grid of the tiles.
In this lesson, we make a new CGPoint that will hold on to the empty spot.
In this lesson, we will work on our rest method. It will restart the game with new randomized state.
In this lesson, we will add our timer function to our reset method.
In this lesson, we will write the TouchesEnded function that will detect the landed touches. In here we will learn how to find out what outlet the touch has landed on.
We will then analyze the view where the touch has landed on and decide whether the tile can move or not.
In this lesson, we will write the code to animate the tile that the touch has landed on.
I am currently Senior Instructor at Cinard. Before taking up this job and moving to beautiful Vancouver, for over a decade I was senior lecturer of apps / games programming in various colleges and universities.
I work primarily in native iOS and Android apps and Video games in Unity3D.
Cinard is a Digital Media Art & Technology Institute.