I Made a DS Game in 2020

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
last month I made a game using libgdx for the libgdx Game Jam yeah it's pretty much just a flappy bird clone so to make things interesting instead of making a video on how I made this game I thought I could try to make an actual flappy bird clone for the Nintendo DS using C++ and live and yes so I started off by installing def dip Pro and tried compiling the live nes examples just to make sure everything was set up correctly then I created an empty C++ grip and copied the make file from one of the examples usually before I add our to any of my games I like to prototype the gameplay first using basic shapes so I looked through lavinius as documentation to see if there was any way to draw primitives to the screen but I couldn't find anything so I resorted to Google and came across a forum post where someone linked to DS library called Lib GL 2d the link didn't work probably because I'm trying to make a game for a 15 year old console but luckily someone archived who live on github and I was able to get it from their live GL 2d takes advantage of the DSS 3d core to improve 2d rendering it allows you to do a lot of cool things with sprites that aren't normally possible most importantly it has a function called GL box field that lets you draw rectangles to the screen so I could use it to easily make a prototype of flappy bird [Music] the actual game logic of flappy bird is pretty simple the first thing I did was draw this nice-looking bird to the screen in a while loop I said it's exposition to about one-third of the screen width and it's y position to a float I call bird pause Y then I create another float called bird speed and odd bird speaks the birds position every frame and just like in real life I had a fixed amount to bird speed every frame which acts as the acceleration of gravity so now the bird falls in a pretty realistic way then when any button is pressed I set the velocity of the bird to a negative fixham earth this isn't how flapping works in real life but this is how it works in flappy bird and is probably why the game is so hard the other major component of flappy bird is obviously the pipes that move across the screen instead of spawning and D spawning pipes I just use four sets of sprites that move across the screen and once they move off screen they loop back to the beginning so I start off by creating a class called pipe for now I only put two variables inside of this class pause X and pause Y then I create an array of four pipes called ground pipes I use a for loop to set the x position of each pipes of I which is a pipes position in the array so 0 1 2 or 3 multiplied by a constant that determines how spread out the pipes will be then I add 256 the width of the dss screen to that so that the pipes will move in from off the screen when the game starts and then I set the Y position of each pipe to a random integer between a maximum and a minimum height but flappy bird wouldn't be that hard if there were only pipes coming from the ground so I created another array from the pipe class called ceiling pipes in the same for loop I set the initial x position of each ceiling pipe to the exposition of the corresponding brown pipe in the Y position to the ground pipe Y position subtracted by a number that represents the gap between the two pipes since all the pipes are spawned with a correct distance between them moving them across the screen is really straightforward inside the main while loop I use another for loop that first draws each pipe to the screen then subtracts a fixed speed from the x position of each ground and ceiling pipe every frame and once at ground pipes exposition plus its width goes below zero the exposition of the ground pipe and it's corresponding ceiling pipe are set back to 256 and now we more or less have an ugly-looking flappy bird clone running on the DS I waited until after I added sprites before implementing things like scoring collisions programming basic game logic is fun and all but when writing code for the DS it'll probably also be the least challenging part so yeah displaying sprites on the DS requires a pretty good understanding of how the DS manages memory graphics displayed on the DS have to be stored in video RAM which is divided into multiple vram banks at each yeah there's no need to actually worry about any of this because we can just use a wrapper to handle all this for us I could keep using lib GL 2d but for some reason the examples I compiled that you sprites weren't displaying the sprites at all it also has other limitations like not being able to use the bottom screen so I figured I'd be better off using another library anyway there are a few different sprite drawing libraries to choose from but the one I like most is night Fox lib it doesn't really have any unnecessary extra features like some other libs I came across it just lets you draw and delete sprites and backgrounds it also has functions for playing sound effects which will definitely come in handy so I spent some time in reorganizing the sprites and converting them into a format that could be used by the GS and after some failures I reworked my prototype to use sprites instead of basic shapes with night Fox lab you just have to load a sprite in its color palette into a Ram slot then load it into a VM slider and then you can draw it just as easily as you can draw shapes with live GL 2d and with all that tedious stuff out of the way I could finally go back to working on the actual game night Fox live has a sprite rotation function so I set the bird sprites rotation to the bird speed float to make the bird point in the direction of its velocity this is also when I tweak some values like gravity the bird flap magnitude and the pipe gap to make the game feel more like flappy bird to do this I compared screenshots of my game to screenshots of flappy bird and also reference to helpful graphs made by Frank no scaizi of the birds Y position and velocity over time I'll put the link to his article and flappy bird physics in the description if you want to check it out for collision I just use a simple if statement with four conditionals to check if the birds inside of any pipe and I gave the bird it's flapping animation by just updating its try every few frames and for the score I just add one to an integer each time the center of a pipe equals the exposition of the bird after that I worked on some of the finer details of the game I implemented things like the score results screen that gives you certain metals for certain scores a title screen and a get ready screen I also randomly choose a bird caller in background each time you reset the game I also added all the sound effects from the original game which was pretty easy to do with night fox League and with that I had a pretty decent flappy bird clone running on the DS with just about every feature the actual mobile game has if you want to try it out you can get the game on my itch style page if you have any additional questions about how the game was made that I didn't cover in this video feel free to leave a comment or ask me on discord or Twitter if you want to see more GS programming related videos maybe even tutorials let me know in the comments because I think that would be a lot of fun and as always if you have any feedback or suggestions for future videos feel free to leave a comment thanks so much for watching I hope you enjoy playing this part of a six year old game to a 15 year old handheld [Music]
Info
Channel: PolyMars
Views: 387,727
Rating: undefined out of 5
Keywords: flappy bird, nintendo ds, homebrew, nds, ds, 3ds, dsi, hacking, games, fangames, indie game, 2020, 2019, polymars, gamedev, game, making, behind the scenes, devlog, tutorial, programming, development
Id: h7pq9hUMnog
Channel Id: undefined
Length: 7min 44sec (464 seconds)
Published: Thu Feb 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.