Hello everyone and welcome to the seventh and final episode of making 2D Minecraft if this is your first time seeing this series I’ve been making a 2d version of Minecraft in C plus plus over the past six months and it’s finally time to finish this project up and since everybody has been asking This game will be playable when you are watching this so stick around until the end of the episode so you can learn how to download it now without any further Ado let’s begin so in the last episode I asked you guys once again to write some fun phrases to Put on the title screen and just like in the previous episode you guys pulled through and gave some hilarious suggestions so I went through as many of them as I could and then added the best ones into the game so with that out of the way let’s start Adding some new features one of the things that I implemented a while ago now was a system to handle mops but currently the only one I have implemented is the zombie so I think it’s finally time to add some more mobs to start I decided to add two new Hostile Mobs the skeleton and the creeper I picked both of these because they’re both annoying to deal with in survival and I like the thought of you guys suffering the real reason is that both of these mobs can be easily animated with the model system I currently have Implemented animating a mob like a spider would be almost impossible since the leg positions Move Along three different axes so 2D animation isn’t going to be very easy to deal with either way to get started I transferred over some textures so that they can be used by our game and Then I got to work on implementing the mops in code my main concern in the beginning was just getting the models for each mob to render correctly but nothing works quite as you expect but after some tinkering I got the models to look exactly how I wanted them to after That I started implementing each mob’s corresponding Behavior for the skeleton this involves shooting at you but since I don’t have an entity class to easily accommodate arrows I decided to create a brand new class called projectile entity it’s a really simple class that allows me to create entities that move along a Curve as opposed to a straight line but that doesn’t mean that there wasn’t any problems though because one of the issues that arised was how to determine what block an arrow collides with this is important because if an arrow is stuck inside of a block we need to know Which block it is so that if that block is removed the arrow can fall down again at first I tried to Simply round the position of the arrow to the nearest tile but this wasn’t very accurate whatsoever so I ended up adding a variable to each Collision object that Every entity has to keep track of what block it collides with first so now it’s a hundred percent accurate turning our attention to the creepers now the only thing I really have to worry about here is creating an explosion if you spend too much time Next to a creeper now in order to make an explosion I needed some way of erasing blocks in a circular area so I wrote this function to generate all of the block positions within a specified radius it does this by generating a bunch of polar coordinates and then converting Them into Cartesian coordinates and then adding every unique position into a vector now I’m sure there’s a more efficient way of doing this but explosions are meant to be laggy anyways ah so if you go up to a creeper it will now explode and cause damage to both the Player and the environment around it now I’m going to be adding more mobs in a bit but I want to add something else in the meantime that is also very important in Minecraft and that is farming to get started just like with the mobs I transferred over a bunch of textures for Each crop I wanted to implement now I decided to keep things simple and just add wheat potatoes and carrots now implementing the code for these crops was pretty straightforward the only noteworthy issue is that since the Farmland is one pixel smaller than a normal block I had to adjust its Collision so that the player doesn’t float above it and this also meant that I had to adjust the crop rendering to bring it down one pixel to match up with the farmland but now we have a reliable way to gather food and if you’re wondering I made it so That zombies can now drop potatoes and carrots so that they’re actually accessible in survival now as I mentioned before we started working on the crops I want to add some more mobs in this episode but this time let’s add some passive mops instead and after doing some thinking I’ve decided on two That I want to add right now pigs and cows so that means we need to transfer some more textures The texture is now transferred it’s time to implement these mobs in code now since these mobs are passive mobs they are going to behave differently than Hostile Mobs do but thankfully when I first implemented the mob system I programmed hostile on passive mop functionality into the game so we don’t Have to worry about that what we do have to worry about however are the models for these mobs all of the models that I’ve worked with so far have been pretty much the same so I had some problems getting each body segment to work correctly with these new models and at One point I ended up breaking the rendering code for all of the models by accident now if you want to be knowledgeable enough with programming so that you could avoid some of the mistakes I have made then I suggest checking out this video sponsor brilliant.org brilliant is an online learning tool for Anyone eager to learn about math data science or computer science in a fast and easy way whether you are a professional or an absolute beginner brilliant is the ultimate learning platform for anyone at any skill level say goodbye to outdated learning methods because brilliant offers an interactive and engaging learning experience like no Other with Hands-On exercises and thought-provoking challenges you’ll develop skills that could be applied in the real world in no time at all and if you’re interested in learning about programming languages data structures algorithms and more brilliant offers a bunch of amazing computer science courses for anyone such as the thinking and code course So if you’re looking to learn some new skills why wait join the millions of Learners who have supercharged their skills with brilliant to be able to access everything that brilliant has to offer for free for a full 30 days head over to brilliant.org code noodles or click the link down in the description Below and if you’re one of the first 200 who do so you’ll get a full 20 discount off of Brilliance premium annual subscription thank you to brilliant for sponsoring this video and for supporting the channel yet again but now let’s get back to 2D Minecraft alright after doing Some more work both the pigs and cows can now naturally spawn and if I kill either of them they drop their corresponding meat as you would expect now if you have been following this series for any length of time you will know that it is a tradition that I add a Brand new biome in every episode but in this episode I thought I would Jazz things up by having a spinner decide what biome we add instead the Savannah it is to begin I added some new textures to our block texture Atlas for the acacia trees and then I started implementing the Biome itself most of this was just tweaking the generation to get it to look the way I want it to so here is what it currently looks like since these acacia trees are brand new I added Acacia saplings and planks and it’s nice knowing that we have another Arid biome to go along with the desert all right it is what the heavy heart that I now say that this episode and thus this series is coming to a close I want to thank you guys for supporting this project for such a long time I originally hope this would only take About three months but of course sometimes things don’t go the way that you expect them to now I know there is still a ton of things missing that could make this project even better but I am confident enough now to release it so if You would like to play it it will be on my GitHub link down below for download now even though this series is over I’m still going to continue to update this game every few months so this isn’t the end of this project either way I really hope you guys have enjoyed this series Because it was a real learning experience for me so with all of that said Thank you guys as always for watching and for your wonderful support and I will see you in the next video bye-bye Video Information
This video, titled ‘I Finished 2D Minecraft’, was uploaded by CodeNoodles on 2023-09-29 22:53:14. It has garnered 50651 views and 4134 likes. The duration of the video is 00:08:31 or 511 seconds.
To try everything Brilliant has to offer—free—for a full 30 days, visit https://brilliant.org/CodeNoodles. The first 200 of you will get 20% off Brilliant’s annual premium subscription.
I never thought this day would come.
This video was sponsored by Brilliant
SOCIAL MEDIA & WEBSITES ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Patreon: https://www.patreon.com/CodeNoodles Itch.io: https://codenoodles.itch.io/ GitHub: https://github.com/OfficialCodeNoodles
MUSIC ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Wait – c418 Strad – c418 Far – c418 https://c418.org/albums/minecraft-volume-alpha/ https://c418.org/albums/minecraft-volume-beta/