Scratch ENEMY AI | Top Down Shooter (Ep. 2/2)

Поділитися
Вставка
  • Опубліковано 27 чер 2024
  • In this Scratch tutorial, I show how to finish the top-down shooter by adding enemy AI that chases the player!
    📺 First Top-Down Shooter Video: • Scratch Top Down Shoot...
    🎮 Get The Game's Assets: scratch.mit.edu/projects/6788...
    Thanks for watching! Please hit the like button and subscribe for future Scratch tutorials!
    🔗 LINKS:
    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 - Intro
    00:24 - Enemy Spawning
    01:46 - Camera Movement
    02:31 - Repositioning Enemies
    03:06 - Enemy Movement
    05:33 - Enemy Collision
    07:16 - Enemy Health
    10:30 - Score Stuff
    11:58 - Particles
    14:37 - Outro
    ❗ DISCLAIMER:
    This video is family-friendly! Hostile and/or rude comments will not be tolerated!

КОМЕНТАРІ • 168

  • @ShiftClickLearn
    @ShiftClickLearn  2 роки тому +7

    Thanks for watching! Make sure you watch the first top-down shooter game episode! Here's the link: ua-cam.com/video/qC8od4vpN44/v-deo.html

    • @Goin_VR
      @Goin_VR 5 місяців тому

      can i play the final results???????

  • @Fudgecrumb
    @Fudgecrumb 2 роки тому +9

    Keep up the tutorials! Your content is amazing and well edited :)

  • @gummybear4927
    @gummybear4927 2 роки тому +6

    Thanks for the tutorials! Didn't come here to code this game but helped me know more so I can implement these features into my projects. Keep up the good work!

  • @AirLiftingMonkeys
    @AirLiftingMonkeys 2 роки тому +3

    I've been waiting along time for this video😍

  • @azmaintheproplayer2847
    @azmaintheproplayer2847 2 роки тому +6

    Me : *not motivited in Scratch*
    Shift Click Learn : *Posted a new video*
    Me : BACK TO SCRATCH!

  • @sakkamsamerkhan8102
    @sakkamsamerkhan8102 Рік тому +1

    I have been looking for a video like this thanks now I can continue making a top down game ❤

  • @ChesterCpt
    @ChesterCpt 2 роки тому +4

    Keep making tutorials! You're the best!

  • @katiefrye7489
    @katiefrye7489 Рік тому +1

    I loved this episode its so cool and easy I always watch you.

  • @manreen_harjas3945
    @manreen_harjas3945 Рік тому +1

    LEZ GGOOOOOOO NEW VID

  • @YouthExploreStudy
    @YouthExploreStudy Рік тому

    Your tutorial was awesome, but I have a question is the Movecamera custom block run without screen refresh or not?

  • @kayrayaynda9144
    @kayrayaynda9144 2 роки тому +1

    That's awesome!

  • @baotubs
    @baotubs Рік тому +1

    Keep up the good work!

  • @blup9997
    @blup9997 9 днів тому +2

    I have bug i encountered that the enemy hitbox doesnt work they still merge into eachother and stops moving,its not noticable in your game becuase the enemies are just squares with the same color but in my game they have actual costumes so its very noticable

  • @sweazerelli4311
    @sweazerelli4311 4 місяці тому

    My bad but I went back to try and your this tutorial because it was like the first thing I tried just to get the hang of it that I saw to mess up scratching it was a bad.. but now I've actually made it work cuz I got a little bit more knowledge but I am having a problem still with the switch of the icon but big thank you big big help your back you're the best

  • @savagecatdev
    @savagecatdev 2 роки тому +2

    Scratch Speedrun lol i like that you code fast though other youtubers are so slow i have to skip some of the video to actually start coding

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +2

      LOL, awesome! It can be hard to find a good pace to record- on one hand I don't want to go really fast because people wouldn't be able to follow, but if I go really slow, the video will be 1000 hours long xD. Thanks for the comment! :D

  • @isuckatvideos3089
    @isuckatvideos3089 3 місяці тому

    Hey, idk if the enemies are supposed to be stuck together or not for collision, when i made collision they are just stuck together or not. Very good tutorial. It helped me learn new movement and all

  • @AVeryRandomDude
    @AVeryRandomDude 2 роки тому +2

    Hi, I watched but I forgot to comment!!!

  • @AestheticGamerJourney
    @AestheticGamerJourney 2 роки тому +2

    awesome thx!

  • @Therealbluu
    @Therealbluu 2 роки тому +2

    awesome tutorial

  • @Toptizz
    @Toptizz 2 роки тому +2

    AWSOME

  • @shahinma221
    @shahinma221 2 роки тому +2

    imma shot the like button

  • @Kilvu
    @Kilvu 2 роки тому +2

    Amazing :D

  • @muhammadfazil5179
    @muhammadfazil5179 2 роки тому +2

    Late night right now. Seeing this vedio 2 hrs after upload

  • @williambaldwin8763
    @williambaldwin8763 Місяць тому

    Very helpful! But, what if I have different enemy types? How would the collisons work for the different sizes and shapes?

  • @elFranCiscoJelCR4CK2000
    @elFranCiscoJelCR4CK2000 9 місяців тому

    is possible to do that the bullet goes offscreen and damage the offscreen enemies?

  • @dunnomynameso746
    @dunnomynameso746 2 роки тому +2

    Just finished watching part 1 and realized this was uploaded a few hours ago lol

  • @__tinhvuvuong
    @__tinhvuvuong 7 місяців тому

    100/10
    good video:)

  • @norainirapee832
    @norainirapee832 2 роки тому +2

    Just a little curiosity, how do u make the enemies shoot bullets and stuff. I kinda need tht tutorial honestly

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +1

      Ooh, that would take some math for sure, similar to the move steps custom block... That's a good tutorial idea! Thanks! :D

  • @dudechase5661
    @dudechase5661 2 роки тому +2

    thank you

  • @chonker5070
    @chonker5070 Рік тому +1

    Whenever I get close to an enemy, to enemy it glitches side to side. Is there any way to fix it?

  • @DuySHOA
    @DuySHOA 2 роки тому +2

    Hello my friend. Video hay quá.

  • @NoobGuy621
    @NoobGuy621 Рік тому

    quick question - Like you made a move block that works with scrolling can you give me code for gliding block that works with scrolling?

  • @scnhappytunes1800
    @scnhappytunes1800 2 роки тому +2

    I love you videos!!!!!!!!!!!

  • @scnhappytunes1800
    @scnhappytunes1800 2 роки тому +2

    you got it! :D

  • @anasoares9366
    @anasoares9366 2 роки тому +2

    I have a solution for Enemy Collisions, make a variable, name it MYSELF with the name of the sprite, and inside the touching (…)? Block, put the variable in the string input.

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      Woah, will that work? I'll look into that! Thanks for the tip! :D

    • @smg400v5
      @smg400v5 Рік тому

      I tried it and the enemies were still colliding but they were also still chasing me.

  • @pboltz2706
    @pboltz2706 Рік тому +1

    I found a problem in the collisions, if the sprite was a circle the collision code gets buggy like i saw some enemies overlapping each other, is there any way of fixing this?

    • @ShiftClickLearn
      @ShiftClickLearn  Рік тому

      Hmm, maybe try making the collision detection costumes curved as well? I'm not sure if that will work tho...

    • @pboltz2706
      @pboltz2706 Рік тому

      It kinda work I just need to update the collision code I guess thanks!

  • @sannillangamagerishongebri2820
    @sannillangamagerishongebri2820 2 місяці тому

    the particle script doesn't work when I kill a monster in my game the particle spawn somewhere else and does not do that cool explosion effect

  • @misterdot6923
    @misterdot6923 2 роки тому +2

    YES

  • @enzo_6416
    @enzo_6416 2 роки тому +2

    coolio

  • @DamageTick
    @DamageTick Рік тому +1

    can you make a tutorial on particles coming from dead clones. i am trying to make a zombie shooter game and i want to add some polish, but these particles don't work for me as i have a fixed camera and not a moving one like you.

    • @ShiftClickLearn
      @ShiftClickLearn  Рік тому

      Did you try hiding the clone then creating the particles?

    • @DamageTick
      @DamageTick Рік тому

      @@ShiftClickLearn my particles are working just fine now. i had to teach myself how to use lists, but now they seem to work. if you could make a tutorial on particles without a scrolling background that would be amazing.

  • @nuratlamos8541
    @nuratlamos8541 2 місяці тому

    When I make the minimum size the enemys become big how do I fix that?

  • @penguinpenguin3156
    @penguinpenguin3156 2 роки тому +5

    I hope you add multiplayer it would be fun!Or you can do a other tutorial

  • @ItsJustTim
    @ItsJustTim 2 роки тому +1

    @ShiftClickLearn Whenever I Shoot A Enemy All Of The Other Enemies All Get To The Same Size As The Enemy I Shot, Is There Any Way To Fix This?

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      Ooh, did you make the health variable for this sprite only? Otherwise, ALL of the enemies will share the same health variable.

    • @ItsJustTim
      @ItsJustTim 2 роки тому

      Yes Got It Working Thanks For The Advice (I Love Your Vids Btw My Favs Are The 1 Episode Game Ones!)

  • @AVeryRandomDude
    @AVeryRandomDude 2 роки тому +1

    Little bug: If you go all the way to the left or right or any direction that are far away from spawn, enemies will spawn really far to you
    I think to fix this, you need to set the x and y spawn that pick random from the player current x and y

  • @Forest_turkey
    @Forest_turkey 4 місяці тому

    yoo bro whenever i move the the enmy changes back to false why does that happen

  • @PhatBastard-oi9pm
    @PhatBastard-oi9pm Рік тому

    question: if i were to make a wave based shooter using the same scripts, would it function the same?

  • @zancrniveckalar2593
    @zancrniveckalar2593 2 роки тому +2

    super helpful, but I still can't manage to add wall collision. Any tips?

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +1

      I would first remove the movement from this game and replace it with the movement from the wall collision tutorial! :D

    • @zancrniveckalar2593
      @zancrniveckalar2593 2 роки тому

      @@ShiftClickLearn yeah, the movement in this tutorial is made to be a bit more smooth, would the movement from the collision tutorial still work with everything else (enemies, bullets...)

  • @harishankar-fh4wv
    @harishankar-fh4wv 2 роки тому +2

    Hey can you make an RPG series tutorials

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +1

      That would be really cool! I have something else planned tho... ;D

  • @TherealSTAR_BOUND
    @TherealSTAR_BOUND 7 місяців тому

    Can you make one for something similar to 20 minutes till dawn

  • @ytgaming-gd6gq
    @ytgaming-gd6gq 3 місяці тому

    The bullets when i shot it kept going up so I made the speed different and steps but thanks for this i keep wanting to learn

  • @yehtetthar9949
    @yehtetthar9949 Рік тому

    indeed very nice i thought im not gonna make it because the bullet didn't come out of the gun it just gone over it but i just realized i have to change the direction of the bullet to 0 the it come out of the gun

    • @yehtetthar9949
      @yehtetthar9949 Рік тому +1

      HEREEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE GOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!

    • @ShiftClickLearn
      @ShiftClickLearn  Рік тому

      nice....

  • @kaustubhshrestha1265
    @kaustubhshrestha1265 2 роки тому +1

    you should make a studio like griffpatch for the project

  • @Whateverwhatever648
    @Whateverwhatever648 Рік тому

    Hey you don;t have to do this but I would like it if you made a video where if there is a object in the enemy ai view then they won’t follow you

  • @qwertyuiopasdf160
    @qwertyuiopasdf160 2 роки тому +1

    Time to copy-paste and change the texture and call it my game

  • @JackNoEyes
    @JackNoEyes 7 місяців тому

    Would it be possible to make a scratch shooter game where the enemies shoot at you without needing a ton of sprites?

    • @parkerdedrick8967
      @parkerdedrick8967 7 місяців тому

      There aren’t many sprites 💀

    • @parkerdedrick8967
      @parkerdedrick8967 7 місяців тому

      But yes. It would be possible.

    • @JackNoEyes
      @JackNoEyes 7 місяців тому

      I mean like making the enemies bullets all clones that come from cloned enemies, sorry for the confusion and thanks for replying @@parkerdedrick8967

  • @ytgaming-gd6gq
    @ytgaming-gd6gq 3 місяці тому

    When i tried to make enimes move they stay still please help

  • @Lakon_Two
    @Lakon_Two 10 місяців тому

    Can someone tell me how to make the enemies smaller?

  • @doomdead165
    @doomdead165 Рік тому

    this was really good but only 1 enemy was moving with the camera

  • @NRGWILL44
    @NRGWILL44 Рік тому

    I copied the code for camera movement but it doesn't seem to be working. anyone got any tips?

  • @thederbly6009
    @thederbly6009 Рік тому +1

    How can you add wall collision in this?

    • @ShiftClickLearn
      @ShiftClickLearn  Рік тому

      I have a tutorial on wall Collison! You'd basically replace the movement shown in this video with my other tutorial. Here: ua-cam.com/video/OmRh6SXoI0Y/v-deo.html

    • @thederbly6009
      @thederbly6009 Рік тому

      Thanks

  • @Frogster08
    @Frogster08 3 місяці тому

    5:45

  • @kathleenwyner
    @kathleenwyner 29 днів тому

    can anyone help?? the icon stuff for the enemies isn't working

    • @kathleenwyner
      @kathleenwyner 29 днів тому

      please i have to submit this tomorrow for my final

  • @ThatHPfan
    @ThatHPfan 4 місяці тому

    Does not work my enemies keep spawning on my player 4:48

  • @soap_.47
    @soap_.47 Рік тому

    the "costume" code wont work correctly

  • @notsamm43
    @notsamm43 2 роки тому +2

    HOLA!!!!!

  • @TERRABLADE-uy7bh
    @TERRABLADE-uy7bh 9 місяців тому +1

    a small bug: the enemies still collide with the offscreen enemies

  • @m7f2t9
    @m7f2t9 10 місяців тому

    my scrolling is not working Please help me

  • @gluciorek1491
    @gluciorek1491 2 місяці тому

    THE GUN IS STUCK WHEN I GO TO LEFT OR RIGHT

  • @yosephdawson7045
    @yosephdawson7045 2 роки тому +2

    430 viewvs 7 hrs ago Ayo 😳

  • @nikshitsharma9671
    @nikshitsharma9671 2 роки тому +1

    The enemies aren't following me, explain please...

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      Did you copy the Move "steps" steps block correctly? (This one: ua-cam.com/video/-XgHyWNaxtk/v-deo.html )

    • @nikshitsharma9671
      @nikshitsharma9671 2 роки тому

      @@ShiftClickLearn, Yes. I did...

  • @YouthExploreStudy
    @YouthExploreStudy Рік тому

    I found I little bug, that is enemies can get stuck from icons, I think because they are in the same sprite.

    • @scary_daddy
      @scary_daddy Рік тому

      Yeah, at the moment my enemies are also stuck as icons, Scratch must've had an update that changed something

  • @deansomes6254
    @deansomes6254 Рік тому

    Good tutorial but if you could do it a little slower that would be much apprisheated

  • @SUPY_
    @SUPY_ 2 роки тому +1

    Add recording system or bad

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      0-0 lol

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      good idea

    • @SUPY_
      @SUPY_ 2 роки тому

      @@ShiftClickLearn It is actually easy, for player just store every single move and shoot for enemy store enemy type and time when enemy spawned. And for playing recording just disable moving skript and enemy spawn loop, moove player according to list and spawn enemy according to its list. Enable other game loop skripts

  • @ITZME10101
    @ITZME10101 2 роки тому +2

    61th veiw and 13th like

  • @muhammadfazil5179
    @muhammadfazil5179 2 роки тому +2

    29th like

  • @Marco-kl7ds
    @Marco-kl7ds Рік тому +1

    hi

  • @irfansyahmin697
    @irfansyahmin697 Рік тому

    This video cuts a lot, I couldn't catch up most of it.. Hopefully, you fix this..

  • @marcusfelberbaum3629
    @marcusfelberbaum3629 2 роки тому +2

    Your Tutorials Are Really Good But Can You Speak Slowly.

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +2

      Thanks! Sorry about that- if you need, you can slow the video down. (Settings > Playback speed > 0.75 or 0.5)

    • @marcusfelberbaum3629
      @marcusfelberbaum3629 2 роки тому +1

      @@ShiftClickLearn Thankyou

  • @Forest_turkey
    @Forest_turkey 4 місяці тому

    wwooooowww i'm commenting on my own videooooo

  • @lifelonglist2136
    @lifelonglist2136 Рік тому +1

    bro went to fast i messed up my whole project and cant fix it

  • @Rthbtynyjmmbfgrvtrg
    @Rthbtynyjmmbfgrvtrg 3 місяці тому

    Bruh, there is one more like until it is 666😂😂😂

  • @riddleworld1618
    @riddleworld1618 2 роки тому +1

    69 not op

  • @Achrylis
    @Achrylis 11 місяців тому

    The enemy's still stupid tho

  • @Heillygamings
    @Heillygamings 11 днів тому

    hard please easier

  • @moumitasil6757
    @moumitasil6757 7 місяців тому

    😠

  • @BiscutGameplay
    @BiscutGameplay 3 місяці тому

    This is very laggy

  • @ananemy7517
    @ananemy7517 2 роки тому +1

    I always click on dislike even tho i love it :/

  • @TheRealKensterBoosteryt
    @TheRealKensterBoosteryt 2 місяці тому +2

    Bad tutorial. Went too fast. All the enemies spawn in a line and won’t move when I move. All bc you rushed.

  • @NinjaCoconutoffical
    @NinjaCoconutoffical Рік тому

    I am dissapointed. You are lying. Is not working and link for game is not real.

  • @AVeryRandomDude
    @AVeryRandomDude 2 роки тому +1

    Me seeing 10:44
    Take the number counter from the backpack (made by griffpatch, go check him out) and got the job done, 100% center!

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      Griffpatch's number counter is good! (You could also use mine hehe.) :D

    • @AVeryRandomDude
      @AVeryRandomDude 2 роки тому

      @@ShiftClickLearn I will use yours cuz this is your game :D