[Music] hello ladies and gents my name is lost and welcome to the first episode of don't start pixel edition so we're going to be Korean a game which like don't starve is the name might suggest but we're going to do it like a pixel-based kind of thing we're going to create a base the base of don't stab is what we're going to create so I'm aiming to have you know chopping down trees inventory management things like crafting and we're going to get the base of like a survival game going so yet today we're going to
just get movement working and the room setup and all that sort of stuff so yeah let's get started so the first thing we do is we need to set up the room so let's go ahead and change that will say room and just we'll just call it room well it's like a big open well sort of place isn't it don't start let's make it massive let's go with 1200 are 12,800 by maybe you know 7200 that sounds good to me let's right off the bat really good practice let's get a state machine going we're going
to call enum the fact let me make this bigger I almost oh that would have been a real bad mistake add about two aware redone this entire episode I have not done this so yeah let's call it enum place state and just to begin with when I have controls that's the only state we need to start with this salon you know just going to be the state where we move and select things and you know all that sort of basic stuff now real quick let's just create an object ambolyn in the character object rule put
I don't really know why I just kind of want to name it object rule putting less stupid and we'd enough to be in a game like that staff so what we're doing no offense twin out there called rule put all like two of you I apologize so we need to enable viewports let's get any of your parts and we want viewport Sara this is going to be 640 by 360 just a really small like pixel it can of resolution you can do just do that again for the viewports and we'll make it follow object Rupert
now I'm going to go for a camera speed of two - one means instant like if you have that is minus one it means that it will always be on the player like like right on him all the time like instantly by like add to search trails a little bit you can play with that and do it everyone I really you know it's up to interpretation I guess oh yeah go ahead and put six watts by 360 in there and you know what just to start with Oh actually sorry everyone count out right first went
to Avenue and instances layer and I'm just going to name this player now I want the player to be on the player level instance level if you're not I mean like right at the top here because I'm later on we're going to want to be and closing I like deactivating a lot of instances in the instance layer and I'll see we never want the play to be activated and we'll talk about that later on though that's way off yet let's just focus on what we're doing here so we've got the room set up that looks
cool to me that's what we need to do now is we're going to add some sprites for Rupert and the grass passes to fly that so first let's go with and you'll find these in the link below I will link to these so you can have them so we're going to go with right Rupert idle and where is it it gives in here yes there we go so professor all we want the idle animation I'm just going to sort of put it down here sort of centralized maybe I like 20 by 5 6 will go
that game speeds going to be 60 let's not worry about collision masks just yet we could talk about that later time but yeah let's go for sprite will put run not soon but run I'm doing the exact same now I'll just beat this bit up and in fact what we're going to do is we're going to edit this image just a little bit because I've realized that it's like it's not touching the floor and it really could could do like there's no reason for it not to so we're going to go edit image and let's
just get the player entirely in here I think I don't think it'll go outside of there check real quick yep all inside on side good stuff and so yeah then I'm just going to go to image and I'm going to go to crop all frames to selection and there we go maybe that was a little bit anal with me yeah I don't know but I'm just going to do it this way and yeah let's feel like it was about there wasn't it the X&Y is going to be different on the origin because this canvas is
a little bit bigger but I suspect it was roughly there so let's go in there for now anyway let's not get too oops let's not get too clogged with that so now let's get the sprite tile grass on the girl like that and some reason I'm a really unorganized person some reason this is still in a strategy resource management project don't ask me why I'm just terribly organized hit get the speed to zero I'm not sure that's integral but I'd like to and now we're going to add that as a tile set so I'm just
going to RTI grass put it in here the tile width is 116 at our height is 90 not knowing but 90 there we go fits perfectly now we need to sort our object object to rule put so he is going to have some variables now let's just rename this fast so I'll get ridiculously lost in what we're doing so image speed zero point farthest just where he needs to be it's a I don't know if it just it just works the best depth is equals to minus y this also needs to be in the career
event but sort out in a moment we're going to start the player off right in the center of the room I don't know I just kind of want to have been perhaps later on we can make that randomized destroy stats before now it's getting right in the center let's set the camera Alex Mitch make sure the camera is um you know right on him to begin with it's obvious it's going to be following him but the cameras going to stay at the top left so it's going like ship the camera all the way to the
middle let's just let's just move it there like manually so if you've camera zero and we're going to move it to our X minus six forty divided two and our Y minus 360 deny two as well so what that will do is it because our room starts like our resolution starts at 640 by 360 is that right so yeah something like that up again eyes right so it will X so the 640 master - what's that 320 yes so it'll move the camera to the left that much you know that just puts the player right
in the center that that's all that's for let's have fun stats the only stats when you for know is my speed I uh yeah I've been called of fellas yeah what happens go on my speed I was going to say let's go speed but the game already takes that isn't it yeah it's so annoying that the game does that game maker does that but whatever will go on my speed and we'll set that to point five is start there and we need technical bars understand the potential we need state equals a place take controls half
an amide all equals sprite who puts a little ups and we need an in run let's go with sprite Rupert hooks and run there we go so let's go to the drive-in and we'll because we need to draw the shadows on these characters because then I haven't included them in the surprise so we're going to do in the drop so shadow and the way that you do that is you then let's draw a set alpha to I guess like 0.3 I'll say it like really translucent so you can see through it and then we'll draw
a lips with a color and we'll draw it on our X sort of start at the plays X minus 10 and at the play is y minus 5 so it's like slightly above the play just above his feet you know and then we'll say X plus 10 so it comes out wider than the player and we'll also go with y plus 3 so it like comes down beneath it beneath its feet as well you know this is just what I want to go with you can change this if you want to sit in play with
it a little bit then feel free like get get get where you want it to be and outlined bolts and then we'll set the Alpha back to 1 afterwards and then draw a cell because you have to remember that the lower something is drawn means it's on top of everything else so everything drawn on top is underneath it so the play over joint on top of the shadow rather than do the way around because you know you need to be still on the shadow or not the shadow on top of you you know anyway so
the next step is we need a step event and I've covered state machines and in the past on this channel in fact it was recently things last week so make sure you have a look at that and state-controlled collet because I go more in depth there about what's going on here so depth and equals minus y although I'll try I'll try going depth again but I would you know I'll try and do it swiftly so we'll have a switch we're going to switch the state like an if statement so what there's only one kiss and
our case is player Stokes play state dot controls and if the player state dot controls is currently ours then we're going to run this which we haven't created yet but we're going to in a moment we'll run the script script to player controls and then at the end of that you save break and that kind of need to stop so let's now set up this script play controls so we'll go into our scripts and we'll create a new one and yeah let's just make sure it's script player controls so first let's get the the character
movement if we hold down the left mouse button so we'll go if Mouse check button is mouse button left then we'll just say if sprite and X does not equal running run then sprite index B pause annum run and image index equals zero search that's right at the beginning of course if it if we're holding that left when the animation is already animation and then it'll just stay in the exact sub image related so that's why we do that and we'll just say if I'm at Mouse X is bigger or equal to the players X
then the image X scale really cool one so if this on the right else image X scale all equal minus one and then we'll just say empty potential step and we'll just head towards the mouse X and the mouse Y and my speed and we'll check all as false will check all is true actually this may change I don't know how we're going to do the passengers yet this is just I want to do it for a moment I don't know if we're gonna be using solids I don't know if everything we're going to try
and dodge everything I don't know if we're going to run through things I'd quite like your feedback on that depending on your answer might depend on how complete complicated this has to get but for now we'll just go on the basis that we're going to not be able to walk through things okay and then we will just say else so if we're not pressing the left mouse button we'll just say that travel X equals zero fast travel and y equals zero now I would like to say that this entire thing is subject to change this
is just how we're doing it for now this may not stay like this we may revise the controls and but for right now this is what we're going with so if the keyboard check is odd w like that then we'll say travel y equals minus 20 because obviously we're traveling up at that point remember when you - the way you've got booked okay and we'll just say else if unless in fact just copy this because I'll be collecting all day at this rate and I don't want these episodes to be too long because I don't
want it to be boring no I want it to be honored to be entertaining and fun and you know help you learn like guys it helps if things are you know nicely presented so let's go it's time ready to go and if keyboard check is here so this means we're moving left and this time we have to just have two lines for this one because you have to go first of all travel X minus 20 but we also have to say image X scale equals equals minus 1 and then we'll just say else if it's
D then image X scale equals 1 and we just equal it's just 20 yeah okay let's get rid of the plus 20 that was my mistake you should just be 20 so you don't need that was yeah nevermind I do apologize we also forgot to set rupert's sprite to trooper idle so yeah so next stuff we then have to say if travel X does not equal 0 our travel Y does not equal 0 because there is where it starts so we're just checking that and travel 0 so I travel x and y actually equals something
so then we'll just say if right index there's article annum run and then we'll just say sprite index equals animation run whilst image index equals zero and then MP potential step in fact we'll just yeah copy this copy this but then replace this with a travel X and also trouble y and then we just kind of have to say else and then we'll just say if sprite index does not equal onion idol then sprite index equals an in idle and image index equals zero so now let's just check that and make sure it all works
so as you can see we can move obviously this is really small and stuff and you know in the next episode we're going to work on an we're going to generate all the tiles I'm also going to work on making the camera zoom in and out and we're also going to allow the screen to be bigger because we're not working with this small little window can't do that so we're going to make the window bigger but we'll do that using curd and there yeah so thank you very much for watching guys and I will see
you in the next one hey guys lost here give the video a thumbs up if you liked it subscribe if you're new and want more content like this and please give me your thoughts down below in the comments catch you guys later