Scratch Clones and Local Variables Tutorial

  Рет қаралды 76,518

Surfing Scratcher

Surfing Scratcher

Күн бұрын

Пікірлер: 177
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
SCRATCHY QUESTION: What is one reason why you might use local variables with clones?
@kastmepoiss135
@kastmepoiss135 4 жыл бұрын
i'm creating a project where you need to detect clones by the actions, imma use that localID for in-script detection
@tonypatino1765
@tonypatino1765 4 жыл бұрын
For commonly used variables like "i" ;D
@richardlow2947
@richardlow2947 4 жыл бұрын
I am trying to make electric field arrows do different things (depending on their distance and direction from charges)
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
@Spectral Penguin Check out my video on health bars: kzbin.info/www/bejne/nJ6cgn1vrtBkoNk You should be able to use a local variable for the 'life' of each enemy. You could also clone the healthbar and peg it to the position of your clones, but you'll probs need to store xy locations in a list to help you out. A big task, but doable!
@joshuachan6317
@joshuachan6317 4 жыл бұрын
For making the multiple enemy as a clone with its local variable store as it’s health. So your tutorial really helps me out a lot! Thx bro
@CatsAreAwesome146
@CatsAreAwesome146 7 ай бұрын
Yo thanks! This tutorial didn't just teach me how to do a specific thing it actually made me understand the concept. I never knew that local variables actually did that for clones as, and the fact that you explained the fact that it will say 1,2,4,8 and stopped that pitfall was a huge help. Using this tutorial I was able to make something almost entirely different than the showcased example, and thats a testament to how good a job it does teaching fundamentals!
@chetanys6920
@chetanys6920 3 жыл бұрын
i was making a space shooting game and the clone of the laser i had made had a variable named health and wanted to decrease the number of the variable when the clone of the laser touched that sprite and this helped me a lot in that game, thanks for the video.
@influxxmedia
@influxxmedia 3 жыл бұрын
FANTASTIC! Exactly the answer I was looking for. I'm creating a bubble particle system, where a bubble sprite is cloned, then each clone floats up at random speed until they reach a certain point when they pop. At this point I wanted to delete the clone and reset, having a new clone respawn and begin its cycle again. Each time the respawned clone ended up duplicating all 15 bubbles in the system. Agh. This global/local var technique will help me fix that. Awesome, thanks! Hope you caught that wave. Cheers dude.
@mrg4melover
@mrg4melover 4 жыл бұрын
I’m working on an Undertale-inspired game with blasters (multiple may be on screen at once, so the blasters themselves had to be clones). I used a local variable to determine whether the clone was the blaster (shooter) or the blast (bullet, to some extent??), and depending on what the variable is, it behaves either like a blaster or a blast. This video really helped me, thanks!
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Unreal, thanks for sharing your experience and what you're working on MrG4meLover!
@greenscoutgaming3435
@greenscoutgaming3435 2 жыл бұрын
dude same lol
@nguyenquangdung9892
@nguyenquangdung9892 3 жыл бұрын
Nah, this awesome channel surely deserves more views, likes, shares & subs. Unfortunately I dont have any friends who are into Scratch and the programming stuffs like me :'(
@franzple
@franzple 3 жыл бұрын
same :(
@kingvax064
@kingvax064 2 жыл бұрын
I have been stuck with a problem for a while. Can you make a sprite go towards the closest clone of another sprite?
@SurfingScratcher
@SurfingScratcher 2 жыл бұрын
Yeah you should be able to. The trick is to keep track of all the clones using local variables. You'll have to loop through all the clones and get the x and y coordinates and check to see which is the closest to the sprite you're interested in.
@kingvax064
@kingvax064 2 жыл бұрын
@@SurfingScratcher Thank you very much! I ended up just making three different sprites instead of clones of the same one, but I'll use this technique if I want to expand the project.
@turttheturtle9874
@turttheturtle9874 2 ай бұрын
Thank you so much, I needed a tutorial on how to detect which clone was being clicked, and this helped a lot!
@oualidbazzaoui1989
@oualidbazzaoui1989 2 жыл бұрын
tysm, i was making a card game and this helped me so much mostly specific clones!
@SurfingScratcher
@SurfingScratcher 2 жыл бұрын
Thanks for sharing!
@timsuperovsky
@timsuperovsky 2 жыл бұрын
Thank you wery much, for a MONTHS ive been thinking how to give clones names. And now i know how.
@kelvinmontage9001
@kelvinmontage9001 Ай бұрын
Hi, I got a question, how did u make the gun move along the turret body when pointing towards the mouse pointer ? my gun seems to move weird
@ShineOrSomething
@ShineOrSomething 4 жыл бұрын
my game goes smoothly and the bullet works fine but when you play for like a minute the bullet and my enemy stops making clones suddenly, do you know how to fix this? pls help
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hmm check that your clones aren't making clones. Scratch has a limit of around 300 clones, so you could have maxed out. That bug is demonstrated and fixed in the video. How can you check this? Count the number of clones you have on the screen and use the 'say' block to print its id number. They should match.
@ShineOrSomething
@ShineOrSomething 4 жыл бұрын
@@SurfingScratcher neva mine sorry i just forgot to use the "delete this clone" block and it kept on maxing out because i didnt delete any clones. Thx
@tyguy104
@tyguy104 Жыл бұрын
Essential for trying to build a city maker or simulator game. Where when you place houses down and I want to program the sim going to his job with a car. So the houses are clones. And I figured out, how the list will record a spawn. It can record the clone's x and y positions and you can make it wait for 10 seconds until it does record the value if you need a lot of time. Then i'll try to make the car clone come out of that x and y position that was recorded for the house clone's x and y coordinate. Ultimately trying to get to an industry's or commercial's x and y. All the properties are either R, C or I (or just 3 different) types of clones. How Sim City would divide it's zones.
@SunsetDragon
@SunsetDragon 3 жыл бұрын
Thank you so much for this video!! It helped a lot, and wasn't one of those six-hundred-million-hour-long tutorials you see all the time! Ha! This helped A LOT with my Paranoid Animation Meme, which I'm still working on as of now, but I'm done with the intro! In the intro I had to have FOUR CLONES all doing different things. I always wondered how to do this!! This is going to help a LOT with so many other things, such as animations with a limit of one sprite, and even more animation and code memes! Thank you again! ~Sunset
@SurfingScratcher
@SurfingScratcher 3 жыл бұрын
Awesome, thanks for sharing your experience Sunset. Loved reading it :)
@SunsetDragon
@SunsetDragon 3 жыл бұрын
@@SurfingScratcher Thank you for the tutorial! :D
@notrhythm
@notrhythm Жыл бұрын
6:35 im late to the party, but when you fire a bullet, the other existing bullets also create a clone of their own as you have the event to create a clone on the sprite itself.
@SurfingScratcher
@SurfingScratcher Жыл бұрын
Yes, you may well have spotted a bug!
@dockpirate2127
@dockpirate2127 4 жыл бұрын
omg I'm so stupid, I've been trying to find a way to make a clone visible while the original sprite still stays hidden thank u so much
@bcs2971
@bcs2971 Жыл бұрын
Thank you so much! I had a problem where the clone button cloned all of them. So glad to understand why and understand how to overcome that problem.
@SurfingScratcher
@SurfingScratcher Жыл бұрын
Ace, thanks for sharing!
@crazyseth4099
@crazyseth4099 3 жыл бұрын
how do you hide the sprite but show the clones?
@madamebunbun3479
@madamebunbun3479 7 ай бұрын
Thanks, I've been making a silly game on scratch and got stuck with cloning issues
@trishstr
@trishstr Жыл бұрын
is there a way for clones, to have clones for themselves ? like a clone all to themselves with their own properties
@damrus312
@damrus312 3 жыл бұрын
can you help me please. why bulletld (for this sprite only) not show when (set bulletld to globalld). thank you
@leofeld9511
@leofeld9511 3 жыл бұрын
I am making a paddle and ball game like scratch tutorial. I want to make another ball appear once the score reaches a certain number. Can I do this with clones? Or would I need to create another sprite?
@GuiDuckz
@GuiDuckz 4 жыл бұрын
I have a question thats gonna really help me out I wanna do a sprite that points to the closest clone.
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Great question! You'll need to track the x and y positions of clones in a list so that you can check to see which is the closest. You're not gonna be able to point in the direction of that clone using a built-in block. Instead, you'll need to use trigonometry based on the x and y coordinate that you've got from your list. Thankfully, I've just done a whole series on trig. Check out this video, it'll give you some clues: kzbin.info/www/bejne/oam1qqqGerqZmcU
@masak1gang419
@masak1gang419 3 жыл бұрын
@@SurfingScratcher That's really hard but. I JUST SPENT 4 WHOLE DAYS TO FIND THAT ANSWER. MASSIVE THANKS!!!!!
@ajtopia
@ajtopia 2 жыл бұрын
AHHH ITS SO SIMPLE AS TO JUST MAKING IT FOR THAT SPRITE ONLY!!!!! THANK YOU SMMM
@NamHoang-oy7lj
@NamHoang-oy7lj 2 жыл бұрын
How can you make the clone not overlapping on each other?
@Emerald_D.Jael4
@Emerald_D.Jael4 Жыл бұрын
hello, i would like to make clones with differents script and differents costumes in one sprite. How can i do that plz ?
@breadisyummy_
@breadisyummy_ 3 жыл бұрын
im making an evolution simulator, but i cant figure out how to make the animal go towards the closest food clone
@dragondg6412
@dragondg6412 3 жыл бұрын
How do i make clone point to other clone if they are enough close to each other
@mxstermajoraktas4454
@mxstermajoraktas4454 4 жыл бұрын
the video helps me for a game thx
@안태성-c3u
@안태성-c3u 2 жыл бұрын
It's very helpful for me to develop my first scratch project. Thank you for your video.
@davidliu2243
@davidliu2243 3 жыл бұрын
I need to replace objectives in lists with the local variable of clones but it doesn't seem to work. Why is this?
@childofflesh1591
@childofflesh1591 2 жыл бұрын
Hi, I’m working on a game where I want to be able to create clones that are sort of magnetic and move towards each other. Can you help with how the code to make clones move towards each other might work?
@phearedphantom
@phearedphantom 7 ай бұрын
I was having trouble that the isClone? Fixed. Tbh I do not understand how that fixes my problem but thanks a ton. I tried (here and there) for hours to figure out the solution for my tycoon and it was here the whole time
@DeadliestBlox
@DeadliestBlox 2 жыл бұрын
I'm trying to make a button where it hides everything by using a broadcast, but I don't know how to hide the clones, can anyone help me? I can't find answers in this video.
@victoriabart8322
@victoriabart8322 4 ай бұрын
Can anyone help me please? I did the exact same thing he did but mine spins weird. It doesn't follow the arrow key properly and I'm not sure what to do.
@arachnophobia-e5y
@arachnophobia-e5y Жыл бұрын
thanks man, you saved me, im making an ANT simulation but i didnt know how to refere to a specific ant of the colonyK
@michaelklein6244
@michaelklein6244 3 жыл бұрын
Really cool, this enhances my understanding and shows me how little I know. Amazing stuff!!!
@SurfingScratcher
@SurfingScratcher 3 жыл бұрын
Good on you for checking it out and expanding what you know:)
@Bryan-dc7pb
@Bryan-dc7pb 4 жыл бұрын
maybe i be late but i wanna know if clones can interac with other clones (from other sprites)
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hi Bryan, thanks for your question. Short answer is yes. All the sensing blocks are still available (if touching other sprite). If you want to detet a specific sprite, that's where you'll need to check with IDs. If you broadcast an event, then every clone will receive it. If you want a specific clone to receive it, again, you'll need to use the ID method that's covered int he video. Let me now if that clears it up, or if it's something else you're wanting to do.
@shaileshkarnawat1983
@shaileshkarnawat1983 4 жыл бұрын
I all unable to make that man pls help the bullets attend visible, they aren't moving... Pls help
@dockpirate2127
@dockpirate2127 4 жыл бұрын
Thank you so much! I just found out how to make a path generator with this :)
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Ooh nice work!
@tdog_
@tdog_ 2 жыл бұрын
this is helping my water physics engine thank you so much!
@celsladroma8048
@celsladroma8048 Жыл бұрын
I HAVE VERY IMPORTANT QUESTION WHY I CANNOT DELETE ONE OF MY CLONE IN SCRATCH because I can delete entire colony of clone if I use delete? Even you see all the help didn't seems know the answers... why?
@aguy1844
@aguy1844 8 ай бұрын
I didn't realize local variables are also local to clones. I've been encoding information in costume number and direction😢.
@wendizhoumdphd4627
@wendizhoumdphd4627 4 жыл бұрын
Great content. Please keep it up.
@justnick7779
@justnick7779 3 жыл бұрын
Why when I am making a clone, his script isn't working only if I click on it
@dashady1367
@dashady1367 3 жыл бұрын
Do you know how to hide clones on a certain backdrop? Then show them on another
@SurfingScratcher
@SurfingScratcher 3 жыл бұрын
Should be doable. You'll just need to create a local variable for the clone that tells it which backdrop to follow or not to follow. Then when you switch backdrops, broadcast an event and get the sprite of the clone to check if its local variable is equal to that of the current backdrop.
@tjwthedj1355
@tjwthedj1355 2 жыл бұрын
How do I make the turret to do that
@Piokoxer
@Piokoxer Жыл бұрын
a little question: let's say i detect a collision with a clone, how do i get its ID? it's the last thing i need to finish up my ball physics engine (and just now i realised Griffpathc made a vid on it... whatever, doing it myself is more fun)
@SurfingScratcher
@SurfingScratcher Жыл бұрын
It's been a while since I made this. I'm guessing that I would try and read the local variable's value in the place where I'm detecting the collision. When you start as a clone, you're probably detecting some collisions there. You could 'wait until you collide with object and read its value then. Just some ideas.
@Piokoxer
@Piokoxer Жыл бұрын
@@SurfingScratcher i ended up writing my own collision system with lists of every clone's x pos, y pos, x vel, y vel, and radius. It works! God is vector math a pain in the ass when you only have the components And you're a 13 year old working with vectors for the first time
@SurfingScratcher
@SurfingScratcher Жыл бұрын
@@Piokoxer I think you're epic! Great work on solving your own problem :)
@twalton
@twalton 2 жыл бұрын
This helped me SO MUCH. Thank you!
@SurfingScratcher
@SurfingScratcher 2 жыл бұрын
Brilliant!
@nasdfigol
@nasdfigol 4 жыл бұрын
7:00 you can also do When green flag clicked {; forever If Create clone of (myself) ;}
@nasdfigol
@nasdfigol 4 жыл бұрын
The issue is you can trigger it without the green flag
@nasdfigol
@nasdfigol 4 жыл бұрын
It also makes the isClone variable obsolete, because green flag is for original sprite but space key applied to both original and clones
@nasdfigol
@nasdfigol 4 жыл бұрын
Also I subbed
@SmartWittyName
@SmartWittyName 4 жыл бұрын
How would you then transfer the value of the local variable back to a new global one? For example, when you click on a specific bullet, a new variable is assigned the number of that bullet? When I try to do this by "set (variable) to bulletid" it doesn't choose a clone, it assigns 0, just as bulletid is listed at the top of your screen.
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hi SmartWittyName, thanks for your comment. In the video, we use a globalID, change it by 1, then make it the value of the localID. If you want to go the reverse, then just set the other global variable to the value of bulletID in the sprite clicked hat block. You've just gotta be sure that you've already set bulletID. Read the value of bulletID first and be sure that it's not already 0, if it is, you have a bug somewhere!
@SmartWittyName
@SmartWittyName 4 жыл бұрын
@@SurfingScratcher Thanks so much for replying! I found the bug - I had a different trigger for cloning in the script of another sprite, originally to prevent myself from cloning clones. After rearranging some things to use the isClone variable you showed in the video, it worked perfectly =)
@mayorhotdog2799
@mayorhotdog2799 4 жыл бұрын
Great video, it really helped me out with my script, thank you.
@Goldtalysis
@Goldtalysis 3 жыл бұрын
hello! i know im really late, but i have a problem and idk how to fix it. so, i have been creating a fnf game in scratch, and im actually coding the notes, now, here is where the problem begins, i use clones and messages for the notes (e.x : send (left)) and when the left note recieves left, then it will show as a clone and it will move up, however, if i create too much clones, they just dont appear, they wont. i tried restarting scratch, remaking the game from 0, everything. it still happens, can you please help me? i got so excited to start with this game, and go so sad when i saw this problem.
@SurfingScratcher
@SurfingScratcher 3 жыл бұрын
Scratch has a 300 clone limit, so you won't be able to generate more clones if you've reached that limit. You'll need to delete clones before creating new ones. See if that helps your problem!
@Goldtalysis
@Goldtalysis 3 жыл бұрын
@@SurfingScratcher thanks! I will try that later
@OhioStudiosOG
@OhioStudiosOG 3 жыл бұрын
Nice, but the script broke after a while and the bullets wouldnt stop existing after hitting the wall, but only a enemy i made it hit. What should i do?
@SurfingScratcher
@SurfingScratcher 3 жыл бұрын
You'll want to sense if touching the wall and then delete the clone once it's true.
@OhioStudiosOG
@OhioStudiosOG 3 жыл бұрын
@@SurfingScratcher Thanks
@ShinnySilver
@ShinnySilver 5 ай бұрын
How can I delete a specific clone?
@bananaman5238
@bananaman5238 4 жыл бұрын
Is it possible to find the x,y position of a clone with another sprites clone and have the other sprites clone go to the clone
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hi skruffles, my head's in a bit of a twist reading that. I'm going to rephrase to see if I'm understanding you. Sprite A (clone) wants to read the x,y position of Sprite B's (clone). You want Sprite A's (clone) to go to Sprite B's (clone)? You can store the x and y positions of clones in a list. If you use the 'id' approach that's in the video, then the item number of the list can refer to the 'id'. So if you have a list called xPositions, then item 1 would be the x position of the clone with id = 1. I'm curious to know what trigger (event/user interaction) prompts the Sprite A's (clone) to go to the xy of the Sprite B's (clone). Because if you know the target position based on a user event, you can capture those in variables. This approach acts like a bridge between the two. Good luck!
@bananaman5238
@bananaman5238 4 жыл бұрын
@@SurfingScratcher yup you got it and this helps me alot, thanks!
@theverybest4184
@theverybest4184 4 жыл бұрын
thank you so much this helped me a lot
@WUJCIX
@WUJCIX Жыл бұрын
THank You so much you very helped me
@arctico3o891
@arctico3o891 4 жыл бұрын
I have a question for you because you seem like you know a lot about scratch. How could I make it so that my clone goes to a randomized piece of a(for example) 12 by 12 grid? I will send a link to the game in the reply section of this comment. Please respond in the comments of the game.
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
HI arcticwolf, you could probably just use some maths to help you out with this one. You'll have 12 x positions for each row. You'll have 12 y positions as well. The coordinates are just combinations of these. If each piece has an id, then you can locate its x and y position. The first 12 pieces will have id's from 1-12. Say you want id = 6. Well that's just going to be 6 x width of piece. All the y positions in the row will be different. You can also use the mod operator to figure this out. 6 mod 12 = 6, for the next row, 18 mod 12 = 6. Check out my video on Scratch operators including mod if that's confusing. For the y positions, you can just divide the id by 12 and round it to the floor or ceiling depending on how you like to do it. For example, 13/12 = 1.08. If you ceil that, it rounds it up to 2. Then you can just multiply the height of the piece by the result of the division. It will work for each row of you grid. Here's a project that creates a grid based on mods: scratch.mit.edu/projects/332495324 Okay, so now that you can calculate x,y coords based on an id, you should be able to send the clone of another sprite to that location.
@R0DBS
@R0DBS 10 ай бұрын
Thanks mate!
@Jellyjam14blas
@Jellyjam14blas 4 жыл бұрын
Thank you! I been trying to figure out how to do this for so long. ❤️
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Boom jellyjam14blas! Thanks for dropping your comment. I'm pumped to hear you found value in the video. Keep your code on 😎
@ppcat8630
@ppcat8630 3 жыл бұрын
how 2 create a specific amount of clones?
@ppcat8630
@ppcat8630 3 жыл бұрын
like if i wanna create 3 clones, i just wanna create 3 clones
@SurfingScratcher
@SurfingScratcher 3 жыл бұрын
@@ppcat8630 put ' create a clone' in a repeat 3 times block. Do it on a green flag press.
@fidelisalberto6226
@fidelisalberto6226 4 жыл бұрын
Seus vídeos são excelentes..OBRIGADOOO
@larryc324
@larryc324 3 жыл бұрын
Very helpful
@diegofranco5847
@diegofranco5847 Ай бұрын
THAAAAAAAAAAAAAAAAAAAAAAAAAAAAANKS BRO
@pancakepete7809
@pancakepete7809 2 жыл бұрын
omg thankyou, my shooter is playable
@neitine1
@neitine1 2 жыл бұрын
It was that easy and i just tried to make something with lists
@Mutatedordinary
@Mutatedordinary 4 жыл бұрын
Really diggin’ that t-shirt, it is a really creative design!
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Oh totally, it's probably my fave!
@Ac3ofspad3s-cp6wp
@Ac3ofspad3s-cp6wp Жыл бұрын
HELLO WORLD I am super late to this amazing video... I was making a battle cats not really a knockoff on scratch when I thought how to make clones die one at a time? thanks for the video helped me a lot
@SurfingScratcher
@SurfingScratcher Жыл бұрын
Thanks for sharing your experience :)
@Ac3ofspad3s-cp6wp
@Ac3ofspad3s-cp6wp Жыл бұрын
@@SurfingScratcher no problem this is such a good tutorial!
@gavinmann4152
@gavinmann4152 4 жыл бұрын
Thanks soooo much. i was using just a bulletID which was global, so you can only use that variable at the INSTANT the clone is created, but with this i can use the local variable for the clone later on in the script and not have it interfere with the other clones. Maybe i'll link the project when i'm done if that's ok - it's simulating an ecosystem. Your videos are the best - they are clear and they are so professional looking, Happy Scratching!! :)
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Awesome, Gavin! So pumped to hear that you found some value in the video and thanks for the supportive feedback :)
@vtcomics365
@vtcomics365 Жыл бұрын
you are so cool!!
@shashibhushan4445
@shashibhushan4445 4 жыл бұрын
Is there a way I can make clones act like sprites? Also, you make awesome informative videos.
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hi Shashi, thanks for your comment and question :) A clone is a sprite - it's a clone of a sprite. It 'inherits' all the behaviour that you've coded for the sprite you've cloned. The way to control it (like a sprite) is to use a 'When I start as a clone' hat block. That's the sprite way of saying (hey the green flag has been clicked, come into existence and do your thing).
@FlameAndSlime
@FlameAndSlime 4 жыл бұрын
What are the differences between global and local variables? How do they work together? And what would happen if 'bulletID' was set to 'For all sprites'? Would it make any difference?
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Yep, it would make a difference. That exact situation is explained in the video. 'globalID' is essentially the 'bulletID' that has been set to 'For all sprites'. It means that all clones will share this one value. No clone will have its own copy of it. When set to 'this sprite only' a clone will get its own copy of the variable. If the clone changes the value of the variable it only changes for that clone's copy, not any of the other clones. For all sprites = same value for every clone This sprite only = each clone has its own copy
@geogames8206
@geogames8206 2 жыл бұрын
Mine makes more than 1 clone for some reason
@kenadelglass7933
@kenadelglass7933 4 жыл бұрын
Great videos. Been teaching Scratch since 2015 and learned a thing or two from you. Thank you for sharing. Can you make two or more cloned ball sprites that are moving and bouncing bounce off each other? I can do this when they are the same color using touching color but what if they are different colors?
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hi Ken, thanks for dropping by with your comment. Pumped that you've found some value in the video! Here are two ideas that come to mind for me: You could probably wrap the color sensing blocks in the "OR" boolean blocks as a starting point. Though, that wouldn't account for a random color. A more advanced solution would be to track the x,y positions of the clones using a list. Then you would calculate the distance between the center's of each ball. If the distance is less than the radius of the ball, then you would have a collision. This solution would have some performance issues if you had lots of balls.
@VillagerJack
@VillagerJack 4 жыл бұрын
my clones all teleport to the gun when i press space
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hi Jack, thanks for sharing. I suspect that you may have a go to position of gun in the space key press hat block. You will want to position the clone in the 'when I start as a clone' hat block.If you do it in the space key press, then it will apply to every clone and not the one that is created.
@VillagerJack
@VillagerJack 4 жыл бұрын
@@SurfingScratcher thank you
@JoshCartman
@JoshCartman 4 жыл бұрын
Hey I'm trying to use Scratch clones for a Lives indicator. I read something about Clone IDs but I'm not getting it. Can you help me? I got as far as generating the Clones on the screen but I don't know what to do next.
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
If you wanted to create lives for each clone, then you would have a variable FOR THIS SPRITE ONLY called something like lives. Then, use a 'When I start as a clone' hat block to continually check if the clone should lose a life. Something like, if bullet touches clone then change lives by -1
@batuhankoyuncuoglu2311
@batuhankoyuncuoglu2311 4 жыл бұрын
Thank you very much :)
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
My pleasure, bud :) Pumped you found it useful.
@Chillz011
@Chillz011 4 ай бұрын
I want clones that spawn in clones
@TheDummbess30543
@TheDummbess30543 2 ай бұрын
scratch is not only for childrens is also for older peoples
@ultimate3000
@ultimate3000 2 жыл бұрын
didn't work, now i cant even fire once.
@leopaveley
@leopaveley 4 жыл бұрын
Hey! I've been working in Scratch and come across a really nasty problem. So basically, is there any way I can read a specific clone's coordinates/direction. Say, one that touches the player. This would truly help me a lot and you seem experienced. :)
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
Hi T and S Productions, thanks for your question. The 'id' system that's covered in the video can solve this issue. In fact, if you put your code inside the 'when I start as a clone' block and read the x and y reporter blocks it will report. You could use lists to make them global. Something like this: . . You'll need to assign a local variable called 'id' You'll need to create a list called x-coords You'll need to create a list called y-coords . . In the 'when I start as a clone' hat block, put a 'repeat until' block. Repeat until touching the player. Inside the repeat until, you could set the x-coords at the item location of the id and set its current x value. Do the same for y. Remember, this is only if you want them globally. I might make a video on this if it's confusing as I think it will help a number of people. But see how you go :) Good luck!
@leopaveley
@leopaveley 4 жыл бұрын
@@SurfingScratcher With your advice, I managed to make it work! Thank you so much :)
@SurfingScratcher
@SurfingScratcher 4 жыл бұрын
@@leopaveley Unreal banana peel!
@Pepsi_inc
@Pepsi_inc 2 жыл бұрын
eu entendi 85% vou ver de novo pra entender 100%😅😅😅😅
@밥먹어밥-n6h
@밥먹어밥-n6h 4 жыл бұрын
Um first sorry for bad English -Im using duplicate block to make bullets but if i shoot many bullets(duplicate many times), bullets stop duplicating. Im using scratch2 and am i have to use 3?- Sorry! Never mind me! I found that i didint put delete duplicate box lol thx!
@ShineOrSomething
@ShineOrSomething 4 жыл бұрын
i have the same problem but i don't know what a delete duplicate box is, can you pls tell me? :)
@-absoulute_machine-
@-absoulute_machine- Жыл бұрын
i understood none of that
@SurfingScratcher
@SurfingScratcher Жыл бұрын
Watch it again!
@SurfingScratcher
@SurfingScratcher Жыл бұрын
I'm learning Combine from Apple at the moment and I need to rewatch content sometimes to help build my understanding.
@austino7770
@austino7770 3 жыл бұрын
I'm gonna make a game out of this. Also, this comment is the 100th comment!
@zgreatest69
@zgreatest69 4 жыл бұрын
WOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@Tashipelmo
@Tashipelmo 3 ай бұрын
ཨའི ཕུན ཚོ ཚོ པ རི ཤོ
@jbarrettSRQ
@jbarrettSRQ 2 жыл бұрын
great to have a clone tutorial. But please don't make them of weapons. Please make it gender neutral and peaceful. thank you
@SurfingScratcher
@SurfingScratcher 2 жыл бұрын
Thanks for the feedback and it's useful to consider going forward. If you were to remake this clones tutorial, what themes/props would you use in its place?
@Legac706
@Legac706 Жыл бұрын
dude just put when space clicked create clone of myself wait until not key space pressed
Typing Speed Test Game in Scratch 3 (including how to make it)
13:16
Surfing Scratcher
Рет қаралды 12 М.
Scratch 3.0 Tutorial: How to Make a Tower Defense Game (Part 1)
18:12
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Scratch Variables | How to Use Variables in Scratch 3.0 Tutorial
7:42
Surfing Scratcher
Рет қаралды 130 М.
How to Make a Scrolling Background in Scratch | Tutorial
6:56
Scratch Team
Рет қаралды 1,6 МЛН
7 Must Know Scratch Tips
3:41
ZonxScratch
Рет қаралды 185 М.
Scratch Lists | How to Use Lists in Scratch 3.0 Example
7:54
Surfing Scratcher
Рет қаралды 72 М.
Tile Scrolling Platformer (Mario) | 1. Setup
19:16
griffpatch
Рет қаралды 1,1 МЛН
Scratch Algorithms You NEED To Know!
5:14
ShiftClickLearn
Рет қаралды 134 М.
Scratch Functions | Make a Block using My Blocks in Scratch 3.0
9:46
Surfing Scratcher
Рет қаралды 109 М.
What is mathematical thinking actually like?
9:44
Benjamin Keep, PhD, JD
Рет қаралды 31 М.
Graphing Sin Cos Tan in Scratch
13:00
Surfing Scratcher
Рет қаралды 9 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН