Collectables & Enemies that Chase | E5. Crazy Fun Raycasting
VloĆŸit
- Äas pĆidĂĄn 13. 07. 2024
- How to add irresistible collectables & Enemies that chase after the player.
This Scratch tutorial on coding a 3D raycaster game is getting so much fun!
We cover enemy wall collisions, and also stop them from walking on top of each other. We add a star collection counter and prepare the ground for a game over screen... Perhaps you guys can take it from here?
đ Part 6 - âą ULTRA FAST Raycasting ...
đ„ Bug Fixes - âą Quick Fixes for Raycas...
Don't forget to submit your projects to the studio linked below by commenting the project URL in the studio comments.
My tutorials are for all budding game & software developers using Code Blocks. Scratch On guys!
đ 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
đ± Scratch Studio for this tutorial - scratch.mit.edu/studios/31089...
đŻ Awesome Number Counters - âą Awesome Number Counter...
đ Part 1 - âą Crazy Simple Raycastin...
đ Full Episode Playlist - âą Crazy Fun Raycasting (...
đ Quick and Fun Tutorials - âą Quick and Fun Scratch ...
â€ïž Scratch Addons - scratchaddons.com/
đč Video Editing Software - techsmith.pxf.io/c/2682566/50...
-------------Video Chapters-------------
0:00 Intro
0:48 Shadow Under Nano
1:39 Pen Length Bug
3:17 Wall Height
4:32 New Entity Types
7:11 Full Screen Map View
9:35 Entity Sizes and Colours
11:38 Enemy Movement, Chasing the Player
13:08 Enemy to wall collisions
14:46 Personally Boundaries
16:05 Sticky Entities
17:29 Player Health
19:32 Collectables
23:13 Collectables Counter
24:27 Outro
đ„BUG FIX đ„
OH MAN - Really sorry, I still messed up the entity costumes. We need to add a switch costume to 'type' in the pen sprite under the "stamp x y" script! - I've added a few other fixes to the same script in a photo under the community tab: czcams.com/channels/awsI_mlmPA7Cfld-qZhBQA.htmlcommunity?lb=Ugkx4DaJzF6Wakuhh_JWIsNMTLlePVAlTEjH - I'll make a video update soon enough, but until then you can use this. So sorry! Scratch on guys!
pin this comment so people see it
Thanks
Cant wait
@@Oatea Arrghh!! I thought it WAS pinned lol
@@griffpatch lol
This is beyond my Scratch ability, but I might even try to do this from episode 1! Thank you for helping the community so much, griffpatch.
You can do it! :D - And it's my pleasure
Get this to 69 likes
@@trackstxar haha the funny number
@@DorukoOFFICIAL xD
@@trackstxar k
I'm not sure if it's the titles or the fact you're showing how to do 3D in Scratch that made this series blow up, but you seem to be doing something right!
I love when griffpatch uploads its just a good feeling
Agreed
Fully Agreed
I've watched every single episode of this series without doing anything. For some reason i just find it entertaining. Maybe it's the editing or it's just your shining personality.
it's the editing
@@Red_impostorYT Both
Yea both
OMG this is an awesome episode !! I'm sure this serie will help me a lot to create my scratch projets, but overall to do things that I never think it was possible to do with scratch !
THANK YOU Griffpatch for all your amazing tutorials ! â€ïžđ„đž
đ
My pleasure - I bet your project will be amazing!
I'm thankful for Griffpatch!
@@griffpatch I really love your videos and games and it would mean a lot to me if you help fix my issue.for some reason my sprite has been rotated and i dont know how to fix it.
Wow this is amazing!! This is a series of yours that went from a short one to a official one!!
Oh god texture mapping would be soo cool! Out of the whole raycasting project this is what i wouldnt know AT ALL if i dont watch the tutorial. Keep it up đ
Every Saturday at around 7:00 (for me) i sit down refreshing griffpatches page so i can see his videos early. I really love your vids!
Every Sunday at around 17:00 (for me) i sit down refreshing griffpatch's page so i can see his videos early. I really love your vids!
And I have notifications on
@@memetech- me2
@@1080GBA me2
@@Fateh_the_genius mewtwo
Fantastic. That depth sorting an entity placement seems like it was a cliff but wow it opens so many possibilities. If I could give a recommendation maybe levels! Specifically for those of us with claustrophobia! If you have any interest in computer science at all this channel is a gold mine!
Yes, thank goodness we got over that... I'm afraid a lot of people may have got stuck on it though :/
Wait
It's You!
What :0
Why did u delete ur vids
I miss your videos
please make your 3d engine videos public again, I'm just missing the clipping part
You could also make, that the Monsters make every few seconds a sound and then put in the Entity Sprite a (set sound to (100-distance to player /1.5))
Then when the Entity Sprite is far away the sound is quiet but if he is in front of you the sound gets louder
Also animate it
aaaaaaaaaAAAAAAAAAAAAAAAAAAAAAA*AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA*
Yeah but wouldn't it make all the sounds quieter/louder?
how about echo
dude i add a scary sound effect now I'm in the corner of my maze
This is so fun. I canât wait for more 3D tutorials. I canât wait to add jumping, and texture, and so much more! Thx so much griffpatch. Iâm sure to take all of this, and make a super cool game out of it. Just you wait.
Two ideas:
1. I'll add a "if DISTANCE to PLAYER" < 50 -----> move ENTITY
The vision of the enemies is kind of unfair
2. Franks will move faster and deal more damage
The can see the map lol
I still love following this and seeing other people projects and it gives me ideas for my 3d game before scratch maze game were not like this thanks to you I can add Enemies you are a life saver
yes
This is honestly amazing! Hope to see more of this project in the future!
Fantastic work! Love your videos,keep it up, thanks for answering all our scratchy questions!
Hello griffpatch! I would like to thank you for doing these scratch tutorials! You helped me a lot and my coding is getting much better! Thank you for everything!
My pleasure - and that's great to hear!
One step closer to recreating doom in scratch
bro i am recreating doom as scratch school project!
already on it mate!
I was doing wolfenstein
If it has a screen, it can run doom
One step closer to recreating the backrooms
oh my god, i still didn't watch the part four and you already posted another one! amazing griffpatch, thanks for tha great content!
Glad you like them!
Great tutorial griffpatch! I have been doing raycasting and similar methods for quite some time now, and I can say you are doing a great job explaining raycasters! Raycasting is extremely tricky at first, leaving many abandoning the subject. However, you make it seem much more simple! What I love most about your tutorials is that they are great for any skill level. Thereâs always something one can learn from your tutorials, wether they are just starting scratch or have been on for a while. Scratch on!
Yay - Thanks for that :D
You are the best Scratcher ever. Your videos really help me in making amazing projects. I have never seen such a good totorial on Scratch ever. So keep going.đ
Wow, thank you!
@@griffpatch đ
Good job GraffPatch. Now you just need to add the textures to the walls or even make a cloud multiplayer raycaster.
Ooh, imagine an online fps game in scratch, that could be amazing, and i can't imagine it'd be too tricky to program
@@snufkin8940 I already made a cloud multiplayer raycaster. I can modify it to make an fps game.
That's not a thing for this raycaster probably. You can do it yourself tho
@@preloadingwastaking I already do horizontal line textures. My challenge is to make a full texture.
I haven't been following this series however after seeing this I am filled with ideas, Thank you.
Thank you, Griffey patch for this video! Youâre video always amazes me!
I did this a bit earlier. But I'm going to see if I can get the enemies to be better for my AI tech demo. For collectibles, they're pretty good. Also, thanks for Sunday!!! I was practically waiting for this to come out XD.
6:42 When this happened, I went, ah crap. I then spent 2 hours trying to fix that bug. My way of fixing it was also very stupid and inefficient. It involved making a new var called type-entity. Making the type var very useless.
How Do You Fix It Correctly, I've Been Watching This Part And I Can't Figure It Out.
@@baconboy1800 same i cant fix it too have u figured it out?
About the health, you could make each enemy give out a set amount of damage in one hit (e.g. Franks do more damage than Nanos) by using invincibility frames instead of doing a small amount of damage but really fast.
im using this tutorial to make a 3d bullet hell and i made the enemies deal a random amount of damage between 10 and 20 for each hit and for stuff that needs to be more damaging it is between 20 to 30
@@karthkalbi1105 is it more an rpg like undertale
Or a horror game like jason
@@leroyloanjoe8777 undertale but in 3d
I made that by going to the when I start as a clone in the entities sprite and added "if type = 2 (franks)" then add a "if touching player" "set health by -(how ever much)" (if you want to) wait 1 second. Then delete the if touching entities script from the player sprite.
griffpatch i love your videos! :D you make my day whenever i need some happiness!
I first did not get the enemy costumes changing, but I find I way to fix it. Great video, I cannot wait for episode 6.
Hey, how do you fix it please Iâm having the same issue
@@Stellar-Insight Griffpatch made a bug fixing video in this RPG series, there he also fixes the bug! :)
please tell how did you fix that
I think it could be wonderful if you can add jumping into the game!
Super video I love this series!
the way that the raycasting works, means you cant jump or look up and down
@@Hyprst yes I know but it can be a new goal to code in this game
@@Hyprst Griffpatch be like: your underestimating me? (creates looking up and down)
it just existed! check out episode 10!
lol@@Kiwi_guy
This is great. I'm loving this series and wouldn't at all mind a few more episodes!
Others have mentioned levels... What about literal levels with a ramp to move up? (Oh, but would Nano and Frank follow you up? đ€)
I'm also loving it!and i don't know how slopes could work in this,i think we wluld have to get very creative to make something similar.
Height
well golly gee go look back at the tile-based platformer and do the whole thing in 3D
or try to express a whole structure by making lists of modelling data
You could only do an elevator, ramps need real 3d
Maybe possible, however would probably be hard due to the fact that our movement is based off of a 2D plane.
TFW
dpruE
Yooo griffpatch ty for the tutorial i have been looking forward to these epic features!
Hi Griffpatch. I have a big request. Please continue this series because we have learnt alot and I mean alot new things in scratch. In episode we mainly focused on collisions which helped me to built a very good platformer game in scratch. Well, in episode 2 we learnt how to make rays an raycasting those. Actually I made a 3d maze and it sucked alot and people hated it!!! But I had remodeled it and it is pretty good. When I thought it was the end of the series you uploaded episode 3, in which we learnt how to make and bring a 2d sprite into the 3D world by drawing it. In episode we learnt to raycast through lists. We learnt alot of new things in episode 5 as well. That's why I have a big request that you should continue this series so that can learn more new things.
Thank you
Yoo ep 5, I've been waiting for this one. It was all coming up to this, could you possibly make a it so your y position in the world can change, so you can jump over obstacles?
I made the variable already
Wow. A 5th episode. I remember you said (I think I'll only do 2 episodes of this series (Raycasting). And you're on the 5th, well done! You have a lot of talent for making scratchers like something new. Congratulations again !
this was such an awsome and fantastic episode!
Here's a list of what I would like to see in future raycasting videos:
-Y-axis modifications(slopes, stairs,jumping)
-Textures on the walls
-diffrent levels
-diffrent level sizes
-spawning/despawning
-angeled enemy costumes
Cheers :-D
And animations for the character.
These tutorials are awesome! The way you're getting Scratch programming to the next level amazes me so much! What if You've made those Entites see you? I mean implement the algorythm You were using for raycasting (in a simplified way - you'll need only 1 ray since they're already looking towards you), but to make them move to you only when they see you? For the rest of the time they should move to the place they've seen you for the last time and start lurking randomly. It would become the next "Thief" game ;)
PS may I use your tutorals for educational purpouses? I mean - show them to the children at school?
Thanks for this amazing series!
This is awesome!đđđ
I think doing textures are jumping into the deep-end a bit, so i think implementing jumping would be good (so that we can actually 'jump' into the deep-end)
I'm loving this series!
3:20 Thank you for showing how to change the wall height like I suggested in the previous video :D
The thing i love about griffpatch is that he makes hidden griffpatch emojis and that happends on every video!
Also, I have found something spooky! In one of the corners of the map a strange entity changing to each costume while flickering appears. I have an idea of what made this happen but I just wanted to point it out.
Is it the original sprite not being hidden?
Hello! I find my map too detailed with too many walls to move around comfortably in, so I amplified the level by going to the raycaster sprite and going to the (type - x - distance) custom block, and changed the (distance) to (distance * 2). This amplifies the room, making it look like it is bigger than it seems. However, sometimes my entity will glitch through the wall again when I do this. Is there a fix for this?
Ah, you will need to do the same calculation in a few different places I think - It'll need some thought
@@griffpatch I did a lot of tinkering, and here is what I think works.
1. Instead of multiplying the distance in the type - x - distance custom block in the raycaster, multiply it by two when doing the set distance to (distance * (cos of (direction - camera direct))) block.
2. When sorting the entity in the if(item(DRAW IDX >/< distance)), multiply the variable distance and distance only by 0.5.
if(item(DRAW IDX >/< (distance * 0.5)))
Tell me if it still doesn't work and I will try to find out what else I changed. It has deviated far from the original shown in the video and is hard to compare too.
Also, in the (when I recieve object tick) you change (set vx to (x pos - player x pos)) to (set vx to ((xpos * 2) - (player xpos * 2)))
Your tutorial is great. I am looking forward for your next one.
Good - As good as could be expected for Scratch
Crazy thing: I was hoping there would be pathfinding in this episode, where the entities would be able to pursue the player around walls, because I thought it would make it ten times scarier knowing that the enemies aren't just dumbly trying to catch up with you, they're on a collision course.
He has plenty of other tutorials on ai pathfinding that could easily be applied here
what i did is make the enemy remember where it last saw you and then make the enemy walk there
@@mr.killsalot4541 that's actually not a bad solution. I might come back to this.
Would it be possible to have enemies only chase you when they have a direct line of sight to the player?
Yes, easily. You just draw a line between them and the player in the 2D representation and see if it intersects a wall.
@@whwhwhhwhhhwhdldkjdsnsjsks6544 they could have a little raycaster
Omg I love your games I play them all the time!!
I used the health bar from your new tutorial in this! You're so good at scratch
Griff, The Scratch engine is made to render 2D "costumes". It isn't efficient with 3d pen rendering. Is there any possible way you can get costumes instead of pen rendering? I know it is almost impossible because in a 3d game, the environment is dynamically being changed all the time and you can't dynamically change a pre-rendered costume.
Just make the enemy's costume top down, and tell the renderer to render it aswell, that's what I did
Sorry - This just has to be done using pen.
@@griffpatch actually no. I have seen a few people (including myself * insert grin *) use fish eye effect to replicate 3D...
@@MayankKumar-gn1zx đ=3D? Or is it đ that = 3D
Please explainâŠ
@@MayankKumar-gn1zx I think he means that his 3D game has to be done that way even though it can be done in other games.
I think it will be difficult, but do you think, we can make a system, that connects the ends of each line from the walls to it's neighbours, so it doesn't appear round at the ends?
Love your vids!!!
Yes, it is definitely possible, but certain parts would look kind of weird
Hi griffpatch! I have been following this tutorial since day one and then i thought i suggest you something after watching this. There could be something of a map where you click on a map and it will show you the map, but this is a really handy tutorial! Thanks!
Thanks for making great tutorials!
You should add an range and only enemies inside that range can see you
You can use the 'distance to' block to do it
It would help performance as well if Entities would not be rendered if completely behind a wall or too far away as well. :D I'm working on my own project that has a relative same idea as this series but mine is a bit different and more complicated lol.
You are amazing. Thank you for this
AMAZINGđđđđđđ„° Best scratcher ever! Thank you!!
*Lets Take A Moment How Much Effort He Puts Into His Content For Us â€*
Wow just started making this, on part 3 right now thanks for all the effort
Thank you so much for the tutorial.
you are the best griffpatch.
Every time I make something, I say, "Thanks to griffpatch." I could never have gotten this far without your videos. Thanks.
i love your tutorials
Thanks for adding the enemies chasing you part!
IS IT JUST ME OR ARE THESE VIDS GETTING BETTER AND BETTER?
It is and i LOOOVE IIIT
IKR
Grifffpatch, if you see this, i love your videos because it have make me my dream horror game come to real: Lost in rooms! Im really glad about it!
This series is amazing! Great job! I was wondering how you could make isometric games. I also read about non-euclidean geometry and it would be quite mind-bending to put it in a game! Your lemon grab game has that.
THANK YOU SO MUCH FOR THE BUG FIX GRIFFPATCH I KEPT REDOING EPISODE 4 THINKING I DID SOMETHING WRONG. Now I can actually make a 3D GAME!
No probs...!
texture mapping, definitely. Maybe adding in viewing different costumes from each end? BTW Love the tutorials!
Thanks to you I finnaly made my first 3d scratch game!
This is awesome
thx for the tutorial and I also used pathfinding for the enemies
hellow griffpach i am an old scratcher and i really like your tutorials sadly i retired from scratch now i work with gdevelop for games and c++ (for school) when i was 12 there werent many tutorials like yours the only youtuber like you was Scratch tutorials. Hope the best for you
great video i really understand this
May be watching 2 years later but griffpatch is still the best
Now we can make 3d baldi in scratch. Good job griffpatch!!!
i love you griffpatch you are very good at scratch
I can't Take Nano's Grin Seriously đ€Łđ€Łđ€Łđ€Ł
The Thumbnail Is Even Funnier! The Flipped Nano đ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Łđ€Ł
This video was made on my birthday!
This is amazing. With the coding and other raycastings for a simple coding website for kids
11:30 lol nice one
Nice tutorial griffpatch! This is probably way beyond the scope of this series and would probably require a major rewrite in the way the engine works but it would be so cool to add verticality to this! It could allow for so many amazing projects (possibly an actual 3d Minecraft clone?)
Yes technically that is possible, the only problem is that although possible the price we pay for adding more levels is a much slower project :(
You can actually add ghosts! In the costume library, you can find many ghost sprites. You just need to resize the hitbox and add a *Spawn (number of clones you want to make) of '4'* block in the entities sprite.
Yeah :D
Wow awesome
You should try to make a clicker game tutorial! I've seen many other people do it, but you're probably the best scratch tutorial maker on youtube! I'd love to see how you would code that.
These masterpieces won't end
I send lots of love to this series from a fellow Brit, and would love more episodesâŠi wonder how yo could do:
- Jumping
- You/Enemies Flying :O
11:34 Very good reference
Texture mapping sounds very cool.
Awesome content as usual! Being a programmer myself (non-game), I had been able to figure out several of the techniques in the 2d games on my own, but everything in this 3d series has been a learning for me! Thanks for making a complicated subject like 3d games accessible to a large audience!
Your impact on teaching kids programming across the world is so immense that you and most people perhaps don't even realize ... most of the other online tutorials have mistakes or are teaching very basic stuff, while you are teaching sophisticated, almost-pro-level techniques in an easy to learn way ... You are not only teaching the kids, you are teaching the teachers themselves and hence having a huge multiplier effect. You are perhaps creating a whole generation of kids who are much more adept at coding that anyone before them were! Thanks for all the amazing work that you are doing, griffpatch!
Are you planning to start Patreon as well in addition to Google subscriptions?
Wow, thanks so much :) and I do have a patreon account, but I don't really have the resources to make it very appealing to prospective patreons. But it's there and does work lol. If you have any suggestions then I would love to hear them :)
@@griffpatch hey I know I'm late but I can't figure out why the Frank's stars and Nanos are all just printing as stars
@@AjWalker267 See the pinned comment!!! :)
This is really cool, I also have an idea for episode 6: 3D Sound! đ
What do you mean by 3d sound?
Scratch is used for making 2d games
Griffpatch: are you sure about that?
i was actually thinking of making this into a scratch 3d movie maker before you mentioned it in the video
this is so fun i play some game from you
thank you so much for the bug fix solution, my frnak wasnt showing until i read this
Amazing, I love this and it was very helpful! I can't wait to finish my game! Thank you, Griffpatch! I wish I could share it with you, but I can't get my email vertified!!!
Cool video, you can implement all the stuff you said at the last of the video, one by one.
He sounds more excited each episode :::)))
0:50 thatâs a very yummy pop-up u got there, fella.
LEMON!
A good tip for setting up the hitbox colours/sizes is to write them into one or several lists for each entity to not have the need to always rewrite the same entity statistics manually.