Hi guys welcome back to another video if you’ve seen some of my other videos you’ll know i like making games with redstone i really like making games with redstone but what goes on behind the scenes how do my projects get built from start to end today hopefully i’m going To answer those questions and take you along with me on my journey to build flappy bird with just redstone i hope you enjoy flappy bird is a mobile game by miniclip originally released in 2013. however it was removed from the app store and the google play store in 2014 Because the creator felt like it was too addictive well sorry miniclip but today we’re going to be spreading your game a little bit further the mechanics of the game are super simple your bird is constantly falling due to gravity i guess and when you tap the screen it Gets a little boost and flies up a little bit you can keep tapping the screen as much as you want and your goal is to maneuver your way through these holes in pipes which come at varying heights first let’s think about the screen i think the best way to do the screen is With the lamp display i don’t see any advantage to using pistons here as far as how big it’s going to be i’m not really sure so i’m just going to make a starter screen and we can always change the size later okay i just made one That’s 16 lamps by 16 lamps now let’s talk about the bird so the bird is constantly falling and to me when i hear constantly falling i think of like a degrading circuit and a degrading circuit would just lose value over time so for example you could have like a Comparator into another comparator like this and if you imagine that this line right here is kind of the the height of the bird if you start it like this you can see how the height naturally falls down here let me put some lamps so you can see it a little bit better You start like this and see how the bird falls down so i think that’s a good mechanic for the gravity part of the bird alright so i played with the timings a little bit and as long as we’re trying to make this game run in real time i think this is probably a Good speed yeah feels about right the one problem with this though is that right now aesthetically the bird is just a huge bar of lamps that get shorter i’d rather have it just be like the top of the bar so a single pixel if we attach a red Coater to this or a signal strength decoder we can just get that top pixel i’ll show you what i mean all right i attached a red coater on the end of it so now if we send in a signal strength here it’s only going to light up one lamp associated with that signal Strength so when i press this button it’s still going to give a signal strength of 15 and start to degrade but now it’s just a single lamp so our lamp started up there and it falls all the way down to the bottom just like it had Gravity all right so we’ve got a bird on the ground we can set it up to the ceiling and then it’ll fall down but how do we make it jump well if we think about what a jump is a jump is really just take the current height and add a Value to it so why don’t we just take this signal strength which again represents the height add some value to it and then plug it back in whenever we want to jump it seems like it would work to me the way that we’re going to add a Value to the height is with a circuit like this this is the input signal strength right here this is the output and this is where you want to put the value that you want to add what we’re doing here is what i like to call a double inversion where an inversion is Taking 15 minus your current signal strength we do it once right here because we’re taking 15 minus whatever this signal strength is and that’s the output and then we’re doing it again over here 15 minus 7 is 8. if you don’t do anything special to it in between the Two inversions then it’s just kind of a comparator it goes in one signal strength and it comes out the same signal strength because inverting it once and then inverting it again puts it back to what it was but if we go over here and put some value here that’s Going to subtract it from whatever it is in between the two inversions and that actually adds it to the number if you want a proof of this i’ll put it on the screen right now but yeah i mean this is just the way i remember it the way to Add to signal strengths is just to subtract while it’s inverting so if you want the jump height to be let’s say three then you just grab a single strength barrel with three and now whatever signal strength goes in here it’s gonna add three to it and come out Here so for this example we have eight plus three is eleven if i try something else let’s say 10 plus 3 is 13. so that seems to be working so now i just have to attach this to this and we should have jumping all right i think it might be working Let’s try to spawn a bird and jump okay maybe now no not at all okay finally seems to be working i changed some timings all right i think it’s time to put this bad boy onto the screen to do that i’m going to need a vertical red coater instead of a Flat one like i have here but i think i have a design for it yep that was right i have one in my schematics folder so this is a vertical red coater it does the exact same thing as the other one whatever signal strength you put into The back here it’s just gonna show whatever lamp that is so we’ve got 14 that’s going to show the 14th highest layout okay i took the vertical red coater i attached it to this guy and i put it behind the screen i think it should work let’s try it out nice It actually feels like flappy bird already the next step is to generate the pipes since we have pipes coming from the top and the bottom you might think it’s easiest to just generate like a random length pipe right here and then another random length pipe right here And that would look something like this but i think a better way to generate them would be to generate one giant line and then pick a random hole right because once you have this line if you just pick a random hole like say you pick here There you go those are your two pipes to physically move the pipes across the screen i think i’m just going to use a system like this it’s actually pretty simple we just have a observer chain and then a bunch of observers coming off of that chain whenever you give it an Update it gives you a nice like three wide pulse across these lamps okay i stacked it up a little bit and i simulated a little system to see what the pipes might look like yeah i mean that looks pretty good my only concern is that this might be a little Bit too fast i mean these are moving pretty fast across the screen and considering our bird only falls that fast i don’t think it’ll mix well with those pipes but i mean at the same time you can also just make the bird fall a little bit faster by making this clock a Little bit shorter so i’m not that concerned you know what no i take that back i am concerned this is just too fast this would even if the bird was at the same pace and it was falling really fast this i don’t think flappy bird is Meant to be meant to be this crazy at least not until you get to the later levels or whatever so i’m gonna have to think of a different system to move the pipes across okay i just had a thought what if we put repeaters on the back of these they’re one wide so Oh okay this that’s that’s much better check it out dude oh my god i can’t believe how easy that was to fix all right so like i said before for each set of pipes we’re just going to create one long column and then generate a random hole to me when i hear One long column and a random hole in it that kind of reminds me of the vertical red coder again because if you just invert this now it looks like one long column with a hole in it so i think if i can find a way to modify this to make The hole bigger that’ll be perfect okay i’ve been working on it a little bit i think i’ve got something promising so if we input a signal strength like that we get a hole right here and if we input a different signal strength maybe one a little bit higher We get a hole that’s higher up okay that seems pretty cool all i did here was take the output from the red coder and make it go up a slab tower by a designated amount so for example i think the output’s coming from about right Here and you can see it came out with a signal strength of seven meaning that it’s gonna go up like this and create a hole that’s only seven long everything else still has torches on it okay i hooked up the fancy observer screen to it and now we’ll actually be able to see The pipes right now it’s set at this current height and if we press this button it releases it and that’s what the pipes look like that’s actually pretty good we can go over here and we can change the height we can do something like this instead press the button And we get a different height awesome after playing with it for a while i noticed that sometimes the holes are like too high and they chop off the top pipe so i modified the input system a little bit and now anything along this line is perfectly safe so if you go Right here and press the button that is the highest possible hole or if you go right here and press the button again that’s going to be the lowest possible hole and that means that this redstone line is essentially our range so now we just need a way to randomly assign a Random piece of dust to full power the easiest way to do that is with a randomizer circuit so this is a 50 50 randomizer when i press this button it’s either gonna give me an output or it’s not it’s a 50 50 chance the way this Works is we have a dropper pointing up into a hopper and the dropper has two items in it one non-stackable and one stackable if it chooses the non-stackable which is the axe it’s gonna output two signal strength and reach the lamp but if it outputs the stackable which is the dust it’s only Gonna output a one signal strength which does not reach the lamp so let’s activate three of these at once and that way it’s going to generate a random three bit binary number which means it’s gonna be a random number in the range zero to seven or zero zero zero to one One one zero one two three four five six seven can you see where i’m going with this all we have to do is use a decoder to decode the three bit binary number into its corresponding torch zero through seven and now with three randomizers and a decoder we can choose A random torch every time we press this button okay i made a little circuit to automate it and check it out random pipes let’s put this thing on the clock oh yeah that is amazing all right we’ve got pipes we’ve got a bird let’s try to combine them okay slight problem and i Probably should have seen this one coming but the observers don’t mix very well with the red coder like i can’t bring these observers across here which means that the pipes just kind of disappear as soon as they reach the the birds column i’m sure there’s a way Around this though i might have to redesign something but i’ll let you know what i figure out okay i’m convinced there’s no way to pass this bird straight through the observers so what i did is i made the observers go across the entire screen and then we can just Put the bird on the end here that way these observers can get the last pixel and now the bird’s actually gonna look like it’s going through the pipes and there we go the bird’s actually going through the pipes i’d say this is our first prototype it does kind of suck That the bird has to be on the very edge of the screen but it keeps the hardware nice and simple so i’m alright with it the next thing i want to do is i want to change this input system i don’t want the person to have to press a button and Then look back at the screen that’s kind of awkward i would rather use something like a tripwire that way the player can actually jump okay after messing with tripwires for way too long i finally found a nice system all you do to use it is stand on the trapdoors and whenever You jump up your head hits the drip wire and that makes you jump and it even works if you hold down the space bar which is really nice okay we’re really getting there i can turn on the pipes with this lever and as soon as you start generating now I can just stand here and jump with the bird the last thing we need is some collision detection because right now if the bird hits the pipe absolutely nothing happens so we need to check if the bird which comes along here and the pipe which comes along here hit each Other which means they both occupy the same block at the same time the way to do that is to make a bunch of and gates one for every single row that compares the pipe and the bird and it’ll go off if they’re both there at the same time Because that’s what an and gate does okay i made a bunch of and gates and i ordered them all together with this tower here so if a collision happens at any row it’s going to hit one of these dust and go up the tower and let us know On this main line and this line is our collision detection line by the way i moved the tripwire circuit out a little bit just so that it’s easier to use easier to see the board so right now the lamp is always off even if we jump because there’s no pipes so there’s no Way we could have a collision but i’ll purposely die here and we can see as soon as we hit the pipe lamp goes off hit the pipe again lamp goes off seems like it’s working i think it’s time to set up the control logic control logic is what manages the game right now The game just runs non-stop it still needs a process to kind of help it organize its tasks okay i built up a little schematic i think i want to do something like this the game is going to have two different states a default state and a playing state it can only be In one of these states at a time when you first download the world it’s going to be in the default state so in the default state there’s going to be no pipes it’s just kind of sitting there waiting to be played then when the user presses the start button it puts the Game into a playing state when the game gets put into the playing state it has to do these two things it has to start generating the pipes and it has to add one score every time we get through a pipe yes sorry i forgot to mention i Want to do a scoring system as well okay so all is well we’re playing the game but then if a collision is detected aka the bird hits a pipe this goes off and puts the game back into the default state now that we’re in the default state we need to stop generating the Pipes and we need to clear the score and that’s about it that’s all the control logic we need i’ll be back when this is put into the game okay finished most of the control logic i put a start button right here and it goes into the latch that toggles between the two different States it’s the exact same latch that i had in the schematic over here when we press start game it toggles into the playing state and the playing state is directly hooked up to the generating pipes so now as we’re in the playing state the pipes are on the screen then i Took the collision detection line and ran it all the way back to put it back into the default state and finally i put up a display counter whenever i need fancy displays like this i just go to my boy mizuma games he has incredible designs this is the one we’re using Right here so every time you update this observer it counts up by one and what’s really cool about these is when you stack them next to each other like i have whenever one goes from nine to zero it increments the one to its left by one making this a fully working counter all The way up to 9999 so right here when a pipe gets all the way to the end of the screen i put in this wire which increments our score by one and that is about it i’d say that we have a working flappy bird game now that everything is Working i’m gonna do a few final things before i’m finished i’m gonna redo the layout so that more of the stuff goes behind the screen instead of off to the side like this i’m probably going to give it a little bit more decoration and i’m going to test it a lot it’s always Good to test your game when you finish other than that i’ll see you in the showcase [Applause] Make sure to subscribe if you enjoyed this video and want more of them thank you for watching i hope you learned something i hope you enjoyed peace out guys You Video Information
This video, titled ‘I Made Flappy Bird with just Redstone!’, was uploaded by mattbatwings on 2022-05-13 19:04:27. It has garnered 232272 views and 11116 likes. The duration of the video is 00:14:04 or 844 seconds.
Today I take you along with me as I make Flappy Bird with just redstone. I love sharing the engineering process with you guys, and hope you get something out of it!
Patreon: https://www.patreon.com/mattbatwings Discord: https://discord.gg/V5KFaF63mV My socials: https://linktr.ee/mattbatwings My texture pack: https://github.com/Xyverle/MattPack World Download: (JAVA 1.18.2) https://www.planetminecraft.com/project/flappy-bird-5578073/
Scoreboard made by @MaizumaGames Vertical Redcoder made by @Sloimay
————————-
Want to get more involved in the logical redstone community? Learn Logical Redstone! https://youtube.com/playlist?list=PL5LiOvrbVo8keeEWRZVaHfprU4zQTCsV4 Open Redstone Engineers (ORE): https://openredstone.org/
0:00 Introduction 0:44 The Bird 4:27 The Pipes 9:36 User Input 10:10 Collision Detection 10:57 Control Logic 12:59 Showcase