How to Make a Clicker Game with a Shop on the Phone | Clicker Game Part 2 | OctoStudio

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone it's Zenia here from octo studio and today I wanted to show you part two of how to make a clicker game on the phone so in this part I'll show you how to make the player be able to buy items from the shop and how to make those items give the player more points in the game so yeah let's get started so in the last part of this series we got to this point in our game where you can click an item for points and we designed what the shop looks like now let's make it so that the player can buy items from the shop and those items start giving the player automatic points as they click and play the game so to get started we have this spoon button in the shop and we want the player to be able to tap on this button to buy it so I'll go to the when to start category and drag out a when I tap block and when they tap on the spoon to buy it well we could have it play like a purchase sound so to do that I'll drag out a play sound block and attach it under there and so now when we tap on the spoon button it plays a sound also since the spoon costs 10 points we should take away 10 points from the player when they click on it to buy it so to do that I'll go to the more blocks category and I'll drag out a change variable block and I will say change variable score by -10 and so now when I tap on the spoon it charges me 10 points um now one problem with this is it still lets me buy a spoon even if I don't have enough points to buy it like right now I have zero Z points but I can still buy a spoon and I just go into debt so instead of having that let's make it so that the player can only buy a spoon if they have 10 points and since we want it to do something only if a certain thing is true we can go to the control category and drag out an if block and we can say if the score is greater than 10 then let the player buy the spoon and if the player doesn't have enough points how about we tap on this plus sign to add an else and can just have a speech bubble and say to the player not enough points to let them know they can't buy it yet so if I don't have enough points to buy it I tap on it and it just says not enough points and if I do have 10 points let's try that out so I get to 10 and then I tap on it and it still says not enough points and so why is that happening um and actually the problem is this thing is waiting for us to have more than 10 points but it's actually enough if we just have 10 points so instead of saying if score greater than 10 we could say if the score is greater than or equal to 10 so now I'll try to buy it and there we go now I can buy the spoon once I have 10 points so we're almost ready to go to the next step one thing I'm going to add really quickly before we do is I'm going to make this button be grayed out when the player can't buy it cuz I think that'll add a nice little decoration to the game and the way you can do that is if you go to the scene category and drag out a show block show 100% just makes a Sprite show up normally but if you drag out another show block and tap on this number 100 and then drag this slider you can make a Sprite look kind of grayed out or transparent so I'll pick something in the middle and then you know if I tap that then it makes the Sprite look faded so what I will do is I will say if the score is greater than or equal to 10 you know the cost of the spoon then you know show it normally otherwise show it grade out and if I put this inside a forever Loop and make it happen when the game starts now whenever I'm playing the game if I don't have enough points to buy the spoon it'll be all grayed out but then as soon as I get enough points to buy it it brightens up and it appears okay so we have step one where the player can buy as many spoons as they want uh but let's add step two where the spoon actually benefits the player once they bought it cuz right now the spoons don't do anything let's make it so that once the player buys a spoon they start getting automatic points every second so it's like once you buy more and more spoons you don't even have to click as much cuz you're just automatically getting points so how can we do that well let's make a new variable I'll go to the more blocks category and drag out a set variable block and I'll make a new variable and call it auto points and when the game starts we can have Auto points be zero like the player isn't getting any automatic points when they just start out they just have to click but when they buy a spoon we can make Auto points go up so how about when they buy a spoon we can change Auto points by one so let's try that out I can buy a spoon and now my auto points has gone up to one but if you'll notice I'm just leaving my game here and now my score should be going up by one every second but it's not I'm my score is still zero so how can we make it so that auto points gets added to the player score every second well how about this I'm going to go over to the cupcake and let's try and say Forever Wait 1 second and then change score by one so I'll try that out so now I am gaining a point every second but now one problem with this is let's say I buy another spoon now my auto points is two so I should be getting two points every second not just one so how about instead of forever changing this variable score by one we can change the variable score by whatever Auto points is at that moment so if Auto points is two I'll get two points every second if Auto points is five I'll get five points every second if you play for hours and hours and auto points is a th000 you'll get 1,000 points every second so let's try that out and to do that I can just go through the more blocks category and get this sort of oval-shaped variable block and I can choose Auto points as the variable and now if I just put this block in here now it will change the variable score by whatever Auto points is so well my score got really high uh I'll start a new game and so I will get a spoon so now Auto points is one I'm getting a free three point every second now if I buy another spoon Auto points is two and as you see I'm getting two points every second so that is how I want it also one thing to mention is if you want to make the game more challenging you can make the spoon only give the player a little bit more of Auto points so let's say one spoon only increases Auto points by 0.1 now you know you can buy a spoon but each spoon won't help you that much you know it's you still have to buy a lot of spoons to really be able to get a lot of Auto points and one last thing to mention as you go off making your games is if you want to add another item to the shop all you have to do is make another button like you made the spoon button decide what you want the cost to be and then everywhere where you said you know 10 for the spoon just replace that with the cost of this item so if it costs 100 then you want to replace all these 10 with 100 and this is this should be netive 100 and also you want 100 here and then you just have to decide how much you want to increase Auto points by when the player buise this item so I'll have this coffee cup increase Auto points by 1.2 so that's all you have to do to add another item to the shop so yeah that's what I wanted to show you today uh I hope you have fun making your own clicker Gams and yeah I'll see you in the next video [Music]
Info
Channel: OctoStudio
Views: 22
Rating: undefined out of 5
Keywords:
Id: GN-8XudLq0I
Channel Id: undefined
Length: 7min 28sec (448 seconds)
Published: Fri Jul 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.