We are going to tell you something about the game we created using matlab. Basically, we choose slot machine game. We used the concept from the working principles of slot machines and used that into the matlab, and hopefully we were able to create a slot machine game using matlab. The objectives to create a game were to use the gui feature matlab to make the game more interactive and more realistic, and we ended up pretty well using the effective gui codes in it for the instructions. Those who already know about this game. They can just directly play this game using the play button and can enjoy the game.for, those who have not heard of this game for them, the instructions are like.
There are 9 cells. If you hit play button, those cells will be fill with same or different images. If you get same pictures in a straight line row or in straight column or diagonal wise, then you will get the credits according to the pay table, and here is the pay table. Whenever you get sevens in straight row or straight column or straight diagonal, you will get 120 credits. Similarly, for watermelon it gives 80 credits and likewise for strawberry, you will get 60 credits and for an apple you will get 40 credits and the least amount of credit. You will get is for banana, and that is, you will only get 20 credits for bananas, and this is how the actual game looks like.
As i mentioned earlier, there are 9 cells with different or same images and at far right corner. There is restart button and the main function of this button is to restart the game from the very beginning and just below the restart button. There is a play button and whenever you press button it will just spin all the images in these cells and just below that there is something written as credit 100. That means that you will be initially provided with 100 credits just to play the game, as i already mentioned, that you will be provided with 100 credits to play the game, these game will take 20 credits for each play.
If you keep on winning real money casino Canada, then credits will be added to your total credits and if you keep on losing credit will be subtracted from your total credits. And, finally, you will end up at 0 credits and whenever you are at zero, a certain menu will pop up. If you want to continue or if you want to quiet the game, if you want to quiet the game, press no button, and if you want to continue, then you can restart the game again and again. So the pass code of this game for programming students is machine. So lets talk about the code, so the base of the game is gui. We started this game making this gui layout.
It has one big axes at the background and it has 3 panels and each panels have 3 axes on it, and it also has 2 buttons one restart button and one play button, and it has two static text boxes. One is for credit and another is for scoreboard, so i had typed this title as 100, so it automatically look like 100 credits like initial credits, so we dont have to put code to make it 100. So this is our main code and we invested 4 to 5 days to create this code. We created this code with the help from our friend Mustafa thanks to mustafa, who helped us creating this code, creates random images in each axes and imshow feature right here helps to display those pictures in axes talking about other code. Other codes include pulling background image for which we used imshow feature and, moreover, for random images. We assigned each axes with variable n1, n2 and n3, and so on in matlab.
Everything goes from column to column, so we assigned n1 to first axes n2 to second axes. In a column and n3 to third axis in a column and so on, so when n1 = n2 = n3, then the whole column gets matched and it pays depending upon the pay table like. If you get all the sevens in this first column, then you hit 120 credits and if you get all sevens in this all axes, i mean on all 9 cells the you will get 920 credits, so that is the jackpot. So lets talk about the problems talking about problems. First problem was creating random images and, with the help of our friend mustafa, we were able to create our first code, even with the help of mustafa.
It was not quickly created, as it was expected, so it took a lot of our time and at some point we were so frustrated that we were about to give up, but we dint gave up. We worked hard for this code and our problem was making those cells look like spinning on each axes to make this we use for and end feature.like. We use for i 1 to 5 and end feature to create those axes. Random images running five times on each cell, which looks like spinning. Basically it not spinning, it is just changing image, five time on each cells, so it looks like spinning which creates the feeling of real slot. Machines.It also took much of our time, but the code was easy.
This shows that using simple logic is more important than thinking difficult code or using the hard code. So talking about future developments, we may modify this game which will be accessible using credit card. So user have to swipe credit card to play the game and it takes off real money from his bank account and if he wins big money, then that money will go back to his bank account and we will also create options on this game.
Like bet options like the picture shown in our right, so there will be different bet: options like 20 credits, bet, 50 credits, bet, 100 credits bet and so on, and you will win depending on your bet like. If you bet high, then you will win big, so lets take a demo of our game. So to start the game, you should go to slot machine folder and there is a runme file right here. So you have to double click this file and you have to run this file. So here is our game.
So initially you have 100 credits and for each play it will deduce 20 credits. So lets do our first play, so we got matched up with 3 bananas in 3 row, so it was supposed to have 80 credits, but due to these 3 bananas we get 20 credits so its even now with the 100 credits. So you better play this game with sound, because we have put one sound on this game, so you will feel like playing the real slot machine and you will really enjoy this game. So lets do our second play. So we got nothing. So we have 0 credits and when it goes to zero, it will pop up one box asking if you want to play again or no.