Code a Platformer Game | 7. SPIKES and LAVA

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello fellow scratchers i'm griff patch do you feel lucky well do ya because today our classic platformer is suddenly looking a lot more dangerous yes we are going to add some very pointy spikes and some very hot lava i don't think scratchy or guy will thank you for this unless they happen to be adrenaline junkies and then perhaps they will so write off what do we do yes be a good coder and save a copy of your project this is episode 7. okay let's get scratching run the project i'm going to just scout my level for a good place to add some danger yes i think scene 2 is a prime target now the way i'm going to do this is to make a duplicate of the level sprite and we'll rename it danger positions a little off as you can see on the project stage but we can just click the green flag and that'll all snap together sweet so open the danger sprite costumes do make absolutely sure you are editing the dangerous sprite costumes and not the level sprites costumes you don't want to lose your carefully drawn levels have you checked really okay then within the scene 2 costume of the danger sprite i am now drawing a very very i mean seriously killer red square that will with a little cunning manipulation soon become a deadly red triangle or even a red spike yes that's what it is maybe even three spikes more pointy perhaps yeah good so this is where things get interesting we now have to remove everything from this costume that is not deadly delete delete delete here we go cleaning up nice now you should see the spikes showing in a stage alongside the level that we of course didn't delete by mistake after all my warnings good job so then we now also have to delete all the other costumes from the danger sprite just leaving this one let's run the project hold the phone why are those spikes showing on scene one do you know well it's because we are always showing the danger sprite and this is the only danger costume available so it will always show to fix this we don't have to have a danger costume for every scene in our level no make a new blank costume and name it blank then in our scripts find the when i receive change scene receiver when we change scene we try to change the danger costume to the given scene name now we do have a scene 2 danger costume but we don't have a scene 1. when you change to a non-existent costume scratch stays on the last costume it was set to so it doesn't end up changing to address this we add a new switch costume above the first and switch to the blank costume now if the second costume change doesn't work we'll remain on the blank costume that's neat running that now and you can see those horrible scary pointy things have vanished few however i highly suspect if i walk into the next screen oh they're horrible oh no oh wait this is what we wanted so yes i can just test popping back and forward between two scenes to ensure the dangerous sprite only appears at the right time great so i guess now we need to finally face our greatest fear and touch the oh oh i'm alive gosh they look so deadly too it appears we have more work to do click into the player sprite now when we lose a life we are going to want for the time being to make use of this define reset and begin level script before we proceed to do that we can make a simplification we'll use the begin scene custom block we already use this to change scenes when walking off the edge of a scene but we can use it here now as well fill in the scene number with a 1 matching the set scene from the top which we can now delete next set the x to negative 150 and the y to 55 and that's it it replaces these last three blocks completely as it also performs these broadcasts itself smash the green flag just to make sure everything is still tickety-boo yep we are spawning just the same and when we restart from another scene we appear back on scene 1. good you know what's been bugging me drop in a point in direction block here and set it to 90. i prefer is to point the same way each time we start right let's lose a life find the when i receive tick last script the best place to look for collisions with dangerous sprites is here after everything is finished moving and the costumes are all displayed at the bottom if touching danger then we'll now broadcast a new message lose life this is going to be real simple find some space and when i receive lose life start by stopping all the other scripts in this sprite that stops the main game loop right away otherwise things would really mess up now you can play around here with your players lose a life animation or effect i'm just going to fade the player away for starters with a repeat 10 and then change ghost effect by 10. 10 tens is 100 so that does a full fade out then we can wait for half a second 0.5 before we then reset the game reset and begin level are you ready for this here we go progress onto scene 2. sit on a spike ouch we fade away as planned oh bother the good news is we are back on scene one the bad news is that we have appeared to be invisible and of course we are we never reset the ghost effect did we scroll back to the when i receive game loop script we'll simply add a set ghost effect to zero right at the top before the main game loop begins cool let's run that again here we go ouch and yes we have reset i can see scratchy super yes in the words of cap i could do this all day but seriously who would want to we need more spikes more danger more more everything of course adding more spikes to scene two is no problem we can just draw them in and position them by looking at the stage for reference and yep they are just as deadly as their siblings so how about adding danger on another scene like scene one well easy just create another costume for scene 1 naming it carefully as scene 1 capital s then position it again using the stage as a reference and run the project as you can see the costume changing works great and we can have dangers on any scene we want but griff patch what about the uber cool animating lava effect you had in the video from episode one ah right i guess we should add some of that right we could just draw the lava costume like we did the spikes but let me show you how we can also copy costumes to make lining things up easier in the level sprite just drag scene 3 into the dangerous bright and then back in the danger sprite we are free to go to town drawing our danger lava exactly where we want it there and then of course delete the rest of the level as it isn't meant to be dangerous so that leaves our lava pool but it's supposed to be a little more dynamic than that so that we know it's lava we want it to pulse up and down for this we click back into the danger sprite code tab we only want the lava to pulse up and down not the spikes so use an if block in the change scene script checking for when seen is equal to three that's this scene now here's the beauty of this platforming engine although we are using the tick broadcasts because we are not restricting them using broadcast and weights we can still use a forever loop in here to create an animation without worrying about slowing down the rest of the game to make the lava move up and down set y position two now this is a common math script for circular motion we need a multiply on the right a sine operator s i n then in that another multiply on the left use timer okay there are two remaining three values to fill out the left one is how far you want the lava to wibble up and down we'll say five pixels up and down and the right side is how fast you want it to wibble 360 means it will do a full cycle in one second let's see what that looks like oh yeah that is cool but do feel free to play with these values maybe we'll slow it down a bit try 180 to half the speed and tweak the distance maybe just three there isn't that something now if you want to have spikes and lava on the same screen you may want to duplicate this danger sprite into two sprites so that one can move while the other stays still that's the simplest way perhaps but you could also use clones to accomplish the same effect with a single sprite right that is all the teaching i have for now until the next episode where we will be finally looking at moving platforms however before we finish i really want to share with you more of the amazing projects you scratchers have been submitting to the studios can i start with andre's desk ass 1945's project first impressions are like wow look at the art and the animation is awesome oh man there's a hole watch out for that one it's a bit hard to see with all the shades of um sand yeah that's my excuse anyhow there's a bridge nice and look at the wall sliding costume it's excellently done i wonder what game this character is originally from either way this scratcher has done a great job getting them into this project now these platforms are a little bit more tricky i'm really enjoying though playing through this level oh no oh i fell to my death and i'm right back at the start ah you know what we are going to have to cover checkpoints in our platformer series aren't we yeah checkpoints next project up boom bang one one two four eight one six three two what's this press one or two to see the hitbox oh oh cool look you can switch to see the actual hitbox versus the level that you are seeing nothing hidden on this scene ah now this is more interesting see the top platform is a trick and the real entrance is below i like that really cool try going here it says but oh no that was a trick too okay this next project is by john do i want a whirling effect or no let's go for the whirling effect oh oh my goodness it's like the stat whirling effect from that other game but turned up to the nines it's it's really disorientating and maybe perhaps a little bit much i do get a bit travel sick i think i shall try it without oh i feel like the level is still moving right i'm gonna try again up here this level's working really well we can move from screen to screen and the colors are nice i really want to get up here oh i can't do it right i'm going to come back to that i'm sure there's lava and spikes already that's cool um bit of wall jumping watch out for that spike oh that's a tricky one if i just come down a bit yeah and coming back to the left oh oh is this going to link up with that little bit at the top yay celebration i like that right let's try something else this project is by logic cue dev 2. oh it's me that's a ball oh and the level's moving look at that moving platforms how cool wow i'm really boingy it almost feels like a combination of my ball physics project but it may be not quite so but nearly it doesn't roll down these slopes but uh that's cool why i'm so fast oh that's the end of the level oh well it's cool though it's got a lot of potential i like the way the face rolls that's good and it leaves a big trail of me next we have sky high 173 what have you got for us oh this is a pleasant looking level look at the clouds i love that and i've seen this before but maybe in a previous version we got this vertical bit of blah oh well let's try that again okay now i need to watch [Music] oh look different music track oh it's nice because i'm going a different way i feel oh oh that was a bit of a sudden uh drop let's be a bit more careful this time i love the background you've seen the hazy like background oh oh the hazy background in this no no no no no no it's a bit harsh let's try that one more time okay here we go here we go here we go here we go i got this i've got this i've got this yes so we can progress on with this level watch out oh it's so harsh it goes right back to the start see we definitely need checkpoints okay this project's by bambang one one two four eight one six three two don't just love these usernames now this one appears to be almost like a bug report there's a known bug that you can wall jump up a wall if you can just press the keys at just the right time and i am not doing very well at that obviously i will not do a very good job of beating this level come on come on come on i can do it hey no got it got it got it there see did you see that oh my goodness you have to do the whole thing on this wall too um there's no way i've got the skill to pull this one off come on come on come on no no there you go maybe you do better okay thank you hello lolly for submitting your project to the studio oh we got a nice soundtrack kind of very pleasant green and blue sky oh rectangular oh whoa okay so we've got some quite tricky little jumps here on the next screen so be careful okay i think i got this getting more difficult as time goes by so gotta be oh wow look at this it's all about getting these jumps right okay it's definitely a little jumping game this one no vertical scrolling on this game whoa whoa whoa whoa oh yes that was a close one you're never quite sure what's gonna come oh my goodness right big jump now yeah i think as long as i do big jumps off the edges of these really tricky bits i'm gonna be oh i'm stuck but i've won hey well done me thank you for that game now scratcher nagoyan you have submitted a very psychedelic project i'm quite a little cat and i can run like the wind and the music's nice going to the air i guess i oh i'm trapped i'm not sure i can get back oh well on to the next then so sabco so this one looks like it follows my tutorial quite well and a bit more colorful than mine oh i like this little side door oh the level's a bit bigger than mine then oh come on come on come on i can climb up here no i can't i better go down okay h t f l m f how on earth would you pronounce that at film one okay you've given us this rather exciting looking black and white project i like that and it's kind of like a happy cube i can wall jump that's cool but i think i'm going to go to the right here it's like film noir version of guy oh look at his lives move could you see that that's really quite cool yeah we're going this is going pretty well i like this this is a bit of a different oh oh no i'm stuck i might love my eyes though good work okay next up sweep sweep 2. look at these lovely colors oh spikes that was lucky oh yeah that resets me right back to the start let's have a look a look over here no no no oh this is a bit harsh right let's go somewhere a bit safer which way to go oh i guess we'll down we go then i think we're the same same oh oh my goodness quite short oh i just teleported through the water oh my goodness on earth's going on i think the uh the scene changing is a little bit uh obscure oh look the spikes disappeared and i fell through the ceiling that wasn't there oh my goodness oh oh my goodness me this is a quite uh quite something oh my goodness oh if i could fall down here oh look at this like it goes super fast i'm gonna have to end at some point my goodness imagine what level i'm really on oh see there's a lovely thing about this engine is that uh because we're doing that clever step thing we can actually fall really really fast and still collide with surfaces that are really thin so that's a really good thing about this engine right let's go on to the next one so this next one's by maths games we've got this nice blue color i like that i like the fact that the level is all contained and it's quite nice it's got like smooth walls and nice gradients and nothing too sharp oh this bit's a bit more rectangular but i like i like the fact that it's all contained up there okay next up we have a zed or at the z we've got some lovely color changing going off here the level and scratch cat the basic platforming says oh yeah we got up and down scrolling there scene changing sorry uh oh that looks like a big spike on the ceiling watch out if i just jump over here whoa oh my goodness oh look it's like a little party zone to be honest it feels like like uh disco okay rapunzel 6262 what have you got for us wow i feel like i'm jumping to this music oh did you hear that pop oh look at the nice gradients i like that oh am i standing on here like sand or something it's quite fun with the big scratch cat and a nice chunky level [Music] oh i wonder what i'm going to it's just quite a pleasant little stroll through this little jumping thing oh there we go i like it thank you rapunzel oh i cannot pronounce this one q-h-r-a-w-q-e-k-j was that about right but my goodness this is looking like exactly like my initial tutorial level wow i'm impressed that there's a moving platform i seem to be a little bit stuck to it but the lava is working brilliantly so we are going to be covering the moving platforms in the next tutorial and i'll show you how to get them working a little bit better than this but this this is a really good job well done i would say your name but you know i just haven't quite got the uh the language oh lemon i think i've won what an excellent ending thank you for that one next up we have choc unfamilat that's a brilliant username is this like a power-up now i've collected it i think i can actually jump higher than i could before oh that is such a cool idea i love power-ups i wonder if there's any more in this level to be found i'll just have a jump around and see another power up so to the right oh look look how fast i can go oh oh oh oh oh oh oh it's like i'm being blown around by some huge wind or something um oh imagine if this is this combined with my jumping i don't think i can jump as high now but imagine if i could jump as high as i did before and had this for this sideways motion it would be absolutely insane right um let's have another one this one is by triple d rv and it's looking pretty similar design to my original project i like that wow i'm so fast i can jump really high it could the problem with making things jump so fast or so high is that it actually can make it quite hard to control because you get stuck to the walls and uh and things but oh no game over i jumped up through the ceiling and got stuck next up is scratchmaker2321 oh now i'm really digging this uh guy oh they've got nice sounds too look at his animation it's fantastic his little arms oh when he jumps he puts his like finger off in the air like cool oh dead oh harsh i don't like dying but it's good it's good yeah we got all their features i do yeah that little jump noise is brilliant and his animation is brilliant too i love it nothing just climb up here i wonder what his wall sliding looks like cool okay i'm getting this now i think i'm gonna we're here though oh oh down down okay let's try that one again this is really quite fun come on then okay so down here now careful now i need to go just the right amount oh right skip back up the top this time i got to be really really careful so how far was it i think a little no not again come on [Music] there yes now going careful now come on come on little jumps oh little jumps i know where they are and i can get up here and i saw that thing down at the bottom there so i get it i do you know i guess if i just yeah okay we made it now um can i get up this oh no oh have i come down too early oh i think i've come down too early never mind next one domi12345678 has got the night platformer for us this looks really thematic oh look at the rain oh and a lovely music track too oh that's brilliant and the light beam around me as well oh that's really uh that's really cool it gives a real atmosphere to the game oh i feel like i'm falling down though down every time i move left or right to be going down a level i love the uh i love the graphics they uh quite simple oh green did you see the green what was that how can i get back up there again oh here we go i got it um now is it oh even lighter it's like the higher up i go the brighter it gets if i could just get up if i could wall jump off the right here then i might be able to get over there oh can i even get that oh no it's going darker again i want to get back to the grip there i'm it oh no i'm stuck in a wall oh no oh bob maybe i go right instead okay have i been here before [Music] hey i've made it but that oh oh i guess that's it then i guess i've i guess i've seen all the green but it's really nice i love it i think that could be a really good game if we could just expand it out and add a few more things this next one's by eggy revvilis and it's got a really really funky little character i love the way his little feather ripples as he walks along like a little knight i wonder what the wall jump yeah wall jumping works oh look at that little slide you just see his little hand come out oh that's so sweet what's this i'm not sure what that is i don't think it does anything yet i'll just try going off to the left no i'll go to the right now what is this oh no i don't think i can oh i thought it was a little secret way it was just another little platform oh this is intriguing there's all these little ways in this level um can i get across here oh come on jump yay what's over here then oh i'm not gonna make that i think we're back to the start oh i love it though look at that little guy oh i always love his little hand that pops out too it's so sweet i think that's all we've got for this level but that's really cool game i like look at that and dan 47725 has brought us the minecraft platformer and look at that i've got a big rainbow trail as well oh it's a bit of a hyped up minecraft theme i think you've gone to town making this it must have been quite hard to place all these little blocks but it's cool i imagine if you could wall jump like this in minecraft i bet there's a mod for it well i think i found a cave i expect to find a creeper any moment but uh luckily not can i get up here i can't see how i could hmm maybe back no no i think i've found the end of minecraft okay thank you 250119 test 2 for this submission the thumbnail looks beautiful yeah look at this the level design oh i died the graphics are really nice and look we've got checkpoints checkpoints you've beat me to it that's really cool but thank goodness we have got them because my goodness what's this mean then oh oh it's like um on um geometry dash oh oh heck what happened there it's like on oh it's hard to see the spikes i keep oh come on um so i gotta jump over this and then i can bounce on that little yellow thing oh oh oh oh oh oh oh oh oh oh oh oh oh my goodness okay come on this time i'm going to jump on it and right now where do i go about down here watch oh it's just so fast and you don't know what's coming okay fast forward through this okay right so now i can bounce on this yellow thing and me no no i really can't how about we just go right here instead ah i'm on the other side everybody's meant to go no i seem to die an awful lot oh yes did i make it when you made a new screen i know i can't get there down here then oh yeah down here checkpoints are excellent whoa complicated this is cool so i guess i go left oh secret room a secret room but i want to go across oh checkpoint yeah good oh oh my goodness it feels like geometry dashing it's the same sound we could do it like a particle explosion couldn't we so thank you everyone for your awesome projects i know i can't show them all here but they are all so excellent well done but with that we have reached the end of another episode if you enjoyed the video then smash the like button and don't forget to subscribe to the channel the next video will be here before you know it and you don't want to miss it because we will be looking at finally moving platforms oh yeah these videos remain free to all but if you're a loyal fan or an educator then please consider joining the channel membership to help support me to make these cool videos thank you so much for watching have a great week ahead and scratch on guys [Music]
Info
Channel: griffpatch
Views: 59,047
Rating: undefined out of 5
Keywords: scratch coding, scratch programming, scratch game, scratch 3, griffpatch, griffpatcho
Id: bMZmDVCookw
Channel Id: undefined
Length: 27min 31sec (1651 seconds)
Published: Wed Oct 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.