Scratch | Cat Clicker Game Tutorial (Ep1)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone and welcome to a new series on how to make a clicker game but not any clicker game a cat clicker game in this game you have a hat and a mouse and you click the cat and when you click the cat your score will increase as you can see it's very nice and polished very satisfying to click it has lots of movement and the reason you want score is there's a shop with tons of upgrades and i can use my mouse to scroll through these so i can buy these lazy mails which will increase my cash per second by 0.1 as you can see it displays my cash per second and oh there's a golden cat that spawns and that gives me a boost of score so now i can buy some of these that'll increase my cash per click and now i'm making 1.2 per click there's even accessories that you can buy they will give you helpful perks for instance this crown will give you a chance every time you click to double it as you can see i made three right there but before we get into the video don't forget to drop a like and consider subscribing and while you're down there leave a comment i love reading through your comments but anyway let's get right into the video really quick no i'm sitting here editing this video and you may notice that i have a sprite called score well you don't actually need that because i was going to make the score counter in this video but i ended up not having time so don't worry about that sprite so you need a sprite called click or whatever you want to call it and this is going to be the main thing that you click in my case it's a cute cat within this you're going to want secondary click which is just like a squash you don't have to do this but it just really polishes this game off and then one called particle which is just the particle that will spawn when you click it in my case it's just a little heart next i have one called plus one and this is when you click the cat it'll show you how much score you have you're going to want to make red so that way you can change it to any color and anything so i have one two three four five six seven eight nine and then after that is zero then i have one called plus and it's plus one called period or dot and then one dot and then one blank make sure whatever number they are you name it so if it's a plus then name the costume plus then i have a sprite called background or just bg for short and it is pretty self-explanatory it's just a background that looks like this now i have two costumes that are kind of hard to see without a background and they're just called shine so if we make a background they are literally just shine so that is shine1 and then shine2 is exactly the same start by hiding all of these sprites except the click and the background sprite this will make it a lot easier to work with now go ahead and click onto the background sprite and let's do some coding so first of all pull out a win green if i clicked a go to zero zero and a create clone of myself then when i started the clone go to 0 0 and change the x to 400. next let's do a when i receive do new message and name this update like so now i want to go to back layer and let's make a new block go ahead and name this scroll and then do two slashes and do speed with a colon then add an input and do speed then add a text label and do limit with a colon and an input called limit and it should look something like this and you can go ahead and click run screen without refresh so now when you pull this out you can see that it's nice and organized so let's just set the speed to negative 0.5 and you can change these values and the limit to negative 400 you probably don't want to change that one now we're going to change the x by speed to an if x position is less than limit then set the x position to x position times negative 1. that's just going to make it to where if it goes all the way to the left it's just going to teleport back now we need to make the update forever broadcast so click onto the backdrops and do when green flag clicked forever broadcast update so now as you can see background will infinitely scroll and if we go ahead and change the scroll speed to like negative 5 as you can see no matter how far it goes it'll always start over again change that scroll speed back to negative 0.5 and now let's make it kind of turn a little bit just so it looks good so let's do point in direction 90 degrees abs of and change this to the cosine then do cosine of blank times blank then put this in another times like this then put this in a plus so we're going to do plus 90 and this times is going to be 1.1 then 200 and then timer so this is just going to make it wiggle back and forth so if we go ahead and put that in there as you can see the background kind of just wiggles back and forth a little bit and that looks really good so now that we have the background polished let's go ahead and start working on the click let's do a win green flag clicked forever loop now let's go ahead and make a brand new block and nameless click now do slash slash and do can click with a colon and then add a boolean input and name this can click now click ok next we're going to put that right underneath there and do forever can click like that and in this can click we're going to do mouse down and distance to mouse pointer is less than 60. so basically what this is saying is if our mouse is down and we're close to the cat then we can go ahead and click and that's what this can click is it just makes it a little neater so inside of this let's do if can click then we're going to go ahead and make a new block and name this give cats and this is not going to be run skin without refresh so now let's go ahead and put that over here and we're going to just do give cats inside of there now we need a few variables so let's make a variable called total cats like so and you can just do parentheses t c the reason we're going to do this is all these score related variables are going to have this abbreviation so that just makes it easier to find and that's going to be for all sprites so that's kind of going to be the main score so now we can make a new block and name this reset in the very beginning run screen without refresh put it over here and then do reset right there now in the reset we can set the total cast to zero and then in here we can change the total cats by one right now you may be wondering why do we have so many different custom blocks later down the road all these blocks will be filled up all the way to the bottom just because of how much content there is in this game so right now it may seem unnecessary but trust me you're gonna want to prepare you're gonna want it here for later so now if we go ahead and show the total catch as you can see when we click it well it kind of goes really fast so we need to add a limit so let's go ahead and make another block and name this click effects like so then click ok so now let's put this over here and put click effects right underneath this give cat so it's going to run this every time we click we're going to change size by 25 then we're going to create clone of myself switch costume to click to wait until mouse is not down and then switch costume back to click one so now if we click as you can see it's going to look really weird and it's going to get bigger and bigger and that's because we don't really have it resetting correctly yet so in this reset make sure you switch costume back to click like so now let's go ahead and make another block and name this effects and then do slash slash x position add an input and name this x then add a label and do y pause colon and then input and do y and then do a label and do direction like so and an input and do just dir like so so now we have this nice effects and this is going to keep track of all the sizing and everything if else and then duplicate this distance to mouse pointer right here and if it is then we're going to change size by size minus so let's do 100 right here minus size divided by three and we're going to go ahead and change this to 110 otherwise we're going to change size by 90 minus size divided by 6. now let's go ahead and make a new forever loop right here and put the effects in here so now as you can see instantaneously this feels a lot better because when we click it goes to the right size for now let's just do a when i start as a clone and then a delete this clone right there so that way it doesn't bother us for now then go into the background and pull in this script right here into the player and put that in the x go to x and then do cosine of timer times 200 then times five like that put this plus over there and do the y like so so now as you can see this cat will flow up and down and let's just put zero zero in the x position and the reason why this is so handy is if we put like 35 as you can see the cat goes up there and now direction let's do 90 pull in that same exact script we used and we can even just do the point injection all we need to do is move this plus over here in direction plus cosine of timer times 300 then times five and once again you can change all these values but for what i found i really like these so once again if you want this direction to be zero as you can see you just change it to zero and boom it is what you want so now as you can see this cat is looking a lot more polished okay so now let's do when i start as a clone go to mouse pointer then set size to pick random 15 to 25 now switch costume to particle point and direction pick random 75 to 105 then we're going to make a new variable for this sprite only and nameless clone vel like so or velocity i just do that for sure then we're going to set that to i in the very beginning and if else and pick random one to two is equal to one so that way it's random every time we're going to repeat 100 times quite a bit here change y by the loan velocity turn the clone velocity degrees clockwise move three steps and change the clone velocity by negative 0.8 then go to front layer so it's in front of everything then at the very end delete this clone right underneath the repeat now duplicate all that and we're going to turn load velocity counterclockwise and then we're going to move negative three steps in this else so now you should see that when we click we have some nice polish but you may notice that these clones are kind of just sticking on to the bottom and that does not look very good and it's not good for performance either duplicate this when i start as a clone set the ghost effect to zero wait 0.1 seconds so that way it gives it some time then repeat 20 times change the ghost effect by 5 and then we can delete this clone so now you should see that these actually go away after a bit so when we click the hearts fade away and they will either go to the right or to the left so now this is super satisfying to click this cat let's add some more polish by making these shines now these are super simple click on the shine and do when green fly clicked point in direction negative 165 then when i receive update go to the click set size to 65 percent set ghost effect to 60 percent and turn 0.5 degrees clockwise now go ahead and pull all this programming into the shine 2 and we're just going to make it point injection 0 in the beginning and then set the ghost effect to 70 and turn one degree and now just go ahead and click on the show button for all of these and now as you can see look how much more polished this looks it just feels super satisfying to click so now let's go ahead and show the total cats up top here for a temporary score counter so as you can see when we click we get some score now let's make it to where you can actually see how much score you get when you click using this plus one sprite go into the plus one sprite and make a new block name this reset this is going to be run screen without refresh now when green flag clicked reset in this reset let's do go to front layer and make a new variable for the sprite only and do plus one y v like so and then another for the sprite only and you can just do plus one x and then another one plus one y we're going to go ahead and set the plus one y velocity to zero set the plus one x to mouse x plus pick random negative five to five and then set the plus y to mouse y plus 40. so this is just going to set the x position up now let's go ahead and make a new variable and name this this little number sign make sure it's for the sprite only and we're going to make a brand new block now this is the exact same number counter i used in my awesome number counter video if you haven't seen that then make sure to go check it out make this block called clone costume then slash costume colon input costume label exposition colon then the input exposition label y position with a colon of course then the input y position then the label line base colon copy that and then input line space so now we have a huge thing to use now let's go ahead and do broadcast delete clones one and then we're going to do when i receive delete clones one we're going to just delete this clone next we're going to go ahead and set that number to 1 repeat the length of costume switch costume to letter that little number digit of a costume create clone of myself change x by psi times the line space change that number digit by one and go to front then we're going to hide and that is it for now so you shouldn't see anything different but if we go ahead and pull out a clone costume and put this in a forever loop do zero zero then zero in the costume just to like whatever number you want and then the line space 0.25 and oh wait hang on also do when i start as a clone show and then go to front and in the very beginning i forgot one right under here just do x position and y position so now if we do this in a forever loop you can actually see it printing out the right letters but we just need to do run screen without refresh and this number counter is working perfectly go into the click go ahead and make a new broadcast and name this click and put this right underneath this give cats and now when i receive click in the plus one we need to make a new variable real quick for the sprite only and name this clone that way we can detect if it's a clone or a sprite so right here in the end let's set this clone to n for no and when i start as a clone set that clone to y for yes and then duplicate this no and put that in the reset like so now in the click we're going to do if clone is equal to no so that way you can't be a clone you have to be the sprite to do this then we're going to reset so it goes back wait a little bit so let's do 0.01 seconds then we are going to make a new block and name this look and do slash slash color colon then input color text label rightness colon then an input brightness text label size colon and then input size and we're going to do run screen without refresh so this is like the style of it in this block let's do clear graphics effects set color effect to color set brightness effect to brightness and then set the size to size now up here we're going to do a look color all of that and do 0 for the color and then 100 for the brightness so this is going to be white and then 50 for the size now we're going to repeat 10 times and do a clone costume right here and do costume plus 1 like so and then we're going to do x position plus 1 x and we're going to do plus one y plus plus one y v so that's a mouthful but then line space is zero point twenty then underneath here we're going to change the plus one y by two and we're going to change ghost effect by 15. then the bottom we're going to set that plus one yv to zero now if we click as you can see it's not working and that's because i'm not very smart and i did if clone equals no we want if clone equals n because that is what we use we use y and n and now when we click it actually makes a plus and that is very awesome and it can be any number so if we go ahead and change this right here to plus whatever that is as you can see boom it gives us that number i'm not entirely sure what i was thinking here we don't actually need this yv so just do a y position plus 1 y and change that y right here by two and set the y to zero and then right here go ahead and take out the y v and delete the y so now as you can see it works the exact same but without that yv variable i'm not entirely sure why i wanted to make that so now we have a good basis for a clicker we have the main clicking down if we show the total cats as you can see we get some score eventually we'll put a score counter here but for this episode i don't want to get too long and i think it's good looking so thank you all so much for watching i do hope you enjoyed the very first episode in how to make a cat clicker if you did then make sure to drop a like and consider subscribing but anyways this has been owen and i am out you
Info
Channel: ShiftClickLearn
Views: 44,199
Rating: undefined out of 5
Keywords: clicker game scratch, scratch clicker game, scratch clicker game tutorial, how to make a clicker game, how to make a clicker game in scratch, clicker game scratch tutorial, make a clicker game scratch, clicker game tutorial, clicker game, scratch cat clicker, scratch cat game, scratch, scratch tutorial, shiftclicklearn, shift click learn
Id: VQR_XvE-WWY
Channel Id: undefined
Length: 18min 41sec (1121 seconds)
Published: Tue May 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.