Player Collisions + Wacky hitboxes! 🐱 Scratch RPG #8

Following on from defining our Collision Pins in episode 7, we now finally add the player collision code to make it real! These collision pins support both hairline edge collision boundaries, and half tile collisions!
We do some clever tricks to invert the hitboxes, support overlapping collision pin regions, and span tile layers! This is one crazy awesome episode, and I just know you are going to love it! Our Scratch RPG game is really shaping up!
Let's learn to code in Scratch with Griffpatch - Create your own fun Scratch game with these step by step instructions with friendly explanations.
🚀 Boost Your Creativity with Griffpatch
The Griffpatch Academy will take you from "Gamer to Game Creator"
Learn more at 👉 griffpatch.academy 👈
😺 Scratch was developed by the Lifelong Kindergarten Group at the MIT Media Lab. See scratch.mit.edu
👀 Episodes in the series:
Ep.1 - Craft your dream Scratch Game - • RPG Tutorial | Craft y...
Ep.2 - Infinite Scrolling & Tiles - • 🐱 Infinite Scrolling &...
Ep.3 - I AM SPEED - • ⚠️ LAG FREE Scrolling ...
Ep.4 - Build a LEVEL EDITOR in Scratch - • Code a LEVEL EDITOR in...
Ep.5 - Split Screen & Multi Tile Assets - • EDIT FASTER ⚡ Tile Tra...
Ep.6 - Layers & Onion Skinning - • LAYERS 🧅 "Onion Skinni...
Ep.7 - Collisions Pins - • Collision Pins? 💥📌 Now...
Ep.8 - Player Collisions - • Player Collisions + Wa...
🐱 Scratch Starter Projects with Assets - Remix this!
scratch.mit.edu/projects/7255...
🐱 Scratch Studio for Your projects
scratch.mit.edu/studios/32038...
-------------Video Chapters-------------
0:00 Intro
1:13 Try Move - Yes or No?
2:55 Split movement into two stages
5:10 Basic Tile Collisions
9:05 Differentiating Solid / Non solid tiles
10:39 Collisions across multiple layers of tiles
12:34 Detailed Pin Collisions
13:38 Calculating the first pin under the player
16:10 Colliding with our first pin
18:50 How to handle the overlapping pin regions
20:00 Coding pins 3 & 6
21:59 The top row of pins; 7 & 8
25:33 Outro

Пікірлер: 590

  • @ItsrealOJ
    @ItsrealOJ Жыл бұрын

    when clicked say "Scratchmazing afternoon I just got home from school we've Finally Got Collisions And I am Better than ever More things we need: -NPCs -Interiors (like coming in and out of houses) -Enemies Like Zombies So we can use the final costumes -Naturally Generated Trees/Buildings -and SOOOOOOOOOOOOOO Much more " also dunno why you would pin this but why not

  • @ItsrealOJ

    @ItsrealOJ

    Жыл бұрын

    OMG GRIFFPATCH YOU ACCTUALLY PINNED IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @dotYT1396

    @dotYT1396

    Жыл бұрын

    @Don't read profile photo as if no one knoows this trick.

  • @error404subscribersnotfound

    @error404subscribersnotfound

    Жыл бұрын

    @Don't read profile photo nope, not reading it

  • @PeppermintOSC

    @PeppermintOSC

    Жыл бұрын

    @Don't read profile photo ok

  • @snowflake870

    @snowflake870

    Жыл бұрын

    @Don't read profile photo ok i wont

  • @blup9997
    @blup9997 Жыл бұрын

    if griffpatch was a teacher he would be a good one

  • @isaacparsons2731

    @isaacparsons2731

    Жыл бұрын

    Isn't that what he is doing with videos?

  • @OfficialGowilaVR

    @OfficialGowilaVR

    Жыл бұрын

    @@isaacparsons2731 he means a school teacher

  • @Wall_nut77

    @Wall_nut77

    Жыл бұрын

    True

  • @user-tu7ph8kf3z

    @user-tu7ph8kf3z

    10 ай бұрын

    100% agree

  • @user-wi8od5rc4m

    @user-wi8od5rc4m

    7 ай бұрын

    I mean he kinda is

  • @heywoodfamily82
    @heywoodfamily82 Жыл бұрын

    I used to think the perfect tutorial never existed until I watched you griffpatch! Thanks for spending your time and life helping us out.😃

  • @Sharp2006
    @Sharp2006 Жыл бұрын

    It brings a smile to my face when griffpatch posts😊 I’m super excited for collisions 😁

  • @omarscomments
    @omarscomments Жыл бұрын

    Woohoo!!! We're at episode 8!!! And what a journey it has been! Thanks to GRIFFPATCH!!!

  • @crackerpooppop
    @crackerpooppop Жыл бұрын

    Yay! Couldnt wait for this. Griffpatch is the best KZreadr without a doubt!!

  • @1080GBA_SC
    @1080GBA_SC Жыл бұрын

    Griffpatch! Your video made my day!! Your method of coding those hitboxes amaze me!

  • @caldrenate
    @caldrenate Жыл бұрын

    With this skill, it won't surprise me if Griffpatch does Ep. 4 of the Text Engine Series...and do it well, too!

  • @aarizkhan9101
    @aarizkhan9101 Жыл бұрын

    Loved the video griffpatch! Can't wait for episode 9! Keep up the good work!

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Thank you!

  • @Aakif.Nawshad
    @Aakif.Nawshad Жыл бұрын

    Wow, I used scratch a lot as a kid and I still do. You were the source of my inspiration since the beginning, I watched many of your tutorials and it's just wonderful that you continue this journey. Thank you griffpatch!

  • @griffpatch

    @griffpatch

    Жыл бұрын

    So cool, thank you

  • @Aakif.Nawshad

    @Aakif.Nawshad

    Жыл бұрын

    @@griffpatch wow, he replied, that was my lifes mission.

  • @darkergen
    @darkergen Жыл бұрын

    Yes! I have been waiting so long! Thank god this was uploaded early! I feel like the next episode might be auto layering!

  • @JaiLeeroy

    @JaiLeeroy

    Жыл бұрын

    Oh ya! Forgot about that feature.

  • @Redcraft7578
    @Redcraft7578 Жыл бұрын

    I am going to follow this tutorial NOW. Was just playing an instrument and saw this notification. really looking forward to making this.

  • @TheOfficialAndGayBucket
    @TheOfficialAndGayBucket Жыл бұрын

    the good thing about your tutorials is that they can be used for really any programming language as long as you know what you're doing!

  • @LostDeveloper871

    @LostDeveloper871

    Жыл бұрын

    True!

  • @christelle5782
    @christelle5782 Жыл бұрын

    Yeay ! I love this series and all other ! So cool !

  • @dcruan6771
    @dcruan6771 Жыл бұрын

    This is really cool and it actually works! Thanks for making tutorials!

  • @tommyanepicgameer
    @tommyanepicgameer Жыл бұрын

    YAY this is the best thing! 🎉 Thanks Griffpatch!

  • @griffpatch

    @griffpatch

    Жыл бұрын

    You're welcome!!

  • @real_kryzz
    @real_kryzz Жыл бұрын

    Wow i never imagined i would go this far, thanks for the tutorials!

  • @Napilikeswaterloo
    @Napilikeswaterloo7 ай бұрын

    i always like how chaotic the intro is and then he says: "so lets get scratching!" and that always gets me exited!!

  • @JoeFly2009
    @JoeFly2009 Жыл бұрын

    Thanks! In my old projects I detected collision with the color of sprites... that is way better!

  • @N64Mario
    @N64Mario Жыл бұрын

    I feel like now that we have the collision pins working, we can now expand on this, and explain to us about the different colored pins I assume that was used for things like bridges and ladders. I suppose would be the time to explain about animated tiles for things like the water, and any camp fire logs. Oh yea, we still have to add transitions for inside houses and dungeons. There's just so much to teach about in this series. Though I must say, thanks for all of your hard work! You are an excellent teacher & showing us your thought process for the RPG series!

  • @griffpatch

    @griffpatch

    Жыл бұрын

    I appreciate it :D

  • @NeonG4

    @NeonG4

    Жыл бұрын

    And AI characters! That would be fun.

  • @grupoultimointentoofficial5428
    @grupoultimointentoofficial5428 Жыл бұрын

    griffpatch i love playing your games and i've been doing your Scratch RPG tutorials and i am almost done.

  • @tanulearns
    @tanulearns Жыл бұрын

    ❤ Another amazing video by the legendary griffpatch! Here are some ideas for the next few episodes: Adding a text engine Activating the sword costumes NPCs Interiors Enemies and Health Bars Intro screen Full screen editing Keep going, you rock!

  • @Resseguie
    @Resseguie Жыл бұрын

    I love the approach teaser at the beginning.

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Thanks! I poured everything into this video - It's always hard to think of a good title, thumbnail to draw people to the video, and then an engaging first 30 seconds or so to keep them from clicking away! :)

  • @Gaigoomee
    @Gaigoomee Жыл бұрын

    Amazing tutorial! I can't wait now to create an inventory system with collectible items, tools and crafting, and NPCs that we can talk to and enemies we can fight. I would also like to make ladders and bridges functional, and to add buildings that we can go into with intractable tiles inside like signs, furnaces or chests. To top things off we could add animated and moving tiles, but besides that I really think these things will turn this RPG engine into a full game.

  • @griffpatch

    @griffpatch

    Жыл бұрын

    So many thing hehe :)

  • @peejoegaming2660

    @peejoegaming2660

    Жыл бұрын

    @@griffpatch Hi Griffpatch :) I loved you videos and tutorials :)))

  • @scratchlover8513
    @scratchlover8513 Жыл бұрын

    Great vid man I can't wait for the future of this 😎

  • @demirkaanbedelminiondisco
    @demirkaanbedelminiondisco Жыл бұрын

    awsome! Super collisions!

  • @FNAAOQP
    @FNAAOQP Жыл бұрын

    Nice, Griffpatch!! Keep it on!

  • @ivankatic8332
    @ivankatic8332 Жыл бұрын

    Yes! Another episode!

  • @WatchThis1_2
    @WatchThis1_28 ай бұрын

    this is so cool keep going!

  • @breadhead46_
    @breadhead46_ Жыл бұрын

    I'm finally caught up and WOW was that a journey! I'm definitely using this for my project (don't worry I'll include credit)

  • @labrosmatsas
    @labrosmatsas Жыл бұрын

    I can't wait for the next tutorial!!!

  • @EndaWida
    @EndaWida Жыл бұрын

    What i think griffpatch's next tutorials on this will be: -NPCs -Houses + Furnishing -Block animation -How to make a game out of this -Coins? -Effects (light, dark, water, etc.) -4th layer!?!? -Layer climbing -Level editor 3!?!? -uuuhuh more yep totally accurate...

  • @NeonG4

    @NeonG4

    Жыл бұрын

    I thought of a fourth layer as a pin collection for all the pins, then you only have to check one layer for pins instead of 2, slightly faster.

  • @sushi_boi5045
    @sushi_boi5045 Жыл бұрын

    😁 these are the best scratch tutorials

  • @CorranEveryone
    @CorranEveryone Жыл бұрын

    Collisions YAY!😆

  • @EncryptedShorts
    @EncryptedShorts Жыл бұрын

    this is so helpful! tysm!

  • @wiseowl83
    @wiseowl83 Жыл бұрын

    This video looks great!

  • @SaiponathGames
    @SaiponathGames Жыл бұрын

    Keep up the good work man!

  • @imthechampion
    @imthechampion Жыл бұрын

    I made it so far in this series and I taught I have to manually input the pin!

  • @ulricoiho420
    @ulricoiho420 Жыл бұрын

    your thumbnails are always the best

  • @shark-vf3pv
    @shark-vf3pv Жыл бұрын

    Yessssss 🎉🎉🎉🎉 Edit: we also need to add room/scene switching (like houses) Edit 2: what’s the plan for ep 9?

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Yes we do!

  • @wiseowl83

    @wiseowl83

    Жыл бұрын

    Perhaps full screen editing? I do think he mentioned that in a previous episode and it would make sense since he uses “editor > 0” to check for editor instead of “editor = 1”

  • @darkergen

    @darkergen

    Жыл бұрын

    @@wiseowl83 he might not since in his devlog he planned to have full screen editing but changed it to half screen editing as it was better, but who knows?

  • @writethatdown100

    @writethatdown100

    Жыл бұрын

    I think that in ep 9 it will be showing default layers when placing tiles, like some tiles will automaticlly be on layer three so you don't have to manually do each one

  • @NeonG4

    @NeonG4

    Жыл бұрын

    @@writethatdown100 That would be nice.

  • @ernestrieu5220
    @ernestrieu5220 Жыл бұрын

    I like that he puts easter eggs in his videos. Like or or or guy.

  • @jbrieu

    @jbrieu

    Жыл бұрын

    I never see them !

  • @PazuVlogsYT
    @PazuVlogsYT9 ай бұрын

    yeah he is a great tutor he has teached me so many things😀

  • @BobChess
    @BobChess Жыл бұрын

    Finally, The better collision solution!

  • @danielroux4645
    @danielroux4645 Жыл бұрын

    so cool just finished tutorial 7 and im loving this im enjoying it so much i know im 7 months late but still XD whenever some1 likes this now ill remember what a great teacher griffpatch is!!

  • @arthurzhg2887
    @arthurzhg2887 Жыл бұрын

    good collisions Griffpatch :)

  • @arthurzhg2887

    @arthurzhg2887

    Жыл бұрын

    How about good RPG like -NPC move & direction -Opening gate or door animate -Campfire animate -Inventory & Survival health -Joining RPG player good luck😄😄😄

  • @azzamshahzad
    @azzamshahzad Жыл бұрын

    The thumbnail XD

  • @johnxu2334
    @johnxu2334 Жыл бұрын

    YAYAYAYAYAYAYAYAYAY!!!! I LOVE THIS thank you! AWesome!

  • @Kefachuk
    @Kefachuk Жыл бұрын

    Amazing assets! This is IMPORTANT video.

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Yeah :) 💥

  • @zecrok3000
    @zecrok3000 Жыл бұрын

    YEEEEES, I want to do scratch now!

  • @TheSumOfAnIdeod
    @TheSumOfAnIdeod Жыл бұрын

    Hi, love your tutorials

  • @TheNewDev09
    @TheNewDev09 Жыл бұрын

    Finally The video comes yay!

  • @pessskychaos4874
    @pessskychaos4874 Жыл бұрын

    Awesome!

  • @Astralities
    @Astralities Жыл бұрын

    Best one yet. When griffpatch makes merch, we NEED a t shirt that says 'Bug SQUASHED!' It justs seems cool ok?

  • @FAchicken
    @FAchicken Жыл бұрын

    The g in griff patch stands for ‘great editing’

  • @Stunt7
    @Stunt7 Жыл бұрын

    The RPG is so cool!

  • @jean-ernestinlapioche3638
    @jean-ernestinlapioche3638 Жыл бұрын

    Fantastic 🎉🎉

  • @Ninjabuster2k
    @Ninjabuster2k Жыл бұрын

    I just can't wait for the text-engine support tutorial! Edit: Also when will we cover animated tiles like the water?

  • @vaguedestruction

    @vaguedestruction

    Жыл бұрын

    Just copy the code for text engine to your game

  • @TheOffspringy

    @TheOffspringy

    Жыл бұрын

    @@vaguedestruction bro no need to be so toxic abt it

  • @star80doessdastuff

    @star80doessdastuff

    Жыл бұрын

    @@TheOffspringy yeah I agree that was really mean

  • @vaguedestruction

    @vaguedestruction

    Жыл бұрын

    @@TheOffspringy ok sorry its just you can copy and paste code its not hard Edit: whAt ToxEDIC i DifNT b3 ToXiC noT Lik3 I eDitEd mY Th1ng

  • @gabenugget114

    @gabenugget114

    Жыл бұрын

    For animated sprites you can do (forever: next costume wait(fps in seconds) seconds)

  • @HurelyDev
    @HurelyDev Жыл бұрын

    Episode 2 felt like it came out yesterday.... And now its episode 8!!!!!!!!!

  • @revelnic
    @revelnic Жыл бұрын

    Cool!

  • @DPoly
    @DPoly Жыл бұрын

    Cheers Griffpatch!

  • @griffpatch

    @griffpatch

    Жыл бұрын

    My pleasure!

  • @Marc_659
    @Marc_659 Жыл бұрын

    THIS SERIES IS GETTING AWESOME

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Thank you

  • @F1pyrotechnics

    @F1pyrotechnics

    Жыл бұрын

    @@griffpatch hey im stuck, i cant get the basic collisions to work for some reason

  • @user-dk8yz9io4h

    @user-dk8yz9io4h

    5 ай бұрын

    me too@@F1pyrotechnics

  • @oliverjudson1834
    @oliverjudson1834 Жыл бұрын

    Hello griffpatch its always nice when you upload

  • @sonickirb
    @sonickirb Жыл бұрын

    I have been waitting sooo long to add collisions, before this episode i even tryed coding it myself! Thank you SO much griffpatch!! Edit: You are the best griffpatch!

  • @griffpatch

    @griffpatch

    Жыл бұрын

    You're very welcome!

  • @gabenugget114

    @gabenugget114

    Жыл бұрын

    @@griffpatch Hey griffpatch! I really want to make a proper lift, please teach me how to code a lift

  • @gabenugget114

    @gabenugget114

    Жыл бұрын

    @@griffpatch I just remix lift projects and add features, but teach me how to do a full lift by scratch

  • @hubertbosak2900
    @hubertbosak2900 Жыл бұрын

    It's very coll!!! 😆😆😆

  • @JkVidsChannnel
    @JkVidsChannnel Жыл бұрын

    Hi griffpatch! I love your videos. You do such a great job making tutorials! Maybe something that could be cool is if we added sound effects like walking on the grass and running into objects, just an idea. Have a great day!

  • @JkVidsChannnel

    @JkVidsChannnel

    Жыл бұрын

    Also it would be cool to add the default layer feature!

  • @LegendBLADER14
    @LegendBLADER147 ай бұрын

    Bro this is the teacher we all wanted

  • @themechanicalpenguin2209
    @themechanicalpenguin2209 Жыл бұрын

    Collisions!!!!! Yay!!!

  • @pixelgaming7261
    @pixelgaming7261 Жыл бұрын

    If you could add save codes, that'd be great! Awesome tutorials - keep up the great work!

  • @-CosmoCode
    @-CosmoCode Жыл бұрын

    griffpatch: releases a new tutorial fellow scratchers: WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOWWWWWW!!!!!!!!!!!!!! =D

  • @FeniteFr
    @FeniteFr Жыл бұрын

    OMG we have already a new episode woohoo !! I haven't followed the episode 7 yet : I try to do that we can zoom in and zoom out but that's VERY HARD !! I didn't anticipate that

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Good on you! That's a cool feature to add!

  • @Gaming32i
    @Gaming32i Жыл бұрын

    You could publish the collision pins data for the default tileset so that we don't have to do it as well.

  • @FeniteFr
    @FeniteFr Жыл бұрын

    I can't wait to have a new episode of the text engine serie ! Please do episode 4 !!

  • @zachmann2911

    @zachmann2911

    Жыл бұрын

    to be honest, technically the text engine series doesnt exist. its in the scratch rpg series

  • @FeniteFr

    @FeniteFr

    Жыл бұрын

    @@zachmann2911 yes :)

  • @vaguedestruction
    @vaguedestruction Жыл бұрын

    griffpatch, soon we're gonna have to add animated tiles like water and campfires. Right now, you can just place any frame of the animation and it doesn't even animate

  • @waldofabian1202

    @waldofabian1202

    Жыл бұрын

    Don't worry, I can tell you how to do that.

  • @gauravs9875
    @gauravs9875 Жыл бұрын

    LOVE UR VIDEOS 😇😇

  • @titan_burn_gaming_yt
    @titan_burn_gaming_yt Жыл бұрын

    My likely for next few episodes: (9-12) Auto Layering - Controled by player in a way like the pins. Full Screen Editior Sub World/Area (Going in houses) Ideas: for 13-15 Random Spawning of large structurs Entity spawning Attack Scripting + animation

  • @alloftheabove123productions
    @alloftheabove123productions Жыл бұрын

    AWESOME!!!

  • @TheMakerKineMasterTMKM192
    @TheMakerKineMasterTMKM192 Жыл бұрын

    (16:16) There Guy!

  • @anasoares6476
    @anasoares6476 Жыл бұрын

    Wow! i thought this tutorial was going to be complex! Also i have a suggestion, when you find a tile, can you make the editor menu scroll to where its located?

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Will it kind of is, but I did my best to make it feel simple

  • @phoomsgamingvid8943
    @phoomsgamingvid8943 Жыл бұрын

    This is epic

  • @gaviaonoturno994
    @gaviaonoturno994 Жыл бұрын

    Hi! I'm a Brazilian Scratcher user and I follow you here, I like your work on youtube. I would like to ask you to recreate the Lemonoids game, but this time do it in an open map. I intend to mount planetary systems on it. Thank you very much in advance! Thanks!

  • @fortniteog_yt8039
    @fortniteog_yt8039 Жыл бұрын

    Epic 😀

  • @titandriil_man294
    @titandriil_man29429 күн бұрын

    8:08 idk why but "the set solid to 1" is making my player a non-moving character

  • @DeguProductions
    @DeguProductions Жыл бұрын

    Nice video!

  • @griffpatch

    @griffpatch

    Жыл бұрын

    Glad you enjoyed it

  • @tronche2cake
    @tronche2cake Жыл бұрын

    I caught the platformer character at 16:17, and a meow at 21:56

  • @Metromex_386
    @Metromex_386 Жыл бұрын

    Wow! The series are getting so fun and exciting! There is is still the text engine and doors collision. Also, I think you made a mistake in your editing and spelled a word wrongly. Nvm that, Please continue your hard work in your videos! 🙏

  • @zensure3168
    @zensure3168 Жыл бұрын

    Can you do a guide on the different sections of code and maybe go over what each block of code does?

  • @einfabo
    @einfabo Жыл бұрын

    thx

  • @chowpakheijaden6868
    @chowpakheijaden6868 Жыл бұрын

    When you walk up to tile 117's right, there is a big gap, and also you can go into its top. But tile 115 is fine.

  • @villeolof2000
    @villeolof2000 Жыл бұрын

    Yay!

  • @misterdot6923
    @misterdot6923 Жыл бұрын

    llitterally amazing

  • @NonaSoft4274
    @NonaSoft42748 ай бұрын

    nah that thumbnail weird

  • @wojtekgame
    @wojtekgame Жыл бұрын

    The Scratch Cat has gone to Gym!

  • @user-td8gm1tu1q
    @user-td8gm1tu1q Жыл бұрын

    This is SO awsone but what I would really like to learn how to do is tiles that damage the character or inflict negative status effects!

  • @Edilprt
    @Edilprt Жыл бұрын

    wow class

  • @widyaperwitasari1983
    @widyaperwitasari19832 ай бұрын

    Yayayaya i can ...... throught the tiles😂😂😊

  • @ianfarquharson2933
    @ianfarquharson2933 Жыл бұрын

    something that I would like to say, if I already made a tile based game by myself, and found this series, I would like to just watch 7 and 8. which you also did, what I mean is you can just watch 7&8 instead of the whole series

  • @ls190v2
    @ls190v2 Жыл бұрын

    Mr Hero's head must hurt.

  • @lijelid943
    @lijelid943 Жыл бұрын

    Hi Griffpatch, I've really been enjoying you RayCaster tutorial series, and I wanted to make a suggestion, can the RPG Level Scrolling be implemented into the RayCaster? I think it would be cool to know how to make the levels larger.

  • @_Lostinthesky
    @_Lostinthesky Жыл бұрын

    Hi Griffpatch! I saw your text adventure game you made a couple of years ago and i was wondering if you would make a tutorial series on it if it's not too hard. Thanks! :)

  • @IsItLucas
    @IsItLucas Жыл бұрын

    "Flowers are also solid!" - patch griff, 2022