High and I'll come back.
So for me I've managed to have a functioning game that plays properly the way we expect it in only one
mode.
That is a four by four and we can play and everything is the baby we're hoping is going to be.
Now in this lesson we have to deal with this but we have to add new function that is to a game that
we can play it in four by four six five six seven eight by eight months.
So let's go ahead and see how I'm going to do that.
If you remember.
You know what we already have a function called Game Mode which is somebody here.
This one you control the game mode which is already connected to an outlet up here which is a segment
that's controlled.
So the first thing after do I have to get that I'm going to say if let my save the city or is a sender
as you guys segmented the control.
Then I want to do the stuff in here I want to find out which of these is selected.
So I want to go ahead and say let's index becomes my sake.
The select segment index.
So if you have stopped on something that is of the type you segment it's control.
I want to find out which one of them you have clicked on or which one of them is currently selected.
If you found that index I may call it index.
So it makes more sense now when I say let's switch index and let it autocomplete is better.
Which it doesn't.
For me it's OK.
So I'm going to say switch index I'm the switch of index.
I want to do these things.
I want to say case 0 then game mode.
It has to become four in case.
This was one then obviously game mode has two becomes six.
And in case this was two then game mode has to become eight high the default mode.
I don't want to do anything.
I just want a break and that's all we have to do for our game mode function.
What it does is let me see if I can reformat this a little bit better.
What it does is they get a segmented console.
It finds out which one of these three indexes are selected.
If it is zero sets the game to four if it is one sets the game to six if it is two sets the game more
to eight.
And now our game mode has a new value but it doesn't really do anything unless we do this and then had
to reset or as an alternative I could say well if you get this part then reset the game anyway.
Reset action.
And now it sets a new game mode and resets the game on the fly as someone taps on any of these three
buttons.
Let's go ahead and see how that's going to play.
I'm going to run the application and now I should be able to tap on any of those three and get a new
interface for my 4 6 by 6 8 by 8 which I dare to you trying to solve it.
SEVENZO hand one is obviously rather difficult six by six might be a little bit easier.
16 and 12 and 17 and 9 and 14 and I couldn't get even one of them even on a 6 by 6.
I think the most playable one is actually just four by four at least for someone I'm not all that bright
when it comes to these things.
So for like 4 6 6 8 8 and that's all we have to do in this lesson we now have a fully functioning game
that counts that time.
You can play it in different moods every time that you reset everything resets properly.
No two trials can be selected at the same time.
Different modes they provide different levels of complexity and everything up until this point is based
on text values that are numeric 4 and 6 or if you want to do will actually put words in the sky in a
sky and rain and rain or anything that you want to think of.
The next thing we have to do and that's what's coming up in the next lesson is how we can change these
to become images and not just text.
So bear with me and we'll go to our next lesson.