In this series, we will develop a memory puzzle game for iOS using Xamarin and C#. During the process, we will try to use as much as possible of the structures and development procedure of C# as opposed to Objective-C or swift.
Xamarin is a mobile app development and code translator for developing iOS, Android, Windows Phone and Mac applications. Its C# interface allows for many developers to be able to develop their applications for various interfaces. In this tutorial however, we will learn developing iOS Native apps as opposed to a Xamarin forms app.This course is essentially a beginner course and is most appropriate if you wish to begin developing iOS apps in Xamarin and C#, or if you already know a programming language and are planning to jump into Xamarin. This development should be a lot of fun and in general should take around 4 hours to complete.
I have also included all the assets as well as my own working project at the end of each lesson. Please let me know if you ran into any issues and I will try and help you.
In this video, we will explore the various aspects of this development. We will learn about the goals of this development and will also have an overview of the entire project.
In this lesson, we will do a quick review of the application, how is it being played and what programming interface and IDE is used to develop it. By the end of it, you should have an understanding of the following:
a) we need a system to make a grid of blocks of image
b) we need a way to randomize these blocks
c) we need a system to detect the touch that lands on the blocks
d) we need a way to understand whether this is the first time we are touching a block or the 2nd time
e) and finally we need a system to compare the two blocks we just touched.
f) there is also the need for some buttons and a timer
In this lesson, we will make a new iOS solution in Xamarin and add the accompanying assets to our new solution. It’s a good idea to go through the assets once so you understand what we have in our hands. In here, we will also load our image assets into an array and prepare them to be used in the Image View blocks.
In this lesson, we will design our first interface. This will include a UIView, a UILabel and two UIButtons.
In this lesson, we will write our next function that will deliver the blocks of images. We will have two For Loops to produce the array of Image Views as well as an Array of Coordinates that will later be used for randomization. Each time a block is made, we will add an image from our images array to it.
In this next lesson, we will write a code to randomly re-arrange the blocks in our game.
In this lesson, we will use a built in function of UIView to trigger the touch events and animate the flipping effect of the blocks upon the touch.
In this lesson, we continue with our touch function and amend it to understand the order in which the touch has landed.
In this lesson, we will write the code for our comparison action. In here, only if this is the 2nd touch that has landed, we will compare the two blocks and if they are similar, we will remove them from our game background.
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.