making a game in a day (with Python!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello it's me it's the guy starting the game jam 24 hours late um so yeah i got to do the basic set of stuff so i'm gonna have to grab some links real quick watch my audio play um yep probably heard that this there's probably a way to get this stuff to uh get get the link for a stream before you do it i'm not sure how oh i can probably get it from the pop out there's a lot of people here already i can't read the chat i'm only seeing names because i work at my discord window um okay uh why are there 20 people already i just started okay uh yeah hello everyone uh so this is for the alka jam so i'm gonna be making a game in well i started really late because i had a try out for a uh uh well a a team for a vr game uh last night so um yeah i went to bed and i slept in a lot today and then i ate and then setting stuff up and now i'm finally streaming and i'm hoping to make the game [Music] well i'm hoping to be mostly done by eight i have something else to do at eight uh you can tell what time it is for me for my clock oh nevermind you can't see that i don't show that anymore uh but so i'm probably gonna be streaming for three four or five hours uh maybe um i might stop for dinner um and then i'll probably stop at eight come back at 10 finish things off uh so this is gonna be a smaller project i already have the idea in mind um yeah so like the last stream i did for the alkajam i was a much bigger project i put a lot more hours into it this one's gonna be smaller it's actually my idea is based off of a uh mini game i made in minecraft a while ago uh and by a while ago i mean how old i was like probably like five years ago six years ago or something um maybe yeah something like that so the theme is caves so i'm going to make a game where you're just kind of in a cave or something and there's a bunch of stuff flowing down from the roof and it's hard to explain but you have to stay on top of the stuff that's falling down and just work your way up and not get hit so it's it's going to be one of those infinite type arcade games uh so yeah um i'm okay you're saying python looks annoying because you use tabs to make loops you know that standard practice to use tabs for code indentation in every language right if you're not using tabs in any language you're not writing good code or at least most of the common languages [Music] okay there's 50 people and i haven't even started yet all right so pallet hunting i did this last stream and by last stream i mean uh the last stream i did not the last game jam stream why why is my frame rate so bad on my avatar right now i'm probably going to play because i'm going to decide uh on here i got my low spec thingy little speck hat browsing um i could take something like this actually i'm gonna copy that out if anything like that i can have a very similar palette to my last game gym entry uh downloads i don't want a lot of colors i want something super simple because game jam can't spend too much time drawing i do like this one i'm not sure how it would work with what i'm doing though um i think i can make it work uh by the way i'm not going to be answering too many questions in the chat on the stream because i'm kind of in a rush okay so i can pick this one right this one i do kind of like this one yeah i'm going towards this one it's going to be tricky to use i don't think i've really used a palette like this where it's just kind of one color with a bunch of shades yeah called a uh a mono ramp apparently so i'm going to get the 8x copy that and close that out i'm gonna start making my folders [Music] data images and then put paint so there's my thing so the this is going to have to be my background color um so the stuff following is going to have to be made out of this color i don't want to do super high resolution i'll start with the character first because that's going to be the uh uh i don't i think it's just a good reference point for scaling everything else so i kind of wanted to have a hat so i'm just gonna sketch some random stuff here for my secondary color to black black's gonna be transparent on my tileset so there's my hat and then i need a body and more body this this doesn't look like the type of hat i'm going for looks like someone is in working in rice fields gonna have to change that in a moment i don't know if i want the legs to stick out the back or the front it's the awkward problem with having something this size uh i could make the head just a tiny bit wider and then if it's you can get two two pixel legs perfect um maybe i should give it a scarf i don't have that many colors up with here i could reuse this one actually and then use this for the scarf and then for the back side of the scarf i'll do that perfect might make the scarf a little bit bigger i need to put some detail into the hat i'm not sure how detailed this should be i'll do it as i go [Music] actually i don't want to do too much directional lighting here it should be kind of top to bottom uh well i guess that is directional but it should be coming from above not below i'm gonna mix stuff in a bit there we go i like that it looks like it's wearing cake on its head though hold on uh i don't know if that's good maybe i should do this uh let's actually knock everything down on a tone that doesn't work wait no but maybe if i uh do this and mix the outline together about that could take away these pixels yeah i'm not a fan i'm switching back to that i didn't mean to do that actually maybe a solid color might look better like that what happens if i invert the shading now looks like an outline wait what if i if i do that or this now looks like there's something in it like it looks like a container um i just messed around with colors trying to see what i like here i feel like if it's not white it's not gonna stand out enough almost so i i think i can stick with the white uh so data images what's called the sketch perfect how much does python well does the python library provide for making games in terms of rendering um i'm not saying right uh i mean it depends on the library very it's not it doesn't depend on the language too much okay so yeah i'm gonna need to make the tiles so let's let's measure the player first players huh should i like cut it out a bit it's like barely big and that's fine so i'll look the title 16 by 16 because that's very close to the size of the player the hip box of the plate is going to be probably about 16 pixels tall it's going to be thinner because i don't think that hat's going to count as part of the hitbox um so i'm going to fill this in and then i can start sketching some other stuff here um how do i want to do this i'm not sure how i should draw dirt in a way that looks interesting because i mean you can like draw bricks which is a bunch of straight lines kind of like this and just uh do this this type of thing you got bricks but for dirt it's tricky to make look good um i can just do the good old square dots thing and then i should probably have like some sort of divider so you can tell what a block is yeah there we go so that's going to be a block i guess tile's all right now uh what else so i'm gonna need some like power-ups type things and i'm gonna need chests so the chests are probably gonna be like a box i'll draw it right on top right here so it's gonna have dark edges come on there we go i think the bottom edge could be just this color that's the background color but i don't know it'll look like it's floating if that's the background color uh or maybe i should add a shade to this so what's it doing it looks like it's losing saturation as it gets darker and shifting towards purple so i'll add this so there's my new color i i'm not quite a fan i think it needs to be more saturated so let's turn up the saturation boop i think that fits maybe it should be more blue who knows yeah that one fits better so that's going to be the background color so i can use the dark oh this dark color here um actually i think i'll do something like this all right there we go now i need the top of the chest so it's going to be shaped kind of like this probably a little hump and then that's gonna be the top part gonna run the lid across here um actually that room should probably be brighter i'm gonna flip the colors here so i'm gonna give that to that and then let's do this we and then the part of the lid and since this is like metal i can make it shiny i i use a spray when i'm doing animations you'll see me use that later so i'll put the lock in the center and i'll put a little bit of a sparkly thing on the lock actually i think it should be like maybe there shouldn't be a sparkly thing that might be fine so these colors need to be changed um let's see okay so i'm gonna run some uh those lines up here and down here and i'm going to change these shadows a little bit to give them a little bit of direction i'm not a fan of that actually um let's get rid of that okay that that's better but looks like it's going inward a bit too much i could make it look like it's uh going outward a little bit maybe how did i do that now i'll just do this and then i'll add some shadows here looks like a cage maybe that's fine um i'm just gonna swap these colors like this i actually kind of look i like that look uh hold on i'm gonna do a little bit of stuff here i'm gonna make this a little bit darker because it doesn't contrast well enough on its own so yeah i'm gonna do that nope here so it looks like a cage and i think i'm just gonna do that for the art style of everything you'd collect um just kind of frames so there's gonna be a few different power-ups um how should i do this so i want like one where you get like an extra jump um or uh hold on so actually for this one i'll do like a couple extra jumps or something but i need to like make icons for it like for items i'm not sure how to illustrate that oh i know let's just kind of make it look like upward motion there we go um just gonna mess with the frame here run almost done with that and then i have to just do this the little drop down shadow thing and then yeah that's good so that's gonna be the jump maybe the hat should be styled like that as well uh no i think that's fine yes it's my game what'd you miss uh why are there a hundred people i haven't had 100 people in like three or four months i guess that's what i get for streaming on a saturday um probably start streaming on saturdays more uh because my schedule recently changed then also i mean there's the issue where i couldn't stream for a while which i'll get to probably what i'm gonna explain i'll make a video explaining it in probably a year or that's not a year a week or two so that's gonna be the jumping one it actually looks like um a certain power up from super potato bra and also um uh the crush sky so two of my games uh and in those games it one of them gives you an extra jump well it's your potato bro it makes it just kind of bounce when you hit it like just get a small jump up or something i think wait maybe that was it i don't remember maybe you do get an extra jump uh but for the crushed sky i think it does actually give you an extra jump or something no it gives you flying energy because there's no jumping in that game um so another one i want is gonna be one that's gonna create a block um oh maybe i should make it so that the chest can give you money too and that that's how you um get a good score not specifically just surviving for as long as possible so this item is just gonna be a block i missed nice there we go and move this around a little bit it's that and then i'll probably add like that there we go that's that now i need to do the shadow part it's gonna be pretty easy for this one there we go so that's the block and then i need a coin should it be uh i'll do the oval shape now i need to do the shadow this one's got a shadow through the entire middle i keep missing there we go so that's the coin now what's next so you got coin blocked the black one is going to be like a power that lets you spawn a block um that's another good one uh actually this is probably gonna be like a super jump or something not just like one jump because when or maybe i should make two ones like a super no that would cause confusion you don't want to cause confusion in a game gym game bad design because no no one puts that much effort into learning how the games work why don't i miss a spot i had to lean forward to see that okay uh what did you do to customize the screen uh it's just some tricks in obs so just set it up certain ways okay i read it every now and i don't read the chat that often right now because i'm making a game jam game and i'm in a rush um i do make music myself but i will not stream it so okay i need probably one more power up because i think three is the right amount um so it'll probably like have the chest give you money and then the other half give you power ups hmm so one a jump one's a block that you can place and stand on what else do i want and okay so for the block i'm thinking if the block should spawn above your head like it won't drop like the other ones oh it probably needs its own artwork so you can tell it's different i'll probably take this one and then instead of it being rounded i'll put the weird gold thing around it there we go actually i'm just gonna do it like this and then i'll add a little bit of stuff going on here there we go so that's how you know that that's blocking place with an ability um now i need yeah that one last power up should be [Music] maybe it could be like a warp yeah i like the idea of a warp so i'll probably warp you to like the highest point which is in theory gonna be the safest because it's gonna be a bunch of blocks running down on you so for a war what should that look like i guess the the universal sign for warping is a swirl looks like a g right now okay that should do it uh i just gotta do the highlights really can't spend too much time like being perfectionist about the art so i'll put that there and then shadows there we go and then for purposes of demonstration or just a visual idea to get an idea of how things gonna work i'm gonna throw some stuff down here so here's gonna be block with the chest on it oh i need to get my car key so you get a block of chest on it and i'll put it over a bunch of other blocks around around over here so that one on up there is going to be dropping um put this one here i misplaced it and that's not where it goes and then i'll probably i'll do uh one of these and i'll put the player standing on it so the players can be standing on that so let's take a player and i need an open chest that's important so for that let's take off the top and the lock should not be right there anymore so i'm gonna just take it out now this part should be that and now i need like just kind of like the open part how do i make it look like it's been opened i don't know i think that's good enough i'll i'll make like some sort of explosion so it's just popping off or something so i'm going to place a open chest right here with a warp and some coins laying around i'll do one coin so it's gonna shoot the um thing up into the the uh actually no i should do this it's not gonna be like if you touch it you bounce off of it or something and then the the things will shift into the air and then you have to collect them they'll probably cool down so you can't pick them up immediately so that sounds all right all right so i've got all my assets the idea for the game is just dodge things falling down over you and uh work your way up as things slowly fill up um [Music] what let's see what needs to be done here okay um so if you touch this at all that's going to count as a death as it's falling so it's beats own entity and then it'll turn into a tile once it lands uh background music oh oops normally that's what why isn't it showing there it goes i don't know why it wasn't showing normally shows um so yeah there's the background music for you there's also spooky chat i had that on apparently there you go wait that's a match oh no it does i can't wait the chat on obs is updating faster than my pop out for some reason that's weird okay so we've got all the assets um i just have to separate them out so just gonna do more ms paint here background color is gonna be black um actually i'm gonna do the tiles first yeah so it's gonna be my tile i'll just call it tile.png and then i'll do this one which is going to be placedtile.png and then in the chest come on copying it from another window chest um and then i need the open chest i'll save as opened chest um so now i need to do the coin and the um like uh powers so this one's going to be the biggest power i think by the image size so i call it cube power png um next one's this one i guess this one's gonna be called warp power this one's gonna be taller it's called um jump power and then the last one is going to be called coin i don't know it's not coin power so i'm just gonna coin there we go so i got my images i can switch this view to icon so you can actually see it the icon size it ain't gonna do much i don't think i guess it's large so that's all the artwork uh except for the player so i'll do i'll make that might grab like the entity script from one of my other games hold on desktop let's see the games i think wandering soul had a decent version of it i have like a million different versions of my entity scripts um scripts let's see entity image react angle distance range what is it why is there a to-do in here this is wandering soul so it should do it i think it has just yet has animations so i'm gonna use this one i think i'm gonna need a couple other things for this to work so i'm gonna take see spreadsheet loader no i don't think so there's just a tile map thing in here i'm not gonna mess with that just trying to plot all these scripts uh new folder actual printer data new scripts and i can paste them in there we go so i've got all those scripts um i don't use pycharm because i prefer text editors i don't like full functional ids um so i'm gonna start with actually uh only isolate out the player i guess call that animations well i'm going to check what that's supposed to be called i don't know how this is supposed to instruction uh wondering soul data images so okay yeah i had it right so and go over here and here so i'm gonna put the player into the animation so i'm gonna make just an idle and for now it'll the idol will be one image i'll add the animations later that's gonna be kind of like a finishing touch type of thing so file save as animations idle and then i'll call this image 0.png that off screen but it's right here so knocks are making the game okay what are we working on game jam game so this is what i got so far uh i do need a subsurface thing to do the pixel art oh you know not popular this way i am not surface so this one's gonna be it's a very it's gonna be a very vertical game so i'll i'll do like 200 by 400 i don't know how it's going to show up let's try 600 that's gonna be 1200 so big yeah that's too big um i can do four by eight hundred it doesn't need to be that tall actually 340 so this will be 680 i like that so the jump is going to be pretty tall actually i'm going to make it a little bit wider 260 becomes 520 this is what i got now um i need to do the display rendering so screen dot blit pygame.transform.scale display and for those of you that don't know this is just um this is just uh how you pick sort of stuff in play game you just scale up the subsurface it's not a sub-surface it's just another surface i'm running on to i covered my tutorial videos okay so i need to get that color for the background i got it up with nemesis paint in another window right now so that's going to be 22 1940 okay so there's my background color wait was that really it is that the darkest one [Music] yeah apparently it was still looks pretty bright when i do it right here oh well um so i'll load in the tile image so tile image equals pi game that image.load data images tile dot png and i'll convert it to make it faster to render and then also do normally i would have a more organized loading system but like for assets but this is a game jam so it doesn't really matter i loaded two of them oops uh yes i'm using kite right now um you guys talking about windows 11 okay so i need to load the tiles into here uh well they're actually going to drop out and then fall into the grid so first i'm going to have the grid itself so that's just in the dictionary and then anything that's outside of the visible range can just be deleted um or i can just leave it there and forget about it so actually the chest is gonna be a tile so i'm gonna do that chest.png [Music] all right so um let's just put some tiles so for i in range 10 tiles uh and i'll do a tuple type thing um let's do i'm gonna need random no doubt about it import sys import random and i'll do uh random.rand let's see 0 to 5 and random i random 0 to 8 and then equals and then i'll do like the name of the tile so i'll call it just tile um and i guess it doesn't need that much information so actually i'll just do tile i have to donate any information for that um for tile in tiles if i don't want to do this [Music] if tile tiles tiles tile is tile that's a normal tile i forgot my closing thing in here then tiles thai wait no uh display dot blit i'm going to store the tile size up here tile size is 16 by 16 so i'll just put 16. so let's wait up lit tile image at tile size by tile zero tile size by tile one and we should have some tiles no i know like i didn't finish my topple there we go so i got some tiles um this actually might be a bit big i don't know so huh yeah now i'm gonna have to kind of get him to stick to the ground and stuff like that i'm gonna drop him out of the sky so i'm going to have like tile uh drop so these are going to be tiles dropping from the sky um i'm also going to need a game timer equals zero game timer plus equals one if game timer is more than 30 game timer equals zero and i need to spawn a towel drop so tile drop stop and um i need to get the width here so i need to resize this to be a multiple 16. uh i'm gonna do the math real quick in another window so let's 260 divided by 16 and we get 16.25 which means i need to add 12 272 or i can subtract four so i'm actually going to 240 256. i should have known that was the nearby multiple that's a very obvious nearby multiple of 16. so what is 340 divided by 16 that's going to be 21.25 so that's going to be 336 i believe 336 divided 16 is gonna be at 21 21. so 512 and we're gonna get 672. so that's our new dimension yeah okay so those are new dimensions um and i need to spawn tiles so uh with equal uh map width equals should i line the edge of the screen with boxes maybe i'm actually going to do that so [Music] i'm also going to need a height thing i hate zero so it's going to be minus height and height plus equals 0.1 so it's going to start moving i'm going to comment that out so it doesn't crash so stuff is moving around now um i need to be moving the other way actually it says height goes up everything else goes down so uh i'm going to do an inch there so it's actually not gonna do some wonky math or something when i'm not looking so that's moving down uh that's just going to be like a camera movement thing i can make a move fast we but i do need to align stuff on the left side so um for i in range and it is i'm gonna need with hand height so width or i'm gonna do a window tile size equals display that i get with and i'm going to do integer revision and i'm going to do it with height as well so window tile size um think about integer division and python for some reason it doesn't return an integer returns a float that val with a value of an integer i don't know why it does that anyways um so for the range of the height so window tile size one and i'm going to do plus one because you want an extra tile to work with and you're gonna do it's gonna be placed in the game world space so height you're gonna have to consider the offset here divide by 16 um position uh i'll do position y equals height divided by 16 minus one you want to start above and then you work your way down so plus i by tile size and now i do this with um well this is gonna be zero for the first one and then i'm gonna do in tight and then position y position y and the same thing but there's going to be tile size by it's gonna be window tile size zero minus one to get the other side of the window no i missed apparently where is this even going did i do my math wrong oh it needs to be like negative height i should do it no what's it doing well it shouldn't care about height height should be zero so you get minus one i'm a little bit confused let's see if it's printed well if it's running at all yeah it is where's it going let's see print position why why is it in the i mean that doesn't sound that sounds correct where's it going though negative one wait what oh no that's not correct uh so i'm not supposed to do that there we go there's my edge so we're not gonna do height plus equals 0.3 and it just kind of rolls so i'm going to throw another one in there so that it's it should scroll infinitely now um i'll put one and six there for now demonstrational purposes so now i have a rolling background um the walls are just kind of automatically there they're not actually in the tile data that's what that stuff i just wrote was for um okay so with that done i need to do the following tiles so that the tile drops so these are going to come from the top so it needs to have the x and y position so it's going to be tile size by and then i'm going to need random random 0 to it's going to be window tile size zero minus one now it's actually gonna start one and then [Music] the y position is just going to be uh so it adds the height when rendering which means it's pushing it down so pushes everything down [Music] which means i'm going to need negative height yeah sounds right so negative height minus tile size quartile and tile drops display that blit tile image to tile zero zero and actually uh where's my wait i can just do tile there we go where my towel drops did you do that wrong maybe oh no i didn't tile one plus equals three yeah there we go they start falling so i'm wondering if i should like shrink the scale of this a bit so i said like 256 i could do uh let's 128.64 is going to be 180 190 194 and then the width and we'll do and that's the that's the width so this will do 256. and then 194 times 2 is going to be 388 and then we've got 512 so when the tile side should automatically adjust there we go this number is going to need to be increased uh i'll actually i'll define i can't do that first there's a reason display size equals that and i'll just do display size here displays size zero by three one by three so here's our game now oh stuff on the right one pixel off did i do my that's no that's not an odd number what how'd that happen no that's two pixels probably 192. yeah that's probably right so now i need these stuff to stack on the ground i'm going to stop the scrolling because i don't need that right now um so these tile drops need to turn into actual tiles when they hit something i also am going to decrease this number to like five so that i have like a bunch of them um so when these hit something need to check how much it is so i should go by the bottom position and see where that i can go to the center of the bottom do integer division and see where that lands um technically i'm working with negative positions i'm just going to get funky across i'm crossing the line so i'm going to have to i'm going to have to floor it probably the floor goes yeah so i'm going to have to import math to do flooring because when you start the game you're going to be in positive coordinates and it's going to go negative as you climb up so in integer truncation truncates um it doesn't consistently go in one direction i don't think like negative 0.5 will truncate to zero but 0.5 will also truncate to zero it truncates towards zero i don't know what i don't think i'm using um okay so i need to get the position why not that's gonna be here so position equals um tile by tile size plus tile size and i'll do that and then tile 1 by tile size um actually these these are raw positions i don't need to do that so it's just tile zero plus tile size two uh tile one plus towel size so check position equals it's gonna have to be tuple because i'm gonna look it up in my tile list this is just a good optimization stuff um i'm going to end up with position zero i'm going to do tile size position one tile size i'm actually going to add one to that actually i should uh before the update well before the render i should probably try to do this so i can render it in the right spot if applicable um if check position in tiles continue uh and then it also needs to be removed so sorted enumerate reverse equals true so i tile there we go so i need to pop it so uh tile drop stop pop i so once i hit something it does that so i'm gonna do if that or or tile one is more than what would it be would have to be more than height go like more than height i think wait no height more than negative height plus uh display size one so either way it'll pop um and i'll put like a minus 60 on here so i can really see it perfect so now if i take off that 96 minus 60 they should go to the bottom so they're disappearing right when they hit something so now i need to actually just spawn the appropriate tile so tiles tile equals um it tiles uh check position or uh put in a place position equals the check position but 10x check position 1 minus one so you want to place it on top of wherever it landed so set that to i'll just call it tile uh okay what should have worked oh no i need the um place yeah you can see they're stacking now and they're stacking on the ground are some of those slipping through yeah there's something through on the ground um oh wait no this is actually not gonna care about height oops that's gonna that's just gonna be more than window tile size oh no not going to test uh display size display size one so if it goes below there oh and then minus tile size so that should cleanly stack on the ground there we go so they're being converted into tiles just by um uh landing so they're switching from like an entity that moves around to a tile yeah so i'm going to remove this part because i do not need this anymore so with that i can start doing the rest of the game probably i wonder if the edge tile should look different maybe um i should probably also put a layer oh you know i don't i don't need to have um this case here if i just put a layer on the ground so 4i in range uh window tile size 0 -2 um i'll do tiles and it's going to be i plus 1 and window tile size 1 one equals tile here's the layer on the bottom that's perfect um and then all while i'm at it i'll just add a couple more tiles not too much house um so i'll do at one and at no tile size zero minus one that's gonna be minus two this is gonna be kind of cup shaped wait minus two yeah there we go so that's what i got and then i do need to build in some logic to figure out which like where to place this house because because i want to be put evenly spread because it you with the way it's laid out you can't really jump up if there's like a tower in your way so i want the rng to be a bit more fair this is gonna be a bit weighted so let's see i need to keep track of the stack heights so i just look at the latest tile placed on each of the spots so stack heights equals um and i can do it by index so for let's do i guess to start with it's going to be the base at the bottom so that's going to be that number actually um how do i do this window wait no do this one for i in range uh window tile size zero minus two and then stack heights zero my equals one and then same thing for the last one so this should keep track of the heights of the stacks um okay now uh pseudorandom yes kind of question b texas it's gonna look kind of like tetris but it's stuff it's not tetris so whenever i place a block um i'm gonna wanna increase the stack height there so stack heights and it's going to be check position 0 uh minus 1 equals and then it's going to be that so the placing position i i can just do place position one i should probably use place position here as well um so i'm gonna make sure it doesn't crash and then now i can uh start doing other stuff here so right here when i'm gonna spawn something i can go through uh i'm gonna do a very simple algorithm here so for uh stack and stack heights if um i'm gonna do that action if stack [Music] one wait no it's stacked i guess it is just stack i'm gonna need an eye enumerate if stack is less than min uh i'll do none [Music] actually i'll default it to zero so don't cause a crash when there's something up okay so if stack is less than min one uh minimum because min is a built-in function if stack is less than minimum one uh minimum equals i stack and then i can just place it at minimum minimum 0 plus one that didn't um huh oh that needs to be by tile size white house eyes um hold on wait technically this is a maximum i think because the higher the stack though the lower the number will be wait a second that's not working right let's what's up with my things here because it's not what oh so you want it to be that so it'll start like placing them in a line because it's finding the lowest one well every every time because it doesn't count where they're being going to end up when it spawns them it only counts instead of actually been placed but it will slowly evenly throw it out so i can use something like this but instead of just taking the minimum i can balance the chances by the height so i should do this so for this i actually do need to know the maximum value so i can actually just do a max of the stack heights so uh actually no min stack heights to get the um okay now i'm gonna flip what i mean between minimum and maximum minimum is actually going to be the tallest stack so now with reference to that i can i'm gonna uh let's see i'm gonna pick a random stack that's shorter than the tallest maybe wait no i can't it needs to be a chance to pick the tallest as well uh no i think it works so weights equals um or right now uh i can call it options equals that and it'll do a random nut choice on it so four stack in there and i i don't need that anymore like i don't need the enumerate because i'll enumerate the options because the options will be indexed the same so um offset equals options right now okay let me stack and it's gonna be relative to minimum so the minimum is gonna be lower um so how much is it greater than the minimum so minus minimum and then options append offset no wait for i in range uh offset plus one options to append offset now actually i'm gonna need a new right here i forgot i'm doing right on that choice so append i and then i can do a randomness choice on that [Music] so the more likely option is going to appear in there more often so when i do random that choice on this small because they get picked [Music] if i did it right did it do it right it's not placing any to the right why is it not placing any to the right is that okay uh huh did i do something wrong here [Music] hold on it's favoring the left side that that's weird iron range offset why is it favoring left sides michael i'm gonna run it again see if it does the same thing uh or is it favoring which already no it's favoring the left side is it it looks like it's favoring left side it's so weird that it doesn't like to place on the right yes it's for a game jim oh you've oh i've used i twice oops yeah you're right on that oh and then i i do need to and there we go that's what i needed so now it should be pretty evenly spread out i'm probably gonna be able to as a player jump um i guess two blocks should be fine you might get like trapped or something i guess it's gonna be the player responsibility to keep up with that so i'm gonna have to keep track of the bottom row here um and if a bottom row is full then i can or no it's gonna be second to bottom row the second bottom row row is full i can increase the height start rolling the screen up um so i have to find the bottom row can do a max with a key is that a thing let's see default oh it does have a key oh that's awesome so i'm gonna do a max here so i'm gonna do max on tiles key equals lambda x x one so now i'll get the bottom value so bottom tile or bottom row equals that uh so the bottom row i need to check the one above it so because you always want like a layer below that so you can wait a second you could technically block it off and i don't need to worry about that so i'll call this the base row because it's not actually the bottom the bottom's going to be what baseball is going to check and see if you can scroll up so 4i in range and i'm going to do window tile size 0 um and i'm gonna do minus two because i'm skipping the edges um filled equals true and then i'm gonna do if uh it's gonna be i plus one and base row not in tiles filled equals false um if filled print and boot so let's see [Music] what why didn't it like why is max returning max return to tuple what's that supposed to mean oh that makes sense so i'm gonna want to take the second value there so i only care about the second one so once the bottom row fills up i should get a thing telling me that it's filled up boop yep so now that's filled up um i'll do a thing called target height equals zero if filled i should do this target height equals height and i'm gonna do a height masked up floor oh i need to uh i'm actually i'm gonna do this needs to be math.floor and these also need to be integers sometimes it doesn't return float i don't know what it's doing i'm just gonna run double check things are still working yeah okay so i'm gonna do math.floor height of plus 16 and i'll do if height does not equal target height height equals target height minus height uh no need to be plus equals that's not a plus come on divided by let's do 10 um and then hmm [Music] if and then i need to take this difference if the absolute or the difference is less than 0.2 height equals target height and i need to delete the bottom row so i'm going to go here um dell tiles and then that that should adjust everything did a bunch of quick uh logic there didn't double check it so um oh okay yeah that's where i gotta be careful there's a lot of issues there um what could have happened there so it wants to go to the target height what's setting charging uh uh okay wait that is 16. wait i wonder if the integer division floors it or if it truncates it uh i'm not sure because maybe integer division was doing it i'm not gonna mess with that because too much thinking i also need a bit tile size instead of 16 that's not right so it should delete bottom row and should stop moving yeah uh it deleted two rows what [Music] oh so it doesn't you need to do it the base row plus one not come on almost there it's like skipping those two holes should get them soon bad rng let's go did i break the rng or am i just supremely unlucky there we go it's like glitching out oh no oh i know why so when i'm rendering these things i'm not applying the height towel zero tile one plus height hopefully it fills up more evenly this time that was some nasty rng i just had maybe i should like square things see now it's placing correctly i'm gonna square the odds um where is it yeah i'm gonna square that hopefully that doesn't give me a float or it's gonna crash okay nice so it should be significantly more likely to fill in the holes now potentially too likely he likes leaving those holes is it wait okay that that's not looking right it's like something has to be inverted i'm gonna actually print the odds uh so i'm trying to wait for there to be a significant gap so we had like the first one should have a very high rate i i need to keep track of the indexes better i need a stack of three [Music] so index to shoot in one should be very different [Music] oh wait aha i know what happened that's the problem now should even out more because if you notice it was getting tall next to the holes yeah there we go that's better it can tell next to the holes because um it was placing them to the left because i was missing a plus one because of the walls on the side [Music] so i don't want it to be that strongly influenced so i'm going to do a 1.3 [Music] oh that's going to need to be like an integer and that's actually like a difficulty control like like it it balances out the spread the higher that number the more um it'll get um spread evenly so you can give it a low number you're gonna end up with a couple really tall stacks so i'm actually gonna turn it down see what happens i'm gonna get some tall stacks i think that's fair that looks fair i do want to turn up the rate though let's just make it rain we so give me a lot of dodge if it's going like this all right so soon i'm gonna have to start putting the player in um and then yeah i'm gonna have to be able to jump around and stuff and uh yeah question be pretty easy i'm not gonna do the animations right off the bat and then uh after doing that i'm gonna do chests and then abilities and so there's not a whole lot for me to do here it's not that complicated of a concept and then i'm gonna have some fun with visual effects mainly uh glowing particles and uh well yeah glowing particles maybe i'll add some screen shake um so i could add a screen shake whenever it rolls up so um i need to take a quick break i'll be back in a bit i'll leave this running so you guys can watch it um this will also serve as a test to see if i've got some sort of memory leak uh so i'll do notepad brb let's make that real big so everyone can see it okay i'm gonna meet and i'll be back in like probably less than 10 minutes okay [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] okay i am back so it looks like it's not lagging so that's good um it means probably i don't have any leaks sorry probably um so yeah time to add the player into here um i do not remember how to use my entity class here i'm gonna have to uh open that up so data scripts empty so i'm gonna have to import that as well so from data.scripts.entity import entity um i do need to collect a bunch of wrecks for the tiles so tile rex equals that tile rex stop and pie game direct um and i can just take this oh wait no this and then with the tile size tile size and now that should be good enough for conclusions i don't need that um so yes this is my game uh i need to put that in the frequently asked questions it shouldn't be i or i can put it normally to the title that usually fixes that question uh okay so i think it assumes like it's animations and stuff ooh i made a mistake in the folder structure hold on that needs to be animations player and then idle [Music] softer assets animation oh no so animation wait hold on information later hold on okay i think you can pass it this the animations so i call this assets so initiate it with a path so from date data.scripts.entity.com loader import animation i want the manager so i need to create the manager and i'll do animation manager equals anime come on and i'll give it data images animations uh turn on animation manager that animations see what i got takes one argument what oh it's a constant uh perfect i don't have to do that same so it has that oh so let's initiate the player so uh player equals entity well not initially initialize that so assets position size type so assets so animation manager.animations or no i think it's just the animation manager um and then it's going to be position size so let's do 30 30 [Music] and taking like 10 8 10 16 as a size and then this is going to be called player first of all i'm going to see if i get a crash from that no crash cool um need to run over to player so the player can be rendered with the render function presumably so render surf offset and it's got an update as well so player.render so i think the update's just for animations yeah um so down here i'll run to the player so uh uh player that render display and i'll give it an offset of zero zero for now aha he didn't like that oh okay so it's not idle at newsbeat player idle maybe wait no is it that's the animation how did i do this i'm wondering soul cause i copied the file zone so maybe this isn't what i used i may have not used the animation literally let me let me see what i did the local games running soul so i would have put it in here i can probably just search for player equals animations uh do you have those libraries somewhere for you i'm not quite sure what you're asking if you're asking if you can get them they're in the those i'm using right now is from the wandering throw source code i can't find it [Music] so looks like i'm doing the same way i wrote this so long ago it's been a while so asks just passes the first argument so it goes to the animations and it checks if the type idle oh i don't have i need to be player idle and then this needs to go up here and this needs to go up here and then delete that and what it should have an image there's the image right there so data frame serves negative one zero which means it couldn't get the frame like i'm gonna quickly just go over here in frames so this is five where it's loaded yeah and a so it's doing stuff there oh i see what happened frames i'm gonna delete that and let it regenerate it there we go i have my player finally so now i need it to actually exist um so i have a move thing i think move move where's the move function move motion tiles so um do i have uh i'm a class player that class player entity i'm gonna do uh player is gonna be of a player type jeff init cell self args [Music] so it should be the same now um that can actually attributes to self. velocity wait no self dot yourself the velocity equals zero zero um def update cell dt so dt is going to be one so i'm gonna actually do that so self. no it's gonna be super dot update and i'll just pass it one since i'm not doing dt um self-doubt velocity one plus equals uh 0.3 uh hold on i'm gonna do a little max hack here or min hack and then that plus 0.3 and then the maximum velocity before or something like that self dot move [Music] um [Music] i should do this i want to do the move uh whatever self or motion equals self. velocity self.move and i'm going to accept the tiles here cells um f move motion tile so motion motion emotions and then tiles are gonna be tiles i'll take this actually i don't need a copy there i just need to do player dot move and i'll give it the tile rex i don't need to pass motion or no uh not move update so [Music] okay interesting i need to do the height offset so it's going to be display with um zero height maybe negative height though let's see there we go is my image taller than i thought maybe [Music] oh i was putting some patrols here um [Music] shelf.right equals false self.left equals false um yes self.right motion zero plus equals two i'll i'll do self.speed give it a little configure configurability um now let's do left and that will be minus the speed so the self.speed equals two not three and if event.key in uh key write key d um player dot right equals true and then the same thing but left and a left now i can go over here a new key out for false it's key up place this with false uh i'm not using compiler uh python is interpreted key d is not fine uh i need to import from five game.locals so from pygame.locals import oh it's also not capital d is lowercase d so i can move so for the following tiles if i hit it i lose um i'll do i'll just have a variable called dead equals false fossil false so if not no not dead uh and then i'm also gonna do four tile oh i need to do offsets here [Music] so how does the image compared to [Music] this thing okay so kj project data images i'm actually going to increase the size here give some space for a running animation later so it's 16 by 18 but i think i only gave it eight and is it evenly split four on that side four five on that side huh i'll do i'll simms four on both so minus four and since it's 16 tall minus two uh maybe it's the other way so it might be four and two i think it assumes negative so i can't jump yet um i'll do w spacer up for jump i'm not gonna uh hold on so if that can jump equals true um [Music] wait so maybe i'll do self-doubt jump so you can get multiple jumps and then death attempt jump self if self died jumps self dot jumps minus one self done uh velocity one equals negative six um if event key in [Music] key up key w or key space you can do whatever you want player dot attempt jump so ah it's not lower case stop see space so i cannot jump anymore because i need to add the thing a little bit but the other thing that i'll reset my jumps when i hit the ground so that'll be under the move i think it returns what i've hit so hit list bottom so collisions equals that if collisions bottom shelf that jumps equals self.jump max self type jumps max equals two so i can jump twice cool so now um close the config i'm going to decrease that jump force because i'm jumping really fast or actually i'm going to increase the uh gravity because that gravity is really weak so i can jump roughly too which is perfect um i'm gonna set the flip based on what direction i'm facing so i'll do that in the update i guess so if self.motion0 is more than zero self. flip does it only flip in one direction or do i have two flips because it's horizontal and vertical yeah okay i'm gonna assume first is horizontal equals fault uh i know it's actually true because i'm facing the other direction if self.motion zero is less than zero and then i'm gonna do those false [Music] uh i see you guys are spamming chat player has uh oh it's just there's no self there um yeah python's not hard to learn but it doesn't make it a bad language so i need to i think the gravity is just a little bit stronger well it's gonna feel strong for most people um so i'm gonna weaken things just a tiny bit can i still jump two blocks barely um so i'm gonna weaken the gravity just a little bit so it should be a little bit easier to jump two blocks ah yes so i need to do the death part um death or actually just not dead so for actually i'll do the collisions up here when i render saved performance okay so r equals pygame.rect i'm going to splat the position with tile size tile size if r dot collide wrecked player dot wrecked dead equals true so if i get hit by one of those falling blocks i'm dead okay that that looked scuffed um huh where's my hitbox i am going to draw direct uh and i'll it's actually like a display player.wreck i can't do it copy and wreck i assume i can r equals that r dot x um plus equals height uh so just i'm gonna make a red and then r so there's my hitbox that's where it needs to be why did i just hold on [Music] i'm gonna do the exact same thing so r2 r2 r2 it's just stuck behind the what where is it oh oops we are oh that's not good right uh so it needs to be tile zero not tile size how one light size so now my stuff should collide properly why is my hitbox all the way over there [Music] um oh i was off setting x not y but i was getting rained on by those blocks it should have hit me [Music] uh why where are these things where are the wrecks cal zero oh wait i don't need to multiply by tile size because these things um they're not in terms of uh grids [Music] so yeah there we go i should be the correct position so if i do plus three you'll see i got a red thing below it [Music] so now i can like actually play the game [Music] you'll be very careful to um so i think the death thing should like kind of have an animation sort of like how the potato bird dies to make it clear that you're getting uh what that you're losing to him touching it not because you're getting crushed by it [Music] only thing is um you can technically drop down above and you would think that wouldn't hurt you i don't know okay when i clicked compile and run i just have keybinding there's no compiling it's python so okay i'm satisfied with that hitbox so um dead needs to be a timer or no actually doesn't i can render an update the player still i i guess i just need to uh yeah i see what i need to do hold on uh so this can come over here else and i'll pass it nothing so if i die i'll just fall to the floor yeah there we go so now uh if i'm dead i'm gonna do player dot rotation plus equals two boom ah did that not work hold on where's my entity and see that rotation it should work um hold on is there some reason it's not using it i don't what that should work i'm also going to player dot velocity uh equals five negative eight oh it's just rotating really slow boop boop uh all right wait it's taking a while to is it gonna come back down what it just keeps going up oh because it's being set every frame uh here let's do this so where's the dead thing if not dead then do that [Music] and i'm going to make it 1 negative 10. boom it means me that much and i'll do 1.8 and then down here case needs to be faster and i'll put in the other direction or maybe like 16 is fine so like don't touch the blocks yep there we go so now i kind of have a game it only can only play once uh there's no score yet but i've got something uh oh right i forgot about that um hold on so i'm gonna do a little bit of a hack here and add those walls in uh tile rex the pen so it's going to be high game direct 0 and this is going to be the first position uh actually i can dynamically adjust it based on the place position so player dot y minus 30 uh tile size 60. so these are going to move around should be fine though then i can copy this and i should have wall dot position one here we go i've got walls on the side now if i were to render those wrecked you'd get some weird so anyway i'm gonna show it just for fun for our in tile rex uh our equals r copy r2 plus equals height highgame.raw.rec uh not screen display i'll call it all with the red and let's go with r2 so uh r2 dot y here's all the hit boxes so you can see what i'm doing what i added there with the walls i i didn't want to put the math in to figure out where the walls should be based on the height it would be power to figure out like 20 seconds or something but this was faster to figure out and there we go i'm going to remove those that was cool to see but we don't need that oops it's ugly already pretty hard all right okay there we go so i've got something going i'm going to turn down the tile rate i'll put 15. so it's a little bit less chaotic so both the harshness of the spread and the um the drop rate are going to increase as you advance to make it harder so there's gonna be like two different ways the difficulty changes um yeah why do you want to make a player hitbox more i think it's fine um i could make those uh might make tile dropping hitboxes smaller though where is it there we go i can do like minus four i think you're very careful or i'm gonna get physics glitches if i adjust it too much so i'm gonna give it like two extra pixels uh wait no that's not the right stuff it's um uh uh where is it the dropping one so this one uh nice to x two plus two two fractions four um pie game is only cpu right now i it does use the cpu a little bit but it it's not like meant to be used that way uh i mean it uses the gpu a little bit but it i'm not sure why it does there's just a tiny bit of hardware acceleration on some operations i'm really not sure why um but in pi game two there's going to be functionality for uh hardware accelerated rendering the functionality is already there technically just not documented [Music] um so yeah i need to add the chests next so the chests are going to be interesting um i think i already have the chest image loaded so i'm going to just like have a chance of it occurring uh let's see so where's the spawning spawning should be up here yeah child drops okay so towel drop needs more info and so that's how type i'll do tile type equals tile for now uh if random.random one and ten is one i'll type equals chest um and i'll do tile two [Music] i'm gonna do now this is gonna be in tile chest but if tiles tile is chest i need to render the chest on top so it's going to be chest image and then it's going to be fly tile one minus one so under the chest on top i think i already loaded the chest image in yeah i do i did so i need to also render it on top over on the drop things which is going to be right here so if tile 2 is chest i need to render that chest image minus tile size so there's a chest uh i do need to set the correct key on that uh i'll do def load image path uh image just i shall load path convert image.set color key let's make it zero e turn image and it's just gonna use load image now load image to child chest and chest and then i'll do playstyle um cython and number just make it used to cpu more efficiently and it doesn't help with pi game because pi game is already written in c well it wraps sdl which is written in c game's not slow because of python well it can be sold with your own implementations because of python but it's fundamentally slower because of uh uh cpu based rendering so there's nothing stopping people from using gpu based rendering with python and that's what you can do with pi opengl um yeah i think there's some other libraries too i don't really need the performance that much so i need these chests to get crushed so when i add a tile where's the continue thing okay so if the uh check position if that is chest print pop uh this is gonna need to become a tile so once it gets covered yeah that goes um i'm gonna apply a visual effect then so uh there we go if you do like loot for four or four loops we wet if you do like a loop of four loops with millions of steps it will be slow well um yeah i mean you just gotta optimize your data and stuff like i'm going to be doing a ton of physics calculations in this one but because of the way i've structured my tiles onto a grid i can um do some shortcuts with the math to make it super fast but you'll see later okay um just watching crashed okay so i got the chests question is are vfx or items next um i want to do the uh i want to do the the jumping the way i did it in super potato bra where you spin so self that jumping equals false and if you jump it'll be true and it only gets set to false if you land um self. jump right equals zero um i'll do it if self.jumping self. jump rod plus equals one or i'll do like uh 16. if self.jump rod is 360 i'll do uh equal to 360. self.jump rod equal zero self. jumping equals false um and then i'll do self.rotation equals self.jump rod so it needs to turn with respect to um the direction so it's correct when i do it that way that way it's not right so if uh [Music] i'll do if self.flip zero else so i need to navigate control player when i'm doing that um dead is technically global so i can actually just do if not dead as long as you're not modifying variable you don't have to type global in here i think that should have killed me i can't control it so that's that's good so i need like a center rotate on this thing uh cause that's looking wonky um do i have a center routine i don't think so rotation so it does this um rod offset equals zero zero oh that's an interesting thing that just happened okay i didn't know i could i haven't oh i wasn't in that yeah i forgot i can uh shift lines with control into the brackets anyways it's just in my muscle button right now i think about it okay i hit ctrl instead of shift here so a ridge size equals self dot image i get size um and i can take the difference of the size and use it for the offset uh divide by two and offset it so if the original size is smaller i want to move it to the right which means i need to subtract from the current size so uh uh right off set equals image image i get width minus bridge size zero uh cut in half it means i get height minus ridge size one cut that in half um now on the render uh let's just if not centered if not centered don't do that so it seems to be plus right offset zero and plus right offset one i think i did that right so that looks smoother i can um let's uh slow it down so i can really get a good look so it looks smooth um hold on i'm gonna do i'm gonna reset the uh rotation if that happens so i'm gonna set it back to 16 and get our smooth jump again um i'll probably have like a jump image thing for when it's in the jumping state i could actually squash it do i have a scale thing we do hold on self.scale one equals 0.3 else one just squash it oh it doesn't work two i saw for a moment what is uh it doesn't scale if it's flipped why is that happening oh is this there we go so and set that back to one 0.3 that looks so funky uh did where's the original thing it's like um replace it right there wait where's my offset math wait what why did i write on my offset math i wrote it somewhere oh i wrote in the animation thing okay that works i guess um i don't think so actually that offset that's not even running i think seven will do it that's better it's more uh spec engine vibes it's spike dungeon in the opposite direction by the way hold on okay so if you hit a chest you need to bounce off of it and it needs to open um hold on where's my open chest um i'm actually on windows right now uh which you can tell from this thing here but um i i use linux for some stuff it depends uh unfortunately i cannot stream on linux because my equalizer does not run on linux so you get a weird um the audio wind sound is good open chest open chest okay we have two chest images wait no hold on so open chest uh well um so if it's chest chest r equals and then i'll do it this thing it was pie game.rect and then i'll do tiles size tile size actually doesn't need to be quite that size so i'm going to make it a bit smaller plus two and then it's gonna be minus four and this one's gonna be minus uh six and i'll do plus six here and if chess are to collide wrecked player direct um tiles tile equals opened chest and player dot uh velocity equals velocity one equals negative six or something and player.jumping equals true um actually what i can do player dot jumps plus equals one player dot attempt jump that way it'll do all the normal gem processing and we'll just use a free jump uh now if tiles tile is opened chest let's do this needs to be like an alif because otherwise i'm gonna do things when i swap it anyway um open chest it they're getting crushed so fast what's going on here i think you're getting crushed it was staying before it's not that i don't think wait um what could be happening what scale thing um does anyone in chat work as a programmer i do i'm working full time right now so print boo is it like crushing them i'm not sure what's going on there why aren't they showing oh oh i see it's that so i i need just an if there now i should be able to open one of the chests oh that didn't that's that's sad disappointing um chest uh okay so i don't need to apply the height that's what it was just plus six why are they oh boy actually no so that just needs to be in all cases under that that was a dangerous thing to go for i can't get that one i can't get this one so that's going to shoot out coins and stuff so for the coins i'm probably gonna use like point collisions and stuff because otherwise uh it's gonna be slow actually maybe not i might do an optimization thing for looking up wrecks on the grid so yeah i'm going to look up to well at the optimization thing so let's see death look up nearby so tiles position um i'll call it center no um so for offset in and i'll have this list of like zero zero uh a to one negative one negative one zero negative one one uh zero one zero negative one one negative one one zero and uh one one uh so lookup position equals position is zero i need to tell size so take that plus offset zero and then now i gotta do that for the y-axis so i'm looking up nine locations around whatever position i get in my tile map so if lookup position in tiles return tiles look up position okay turn uh wait no i don't want to return it like that rex was that so rex append high game direct um look up position 0 by tile size look up position 1 by tile size tile size and tile size return right so i'm not i'll do that with the player make sure that still works so i actually do not need what is this one that's the wall oh i do need that um actually i'm gonna have to fix this wall now sort of and not really i can just do 600. this isn't going to run any slower math is still the same uh this one is the same thing and i'm gonna delete this line i don't need that anymore uh plus and then it's going to be look up tiles and then player.center so physics still works and it should be significantly faster because it just looks up it looks up the the tiles nearby instead of looking through every single one so it only tries to process nine collisions instead of like a hundred so i'll make it so i can make all of the other like item drops and c's and whatnot so um where's okay so i'm gonna do class item and entity so i'm going to do some of the same stuff here um self.update i'm just going to need ooh [Music] can i do that um philosophy so update uh i just have to do this one and i have to do this one and this is going to be just self.velocity there we go i'm not using dutch time in this game um so is is there noise right now you're probably hearing the ac hold on hold on i'll see if i can i do have noise suppression it's being suppressed uh 30 uh decibels that's a lot i guess it's not recognizing it i guess i'll mess around with it later but it's picking up like a fan in the ac summer in florida so um i need to add the items so these power things and the coin they're gonna go over here so i'm gonna actually just call them coin idle since the entities they have to use animation so um warp idle uh block i don't want to call it cube or block i call it cube of course i guess wrong q idol and we've got um jump idle so these need to go in there and then let's put them in their associated folders and then this needs to be just called image 0 cube image 0 uh jump i'm just image zero image zero uh oh you guys someone scooby i sure was pretty quiet you can probably hear it i hit my pen you probably just need my keyboard my keyboard's about as close to my mic as my uh my head so you're gonna pick up a lot of keyword sounds i can move it closer to my face uh that should be a little bit better um yeah probably the fan then which i said before so yeah i need to add the items so items equals that uh so i'm gonna have to spawn all of the items in whenever you hit the chest it's gonna be right here wait no here so item uh is if random that random uh one to five is less than three um you get the power-ups so items append item and then i have to give it like position size in the animation manager um what is the size that's an interesting problem because they're each different i'll just mess with the offsets to get it to work um let's do so this is going to be the base the position it spawns at so it's just going to be uh what works for you oh you talking about the noise reduction no um so my issue was not with noise reduction my equalizer doesn't work on uh linux the noise reduction is built into obs um okay so i'm going to do tile 0 by tile size uh let's do plus 0.5 that'll put in this center and then i can do the same thing for x and then it doesn't need to be actually yeah i i'm not gonna do it like that i'll do it by hand so how is it gonna be like six wide probably so five uh i don't need that opening parentheses that one by tile size plus and then how tall is going to be i guess i'll make it i'll make it six by six and then six six and then uh random.choice warp cube or jump and then the velocity equals random.rand [Music] random by five minus 2.5 and then i mean some of the the sounds in this music are making me think there's something behind me um random. um minus nope by three minus seven else uh for i in range random that random two to six it's gonna be coin i need to render all the items and update them as well so for item in items uh item.update uh i'll do terrestris the same thing here and it'll be item.center um item.render display zero minus height so let's see how this goes where's that else hanging 180 i said it did i not like close this off properly so i should see some items there we go so i i need some velocity normalization on the x-axis um leave this in here normalize normalize normalize no normalize okay look down normally um i'll write it over here def normalize position amount or no uh spell if the vowel is more than zero val minuscules no it's more than an amount that all my skills amount a lift vowel is less than amount without plus equals amount else return zero and then normalize the velocity's x axis so self.velocity zero equals normalize itself the velocity zero by zero point zero five so from what i saw they did pop out at the wrong location like the items so that that sounds hard to fix here plus and nonetheless which entity is it 51 an update item update emotion is okay so up here i'll return none oops else val equals zero return val uh there's the coins that they popped out in the wrong spot [Music] uh i need to figure out what what's going on with these coins and stuff like how they're popping out so pop that aside i missed it's tricky so they pop that down there what oh is it like related to the height maybe am i like applying height or something this should be fine tells you by tail size is velocity also you should also be fine huh oh no because it's fine in the top well so that that's the items have some harsh gravity i want to make that lighter and do two and three they don't need to bounce up that much either so i'll do minus two by two minus five and then this number doesn't need to be as great or maybe it should like the idea of them going everywhere and you have to move around to clog them that way wait wait that's not the right oh no i guess it is could do two six those things getting crushed by so i guess i can check if a tile was placed on top of it so take the center of it and if the center is okay wait i also need to apply offsets hold on so i've got warp which is seven eight hold on see over here warp is seven eight which means it's gonna be it's two too tall and the seven is fine so i can just be offset one the jump looking at six ten so it's going to be four cube idle we got eight eight so that's going to be two and one then last one is coin which is gonna be six seven which means one so i can close these now and those should be placed better so the hitboxes are better so i need to let them get crushed um so all i have to do for that is look up the center position so game before it moves so if uh lookup position equals item.center 0 tile size do the same thing for the uh y-axis if lookup position in um in tiles i'll put a pass there for now and then i'll put enumerate sorted enumerate reverse equals true um items up pop i so they should get removed if they get hit by a title or tile or if they get covered by one i'm moving super slow i seem being deleted um i'll put continue because i don't want to update and render them because i get one frame where they've moved uh so once i get covered yeah that's done so it's moving a tiny bit i don't know how that's happening because it should the horizontal velocity should get normalized to zero oh oops if i was more than an amount got my less than negative amount there's the problem so that's what i was looking for oh i'm gonna crush um i'm gonna make the coin shoot a little higher [Music] than the power-ups okay come on one coin oh that's not coin uh so i'm gonna have to add the power up soonish um the question is should i do power ups next or visual effects because visual effects are kind of fun um huh that's a plug i guess it depends on the frame time if you time it perfectly and stepping towards the block you can probably get stuck in it it should be pretty rare though i don't feel like fixing that if it i don't see it too much again lots of coins let's watch them get covered and squashed [Music] so next up is the power-ups i have to do some ui stuff technically for that yes stl is different from directx and opengl um so yeah i have to do um pretty much just the ui stuff abilities and vfx sound effects music and i guess the losing menu so you can restart a tutorial so it sounds like a lot but in reality it's not especially since i've only been working on this for like three hours uh wait obvious should say how long i've been streaming okay i've been streaming for three hours okay um so yeah i'm going to go ahead and take another break for a little bit um so the if you can only die by uh getting crash bag block um i think the game is a little bit too easy uh but yeah also the physics for that would be um i mean i guess i can do it no it actually i could make it work hold on i'll do it right now a moment so your your center has to be below it wait hold on so how do i tell if you hit it from the side or you hit it from below [Music] yeah the issue is is that i have to do some uh physics hacks and that would take like 15 minutes and that's kind of like 15 minutes i don't have so i'm actually probably just not going to mess with it like it's um it's a combination of factors because these falling tiles are not treated like the other tiles they don't physically exist because the way i set things up but it probably make more visual sense once i uh add some visual effects for it wait i need my rotation to reset when i jump or is it jumping rod needs to be there we go okay so i'm gonna go on my break now uh games have to be submitted in [Music] uh one two three 21 hours but i'm probably only working on the game today i've got stuff i gotta do tomorrow so yeah i'll be right back uh probably 10 minutes 10 15 minutes [Music] [Music] [Music] [Music] [Music] [Music] [Music] so [Music] [Music] so [Music] so [Music] okay that was probably a bit faster than i said i would be but whatever all right so yeah i need to add the um first of all coin counter uh let's just score and then you know i think the tiles on the edge should have a different image hold on um [Music] let's draw something else up let's see so i'm going to take this tile and then file save as uh desktop data images edge tile and now i can just go over here edge tile edge tile and then down at the bottom here where i do my edge stuff where is it oh here edge tile fun so there we go there's the edge [Music] um hold on maybe i should invert the colors on this one so do that wait let me take the color first uh and then that'll be my secondary and i can go boop boop boop boop boop um huh throw black right there so that looks better like that i see some crushed coins down there that didn't get deleted properly these chests are dangerous if they throw you into a block i wonder if i should do anything for the background i would look good in the background uh i i'll do some black particles hold on wx squares uh actually should they hmm i now i'm getting some other ideas for what i could do with the background not sure i feel now i think i got the squares so random that random by so when uh display size zero and so it needs to be offset by height so i'll do display size one plus height so i know it's minus height since i'm gonna add it later but i'm gonna do parallax i'm gonna do point oh uh huh let me do this minus height by parallax and then parallax and this side well uh size will be random and didn't one two uh one two five so and then speed so random that random when the random five four plus by two plus one so for p and vg particles uh if p size equals p negative one no it's uh negative two if size um is one um or if size is less than one display that said at i said x y separate i need to make that one thing p zero p one plus height by p one wait no p zero zero and p zero one so set there and then the car is gonna be black else r equals pie game direct and and then it'll be this location uh and then size will be p two i'm gonna do two instead of negative two p two uh these need to be integers this is going to freak out at me uh size my equals 0.01 p 0 one plus equal uh minus equals p three the size speed um if size is less than zero uh bg particles the pop i i p and sorted enumerate that hold on with my thing okay uh reverse equals true that should be it for the logic oh p two uh-huh pie game really doesn't like the floats where are they i see them they're very small uh game.drawdirect display uh zero zero zero and r oh not capitalized so i like that background oh it's decent so i need to do um text now uh actually i'll just show like an icon on the top right uh all my streams are public now they used to just be in a playlist another public well uh they are in a playlist still like some of them are unlisted i didn't switch some of the public but all my newer streams are immediately public afterwards where they should be um so i'm gonna take this and this is gonna be the coin icon which is different from the coin item file save as coin icon coin icon equals load image data images coin icon png and i'm just going to show it on top left and i'll have a count yeah display that coin icon icon it's a coin icon image real quick icon let's go on i'm too lazy to fix it so there's my coins at the top left now i need to add text from data.scripts.txt import what is it text import font and path and color so do i have pure white in my palette is that what that is that's not quite hold on i need to copy it over uh white font equals uh font data slash font slash small font dot png and then 251 245 239 did i do that right see yeah wait half color yeah so i just need to um get the font which i do have over here i know that's rolling blades data take this one desktop akj project here so it's fonts large font small font and i already have some fun so white font and then i can do that render um so i need my coin counter coins equals zero uh what is it called white font white font render display is it's like wait it's um text surf location so uh str coins and then location is gonna be uh eight four no twelve six twelve five and then i need a shadow one i pumped out a lot of code so it's gonna be black fun um actually there we go so do the same thing except black font 13 6 so it's like down to the right but oh can't be perfectly black or else it's not gonna work it's a little quirk in my font system but now it's there i'm going to switch that other stuff to proper black here there we go now i'm getting somewhere so now i need to add coin collection so that number can actually go up um so the items need to do collision checks with the player so if item.wrecked.collide [Music] if item that type is a coin items that pop i continue and coins plus equals one so coin should work now i got some coins that worked so that's a power up i want coins give me coins that's also power up it's also power up i got two coins so i need a pickup delay so item uh self that time equals zero self.time for this equals one if item.time is more than let's say you gotta wait half a second so they're gonna fly everywhere i wanna let's put them all up ah i'm not playing this well right now that's a lot of coins unfortunately i cannot get all of them i'm bad i want to get like at least five oh there's two and i go ahead got trapped that's not coins that's also my coins i keep getting trapped those pits are dangerous you know stay out of them ah so i'm gonna make the tiles fall a little bit slower because that's a little bit difficult and then i'll make them less frequent for now so you have four i'm gonna get five here should just not be greedy i guess i'm gonna go for the chest that are actually safe to get well that's a lot of coins let's go 12. that's a new record i'm dead all right so 15 not bad uh why didn't i decide to use a compiled language um python you can make games faster in because of the syntax it's just uh you can write code fast you can write the same logic faster in python than most other languages if you know what you're doing uh so next up is gonna be item actives i'm gonna just do the ui and then i'll probably stop and eat dinner so it's gonna be like a slot on top right and it'll start blinking probably once you're able to use it so what color that one could use that one or this one um okay so now on the inside i'm going to do the start color and then i can do this one now i can do this i'm gonna add like another stripe right here so i'll do that oh i know there we go here's that slot i'll do a little bit of stuff here make it look a little bit nicer now that should probably go the other direction actually i can just rotate it put that back rotate right 90. and then i'll put some highlights right here there we go maybe a little bit detailed uh let's see if i cut off these corners as i look so the active version of this is going to be like flashing at you with uh this car and i'll put some of this white in here so yeah it'll flash at you when you have an item but for now i'm just to use this one so i'll say no don't print i'll save as itemslot.png and then i'll do this one i could probably put an outline around it as well and i think that's overkill file save as item slot flash item slot image equals load image data images itemslot.png you can do the same thing with flash i'm gonna use it for now but i'll use it later display that blit um item slot image to display size zero minus what is this 16 by 16 so 20 and four so there's in the top right i definitely surrounded with um and you just run it with a black thing okay so now you gotta do the corners and then i switch to normal black fill in those corners and then do the same thing for the other one so yeah the pure black is transparent but the black with the one is um will appear black um i'm a little bit concerned i think i messed up somewhere i'll find out so that that one's there um i'll to the part where it gives you the item current item equals none else so it doesn't need to check what type of item it is actually you can just do everything else regardless so but uh current item is that what i call it equals item.type you need to do that um i'm just going to instantiate an entity when i render this thing here um hey uh item nah it's easier to go the other way so that take this oh wait should probably make some icons that actually fit in instead of using the same ones so i get to work with about 10 by 10 so it should fit in eight by eight oh boy that's gonna be a problem i'm gonna work on a white thing real quick here to save me some problems with seeing things so here's the coin i i turned on transparent selection hello i guess it doesn't want to cooperate today so actually the coin doesn't need to go there because i'm not doing the coin just the other ones so do that oh that's also hard to see hold on let's go to red actually doesn't look too bad against the red uh so i'm gonna you're just surrounded i guess so is this too big to mate that's fine this one's tall yeah that one's big um i'm gonna shrink it a little bit actually you know what um let's do that and then i'll just swap the colors with the actual black instead of giving it a full outline that'll probably look better and now i can take it switch that to white now i'll keep it as red and i'll swap it later uh so needs to be eight by eight file save as and then call it the warp icon but i do need to replace the black and i can go back here grab the next one and then replace the black save as cube icon and then last one this one needs to be scooted over a little bit and then file save as and i'll call it jump icon uh where did i want to pixel art uh just looking at other people's work and i've been doing it for like eight years now i use a sprite for animation not for uh static images exams paint for static images all right so i need to render these icons so item icons equals load image data images coin who did i overwrite i did didn't i oh it should be the same wait no oh i know i don't do coin um cube icon jump icon and where's the third one or buy huh cube um warp jump how long have we been streaming uh almost four hours the entire game has been made in that span of time uh if current item uh and play dog bullet what is it they call item icons yeah i don't know cons okay so item icons and then i'll do these current item and it'll go here but it'll have like a bit of an offset so the thing is like one two three four five it's the offset i need i think there's our coins i messed up i keep getting coins give me some actual items here come on chest keep getting crushed that's uh i messed up why it's so hard to find an item all power up those are coins oh that was close i was finding really dirty oh i missed it and it got hit again and kidding me or maybe i was collecting it no i couldn't have been collecting it and just going fine i missed it can't reach it there's so many chests i couldn't get to the drops there we go there's an item uh i need to check some stuff i messed up i 100 messed up um at least with this one i know i didn't so first i'm gonna call it and it's like something i can see and then now i can do the zero zero one so that one's messed up too so give me coins i want to see the war i'll fix the jump one is while i'm at it though so this one should be like this and then zero zero one flood film come on what's new a lot of stuff uh added items and i don't know it depends on when you left come on i keep getting coins so there we go that one's correct no there's a warp thing down there i needed to get it but i couldn't reach it oh i almost survived that you know what i'm gonna do a quick thing to make this go faster lots of chests so there's that one i'm looking for so i got the warp i need the cube where's the cube there's the cube cube needs to be fixed yeah i guess my the black i was using wasn't black there we go there's the cube so and that is correct so now i can switch that back to normal and uh what's next is um i wonder if i should change i think i should change this tile so pattern is not very appealing how does that compare that's not much better so now i can copy this and rotate flip horizontal uh so this looks a little more like boulders or something ah the mirroring's not working out too well i think that looks a bit better all right so that's that um next up would be i'm going to add the is flashing what is the name flash if uh master o'clock percent 40 is less than 12. so i'm gonna do a master clock thing master clock equals zero master clock plus one uh i saw the flashing i just want to get a better look at it because i died last time flash looks good again wait i have an idea abs master clock percent 50 minus 20 is less than is less than [Music] three that one's way out there can't get that that's a better flashing pattern so you know you have it so the exposition of the warp image could be moved um i'm imagining the jumps gonna need to move as well those are coins i need a power up that's that's pretty good i would like to see the jump on the cube though got 11 coins and i don't have any power up unfortunate here's one that i can get it and that's actually the one i wanted to see and there it is again okay that positioning is good so i'll probably leave that on all right um there's a lot of changes i still need to work on the difficulty is going to ramp i just have it set for testing right now um also it's not going to be as hard as it looks right now because you'll have the ability to use the powers that i was collecting to get out of tough situations and stuff like that um and yes this channel well this stream will be available on my channel anyways so i've been going for four hours and i need to eat so i'm gonna eat and then i've got some stuff to do and i'll probably be streaming again around 10. i'm not sure so yeah i'll end the stream here and i'll see you
Info
Channel: DaFluffyPotato
Views: 13,329
Rating: 4.9513044 out of 5
Keywords: gamedev, programming, vtuber, dafluffypotato, python, gaming, video games, game jam, pygame
Id: u9v_jhVAdOs
Channel Id: undefined
Length: 242min 11sec (14531 seconds)
Published: Sat Jun 26 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.