Scratch Algorithms You HAVE To Know!

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 8. 07. 2024
  • In this Scratch Tutorial, I show some very useful algorithms that you need to be using (if you aren't already).
    💬 POINT TOWARDS COORD FORUM: scratch.mit.edu/discuss/topic...
    🔗 LINKS: All Videos In This Series: ‱ Scratch Tile Scrolling...
    Scratch Profile Page: scratch.mit.edu/users/ShiftCl...
    Night Ninja Scrolling Platformer: ‱ Scratch | Scrolling Pl...
    Cat Clicker tutorial: ‱ Scratch | Cat Clicker ...
    Tower Defense tutorial: ‱ Scratch | Making a Tow...
    How-to tutorials: ‱ Scratch | How-To Tutor...
    Get Scratch Addons: scratchaddons.com/
    đŸ§ŸCHAPTERS:
    00:00 - A SmOoOTh Intro ._.
    00:14 - 1. Smoothing Algorithm
    01:36 - 2. Point Towards Coord Algorithm
    03:25 - 3. Move Steps Algorithm
    05:07 - 4. Off Screen Detection Algorithm
    06:31 - Outro
    ❗ DISCLAIMER:
    This video is family-friendly! Hostile and/or rude comments will not be tolerated!

Komentáƙe • 209

  • @CoolScratcher
    @CoolScratcher Pƙed rokem +7

    nobody:
    owen: makes a literal scrolling engine in the middle of his tutorial

  • @ShiftClickLearn
    @ShiftClickLearn  Pƙed rokem +10

    If I had a penny for every time I said "thing" and "smooth" in this video, I'd have like a dollar or something. 💀

    • @dolliethedoll
      @dolliethedoll Pƙed rokem +4

      YO FIRST TO REPLY YES

    • @anasoares6476
      @anasoares6476 Pƙed rokem +4

      second :D

    • @Superfastisfast
      @Superfastisfast Pƙed rokem +3

      I'd have like a -1 dollar or something*

    • @MaxwellCatAlphonk
      @MaxwellCatAlphonk Pƙed rokem +4

      NO!! 💀💀💀💀💀💀💀💀💀💀💀💀💀💀💀🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿🗿

    • @TwiStarLight
      @TwiStarLight Pƙed rokem +2

      🗿

  • @MonokuroNeko77
    @MonokuroNeko77 Pƙed rokem +9

    revolutionary stuff
    Using your technique of ""move () steps" but with extra steps", I was able to create bullets that move offscreen and can travel in any direction.
    And, sprinkling in a bit of my own code, I managed to make it so that they would disappear upon getting far enough away from the player.
    Thank you.

  • @anasoares6476
    @anasoares6476 Pƙed rokem +8

    I have a way to use movement
    If then
    point towards mouse pointer
    move (distance to mouse pointer / 15)
    end
    change the number to be whatever smoothness you'd like.

  • @DHSBros
    @DHSBros Pƙed rokem +6

    I favourite part of the Episode is at 6:44

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem

      hehe ;p

    • @DHSBros
      @DHSBros Pƙed rokem

      @@ShiftClickLearn I have video idea for you top 10 best Survival Disasters Games

    • @milanoo_5
      @milanoo_5 Pƙed rokem

      @@ShiftClickLearn B R E A D

  • @shoefoodreviews5359
    @shoefoodreviews5359 Pƙed rokem

    MY GUY YOU JUST SAVED MY LIFE WITH THAT POINT TOWARDS THING THANK YOU

  • @spearmaster-rw
    @spearmaster-rw Pƙed 9 měsĂ­ci

    This point towards X Y is a DAMN LIFE SAVER!!! I DIDNT KNOW THIS WAS EVEN POSSIBLE!!! TYSM

  • @isaacler2965
    @isaacler2965 Pƙed rokem +2

    With hide/show for scrolling games easier way exist:if x position = x or y position =y show,else hide.

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem +1

      I've found that it will break sometimes. a variable could be 15.1124 while the position is only 15.1. If you round it, they're both 15. :D

  • @JacksonAcademy1
    @JacksonAcademy1 Pƙed rokem +1

    Awesome video! I'll have to keep this in mind and watch it later. I like your thumbnails :D

  • @inactive_channel111
    @inactive_channel111 Pƙed rokem +4

    Great video! This will definitely help with my games.

  • @-CosmoCode
    @-CosmoCode Pƙed rokem +1

    This will help in many of my games, Thank You shifty!

  • @dhaneshabhipraya
    @dhaneshabhipraya Pƙed rokem +2

    This inspired me to make a customizable puzzle game in Python. And it's text-based too.

  • @Stunt7
    @Stunt7 Pƙed rokem +2

    Wow, the second costum Block is so usefull for tower defense games!

  • @xFlREBIRDx
    @xFlREBIRDx Pƙed 11 měsĂ­ci +1

    Instead of using the multiply block you can use the divide block. Makes it easier to find a good speed.

  • @l712doesstuff7
    @l712doesstuff7 Pƙed rokem +3

    just what I needed. thanks

  • @gandewaarjuna6855
    @gandewaarjuna6855 Pƙed rokem +2

    ShiftClickLearn thanks for super great videos

  • @somnullty
    @somnullty Pƙed rokem

    6:26 in my project(if i do scrolling platformer) i will do if not your offscreen algorythm set scroll x to x and scroll y to y

  • @nurjahanlily355
    @nurjahanlily355 Pƙed rokem

    bro i just watched ur video which was from 1 year ago and i clicked on this video but bro ur voice just switched LIKE BOOMM

  • @NITRO_PRO
    @NITRO_PRO Pƙed rokem +3

    Really helpful!

  • @cocomusicstation326
    @cocomusicstation326 Pƙed rokem +3

    Sick as heck bro đŸ˜Č

  • @demircantay6760
    @demircantay6760 Pƙed rokem +5

    Anyone noticed the bread cat?

  • @Yasird1
    @Yasird1 Pƙed rokem +21

    Pretty cool I really find these tutorials use full while I am programming can you make videos on other programs if you know any other or if you want.

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem +1

      I'm glad you find them helpful. :D

    • @sharkyd589
      @sharkyd589 Pƙed rokem +1

      Agreed

    • @bloontdbattles1802
      @bloontdbattles1802 Pƙed rokem

      czcams.com/video/xcjZK9aY3mE/video.html

    • @enzo_6416
      @enzo_6416 Pƙed rokem

      May I ask that you review this even if it takes a year I know you have a lot of viewers

  • @JackNoEyes
    @JackNoEyes Pƙed 11 měsĂ­ci

    Hello ShiftClickLearn
    To say your tutorials have helped me in creating my games is a grouse understatement (there almost line for line just your tutorials). And I was wondering if you would have any idea for an algorithm relating to cloned npc's shooting cloned projectiles? This is something i've been struggling with for a while and would love to hear if you have any ideas on how to go about this.

  • @Dam1an9X9
    @Dam1an9X9 Pƙed rokem

    so the pointing algorithm doesnt work anymore it only works if the y < y pos is true bc it doesn't let 180 / 0 it just says infinity

  • @kxhu
    @kxhu Pƙed rokem +2

    A very helpful video!

  • @moonsunlight-lr6kl
    @moonsunlight-lr6kl Pƙed rokem +2

    Wow, these are sooo Cool!

  • @Straightonly69
    @Straightonly69 Pƙed rokem +3

    very useful

  • @mittsykittycatextra1980
    @mittsykittycatextra1980 Pƙed rokem +2

    WE NEED MORE

  • @UnknownX-Edits
    @UnknownX-Edits Pƙed rokem +2

    Hey can you help me, Im making a game with a clone enemies in it, And I tried searching how to make clones have hitbox and nothing worked. Can you help me?

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem

      Here's a simple way to make a hitbox:
      Switch costume to the hitbox costume (Just a square that covers the player costume)
      If (touching whatever) {
      do whatever
      }
      Switch back to the player costume.
      Hope this helps. :D

  • @Iliterallyhave0life
    @Iliterallyhave0life Pƙed rokem +2

    yo thank you for this video :)

  • @thepotatoe101
    @thepotatoe101 Pƙed rokem

    is there a way to make the move steps algorithm to work with cloned enemies chasing the player? I tried this and it didnt work

  • @Yoshnis-TW
    @Yoshnis-TW Pƙed rokem +2

    i very like the bread cat

  • @shwetasimpson586
    @shwetasimpson586 Pƙed 3 měsĂ­ci

    The fact that he used the scratch cat with a loaf of bread oh he's head😂

  • @donetede_la_pradera1956
    @donetede_la_pradera1956 Pƙed rokem

    this is soooooooooooooooooo usefull

  • @helckho3875
    @helckho3875 Pƙed rokem +5

    for the pointing to a coordinate part, can you make it so that it will turn at a FIXED rate in the most efficient direction to the coordinate because I am making a game that will require the turning to make it less unbalanced

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem

      That would be a good block to add...

    • @helckho3875
      @helckho3875 Pƙed rokem +1

      @@ShiftClickLearn do you have any way to make it happen

  • @yorp.
    @yorp. Pƙed rokem +5

    Could you maybe make a video on how to do particle effects? Because that would be cool lol :DD

  • @marianacocora9221
    @marianacocora9221 Pƙed rokem +1

    6:44 B R E A D

  • @misterdot6923
    @misterdot6923 Pƙed rokem +2

    amazin!

  • @MonokuroNeko77
    @MonokuroNeko77 Pƙed rokem +3

    do you think it is also possible to change a specific number/letter in a variable to a value without modifying the other symbols?
    I'm making a save function, and am using this.

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem +1

      I would think it's possible... I bet you'd need to loop through each character and use a "letter i of variable". You'd also need a bunch of join blocks if I had to guess.

    • @instinctdiff7765
      @instinctdiff7765 Pƙed rokem +1

      list will be your friend with that. put all of the characters of the value inside a list using a repeat block then modify the specific thing you want then rejoin them all again using also a repeat block. are you familiar with using lists?

    • @Lukex305
      @Lukex305 Pƙed 11 měsĂ­ci +1

      @@instinctdiff7765 you don't have to join them again with the repeat block, you can also do: set ["variable" v] to ("list" v), delete all of ["list" v]

  • @PecokaArasio
    @PecokaArasio Pƙed rokem +2

    woah best algorithims

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem +2

      Thanks!!

    • @PecokaArasio
      @PecokaArasio Pƙed rokem +1

      @@ShiftClickLearn no problem but your tuts are amazzzzzzzzzzzzzzinggggggggggggggggggggg (T R U E)

  • @chintusmliu7758
    @chintusmliu7758 Pƙed rokem +1

    Smooooth... man

  • @____NN__
    @____NN__ Pƙed rokem +2

    Yes

  • @DHSBros
    @DHSBros Pƙed rokem +3

    Cool

  • @odice27
    @odice27 Pƙed 11 měsĂ­ci

    Can someone who understands maths pls explain why the sin of direction and cos of direction work as an replacement of move 10 steps. As far as I knew the sin of an angle is opposite/hypotonuse how does that number times steps give us a perfectly working move 10 steps replacement

  • @phinixprono
    @phinixprono Pƙed rokem +1

    Can see your full tile scrolling game in scartch

  • @hurnal6198
    @hurnal6198 Pƙed rokem +2

    5th I think, edit: also I started watching when it was 36 seconds ago

  • @xanerisGONE
    @xanerisGONE Pƙed rokem +2

    Can you make a tutorial on how to make a Nextbot in Scratch?

  • @dracokinerek
    @dracokinerek Pƙed rokem +2

    We're no strangers to love
    You know the rules and so do I
    A full commitment's what I'm thinking of
    You wouldn't get this from any other guy
    I just wanna tell you how I'm feeling
    Gotta make you understand
    Never gonna give you up
    Never gonna let you down
    Never gonna run around and desert you
    Never gonna make you cry
    Never gonna say goodbye
    Never gonna tell a lie and hurt you
    We've known each other for so long
    Your heart's been aching, but
    You're too shy to say it
    Inside, we both know what's been going on
    We know the game and we're gonna play it
    And if you ask me how I'm feeling
    Don't tell me you're too blind to see
    Never gonna give you up
    Never gonna let you down
    Never gonna run around and desert you
    Never gonna make you cry
    Never gonna say goodbye
    Never gonna tell a lie and hurt you
    Never gonna give you up
    Never gonna let you down
    Never gonna run around and desert you
    Never gonna make you cry
    Never gonna say goodbye
    Never gonna tell a lie and hurt you
    (Ooh, give you up)
    (Ooh, give you up)
    Never gonna give, never gonna give
    (Give you up)
    Never gonna give, never gonna give
    (Give you up)
    We've known each other for so long
    Your heart's been aching, but
    You're too shy to say it
    Inside, we both know what's been going on
    We know the game and we're gonna play it
    I just wanna tell you how I'm feeling
    Gotta make you understand
    Never gonna give you up
    Never gonna let you down
    Never gonna run around and desert you
    Never gonna make you cry
    Never gonna say goodbye
    Never gonna tell a lie and hurt you
    Never gonna give you up
    Never gonna let you down
    Never gonna run around and desert you
    Never gonna make you cry
    Never gonna say goodbye
    Never gonna tell a lie and hurt you
    Never gonna give you up
    Never gonna let you down
    Never gonna run around and desert you
    Never gonna make you cry
    Never gonna say goodbye
    Never gonna tell a lie and hurt you

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem +2

      đŸŽ”

    • @dracokinerek
      @dracokinerek Pƙed rokem +1

      Get rickrolled in the most clever way

    • @dracokinerek
      @dracokinerek Pƙed rokem +1

      @@ShiftClickLearn pin this please

    • @pndaMobby
      @pndaMobby Pƙed rokem

      @@dracokinerek omg so clever just copy and pasting the lyrics omg you got them omg so smart wow

    • @dracokinerek
      @dracokinerek Pƙed rokem

      @@pndaMobby I know the real song

  • @jamespennington6428
    @jamespennington6428 Pƙed rokem +1

    Cool, but how to I make it smooth from the starting position at the same time?

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem +1

      What do you mean?

    • @jamespennington6428
      @jamespennington6428 Pƙed rokem

      @@ShiftClickLearn like, if you do ((Target Value) - Value) * .5) then it makes it smooth, but how to I do the opposite at the same time?

  • @winpapasoe6198
    @winpapasoe6198 Pƙed rokem +1

    The only thing i'm focused to is the *bread* cat

  • @Cpiyaphum1
    @Cpiyaphum1 Pƙed rokem +2

    Smootherness +4

  • @HowtoDoStuffwithEthan
    @HowtoDoStuffwithEthan Pƙed rokem +2

    BREAD CAT

  • @bornananana
    @bornananana Pƙed rokem +1

    mmm yez a remake of your algroithms from like uhhhhh idk how long it was existing
    Š>

  • @dhaneshabhipraya
    @dhaneshabhipraya Pƙed rokem +1

    atan is short for arctan is short for arc tangent

  • @Therealbluu
    @Therealbluu Pƙed rokem +3

    chapter 1 A SmoOtH IntrO ._. lool

  • @GliTchedK
    @GliTchedK Pƙed rokem +2

    Could you maybe do some helpful code tips for making a rouge-like game like binding of isacc? I’ve been making art and music for a game yet the coding is where I get stumped. It would be so helpful.

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem

      I've never played binding of isacc and I haven't ever made a roguelike so I don't know If I have any tips! If I ever make one that's a great idea! :D

  • @der_leel
    @der_leel Pƙed rokem +3

    quality content 💚

  • @stio_studio
    @stio_studio Pƙed rokem +1

    Your point to xy has a bug. If the y is the same it bugs out

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem

      Huh, I'll have to check that out.

    • @Lukex305
      @Lukex305 Pƙed 11 měsĂ­ci +1

      It dosen't. That is how it works. Like if you think about it. If you and apple are at the same position and you want to point towards the apple you could litreally point anywhere you want, since it is at same position (it is clipping thro your body)

    • @stio_studio
      @stio_studio Pƙed 11 měsĂ­ci

      @@Lukex305 I said if y is the same. Not x

    • @stio_studio
      @stio_studio Pƙed 11 měsĂ­ci

      I can see the confusion as I never said that x should be different

  • @appabtw4777
    @appabtw4777 Pƙed rokem +2

    cool

  • @lotl5638
    @lotl5638 Pƙed rokem +3

    *B R E A D C A T*

  • @lancerupp8577
    @lancerupp8577 Pƙed rokem

    My feeble human brain still can't understand these algorithms, despite the fact that I've been working with Scratch for over 2 years.

  • @CatritaAycock
    @CatritaAycock Pƙed 5 měsĂ­ci

    It's arc tan

  • @someonenamedgreen
    @someonenamedgreen Pƙed rokem +2

    Bread

  • @keonscorner516
    @keonscorner516 Pƙed rokem

    They turn into custom Blocks

  • @sohampine7304
    @sohampine7304 Pƙed rokem +2

    How old are you bro
    Tysm for the video

  • @AVeryRandomDude
    @AVeryRandomDude Pƙed rokem +2

    Again yaya

  • @RonicTheEgg
    @RonicTheEgg Pƙed rokem +2

    haha french cat

  • @donutlol246
    @donutlol246 Pƙed rokem +1

    baguette cat

  • @ppoly
    @ppoly Pƙed rokem +1

    the why he got bread on the head

  • @ContentGaming1
    @ContentGaming1 Pƙed rokem +2

    Taco Cat

  • @scratchyea
    @scratchyea Pƙed rokem +3

    First? I guess second

  • @tigershelf
    @tigershelf Pƙed rokem +2

    B R E A D

  • @surlo69
    @surlo69 Pƙed rokem +2

    bread cat

  • @sohampine7304
    @sohampine7304 Pƙed rokem +1

    Can you (try) make a horror game or you can't
    Pls don't mind

  • @ZaeNonQ
    @ZaeNonQ Pƙed rokem +2

    f r e n c h b r e a d

  • @epicc_exe
    @epicc_exe Pƙed rokem

    bread cat 👍

  • @kimberlysandoval680
    @kimberlysandoval680 Pƙed rokem +3

    bread

  • @greenalto7677
    @greenalto7677 Pƙed rokem +1

    Dope vidoe but i dont use Scratch 😂

  • @sheeppro1463
    @sheeppro1463 Pƙed rokem +2

    noise

  • @MaxwellCatAlphonk
    @MaxwellCatAlphonk Pƙed rokem +2

    Easing

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem

      like smOOthing?

    • @MaxwellCatAlphonk
      @MaxwellCatAlphonk Pƙed rokem +1

      @@ShiftClickLearn smoothing out the beginning and ending of the M O V E M E N T yes (sorry for getting mad at my autocorrect)

  • @crypteddude3633
    @crypteddude3633 Pƙed rokem

    Why does the voice change every vid

  • @_CrystalTV
    @_CrystalTV Pƙed 7 měsĂ­ci

    i was the 1,000 liked video!

  • @QuantumScratcher
    @QuantumScratcher Pƙed rokem

    atan = arctangent

  • @the_real_goobert
    @the_real_goobert Pƙed rokem +1

    bread cat 🍞

  • @imperialwaffle
    @imperialwaffle Pƙed rokem +2

    Hey man, I've been watching your videos lately, and your the BEST CZcamsr I have EVER watched. If you can, Could I please get a shoutout? Thanks for everything ShiftClickLearn. I subscribed aswell. Also, could you please make a shine effect video? Thanks.

    • @ShiftClickLearn
      @ShiftClickLearn  Pƙed rokem

      Wow, thank you so much for commenting/ subbing. You're very welcome- that's a good idea. :D

  • @SypherCODM
    @SypherCODM Pƙed rokem

    Why did your Brother stop uploading?

    • @SypherCODM
      @SypherCODM Pƙed rokem

      And you may know someone who usually comments on your vids called Cyan.

  • @CrystalKyryn
    @CrystalKyryn Pƙed rokem +2

    25th liek : - )
    s.o...c.o.o.l

  • @sklevridge
    @sklevridge Pƙed rokem

    a

  • @ZaeNonQ
    @ZaeNonQ Pƙed rokem +2

    h m m

  • @lilleopard_ty3662
    @lilleopard_ty3662 Pƙed rokem +1

    Accidentally disliked but I liked it again

  • @sethplayzminecraft2671
    @sethplayzminecraft2671 Pƙed rokem +2

    BREAD
    -SCL 2022

  • @Iminsanealr
    @Iminsanealr Pƙed rokem +2

    B R E A D C A T

  • @cbob81514
    @cbob81514 Pƙed rokem

    bread cat

  • @deku_isfanboy
    @deku_isfanboy Pƙed rokem +2

    bread