Xamarin Tutorial iOS Memory Game

Home / Courses / Xamarin Tutorial iOS Memory Game

Xamarin Tutorial iOS Memory Game

In this tutorial, we will develop a simple Xamarin Tutorial iOS Memory Game using Xamarin and C#. During the process, we will the structures and development procedure of C# as opposed to Objective-C or swift. I hope you enjoy it. It should give you a round understanding of what you could do with C# and Xamarin.

Xamarin Tutorial iOS Memory Game – 1 – Understanding the App

In this lesson, we will do a quick review of the application. We will study 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

Xamarin Tutorial iOS Memory Game – 2 – Adding the Assets

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.

Xamarin Tutorial iOS Memory Game – 3 – Adding the Game Interface Elements

In this lesson, we will design our first interface. This will include a UIView, a UILabel and two UIButtons.

Xamarin Tutorial iOS Memory Game – 4 – Making the Grid of Blocks

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.

Xamarin Tutorial iOS Memory Game – 5 – Randomizing our Blocks

In this next lesson, we will write a code to randomly re-arrange the blocks in our game.

Xamarin Tutorial iOS Memory Game – 6 – Adding the Reset

In this lesson, we will write the code to flip the blocks so that they are not shown to user at the beginning of the game.

Xamarin Tutorial iOS Memory Game – 7 – Touch to Flip

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.

Xamarin Tutorial iOS Memory Game – 8 – Understanding the Order of the Touch

In this lesson, we continue with our touch function and amend it to understand the order in which the touch has landed.

Xamarin Tutorial iOS Memory Game – 9 – Compare Action

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.

Xamarin Tutorial iOS Memory Game – 10 – Adding Timer Action

In this lesson, we add an action that is scheduled to run every time the game restarts and will start counting up time.

Xamarin Tutorial iOS Memory Game – 11 – Adding the Buttons Action

In this lesson, we will add the action for the buttons to restart the game.

Xamarin Tutorial iOS Memory Game – 12 – Summary

In here, we do a quick re-cap of everything that was done to make sure you understand every aspect of the development properly.

The following two tabs change content below.

Amir J

Senior Instructor at Cinard.ca
Amir is our senior instructor here at Cinard. He comes to us with years of teaching experience in Dubai and online. His background is in computer animation and programing for 3d imagery. He has a MED in Higher Education, a MA in Digital Media and a BA in Digital Animation.

Latest posts by Amir J (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *