Hello welcome to the eighth tutorial in the class to the x Flappy Bird c++ series. And in this part we'll be looking at moving the pipes we'll be continuing with the source code from the previous part of this series so if you don't have it Don't worry they'll be linked in the description to the source code. Okay we have pipes born in but they do not scroll plus a random is born on the screen to find phonetically was checking make sure the spawning layer okay aka the gap but but this needs to be updated to spawn out on the screen and obviously scroll as well. Oh First we will create a hash define for the pipe movement speed and then go to our definitions header and do hash define. Type on the noon on the small speed and I'm not put on again this will be factored in with the screens sois so you can adjust this accordingly if you want faster or slower and now we will update the post position so it's both so the screen aka to the right so it's going to go to a point dot cpp and the only one we need to update is this one, the bottom pipe position is set according to our listing exactly, that's the only one that needs to be updated is set according to the top one right here.
So we're gonna do it we'll get rid of everything is that we do so far we'll just talk about it again. And what we want to do is feasible sois dot with plus top point good content, so please don't with closed origin dot exe. And if we were to run this now, what would happen is your guest plugs born in but we also screen for technically you wouldn't actually see them. The last step is to create the action that will move the pipes but we will factor in the screen size so they do the same for you guys. Read an iPad or another it's an iPad for example. So we're going to do after we just added these points was going to auto talk pipe action equals move.
Boy colon colon create new pipe moving speed times by visible with and for the position or the amount we want it to move by we're going to put minus visible sois dot with tumble 1.5. And this is essentially fully goes off the screen and we don't want you to move in the y axis and we'll know that is copy and paste this. Within this rename top pipe action to bottom pipe action Notice one is action so top pipe, run action top pipe action once we're done here only to in your own time, experiment with the hash define see what they do so you can get a better understanding and the use of let's also try to make it suit your needs because you may want a faster you may want a slower you may want the gap bigger or smaller, and so forth. And that's a great thing about doing hacks to find it less easily change it and those can sort of go hand in hand with settings.
Bottom pipe run action analysis, bottom point action. Now the last thing to do is to simply run it so you can see the pipe scrolling Flappy Bird is possibly could have gone to the App Store mean the original one made by Darwin. That's possibly Sometime during the summer with some extra multiplayer or split screen functionality, also read because he took it off the iOS store, that he can't get his name back anymore. Apparently he can. But on iOS, somebody hasn't got the name because he gets freed up when you take the application off, but he can't get it back. So that'd be interesting.
But if he brings it back, he'll get back in the top job pretty quickly. There. Let's click play. You're on the screen, sees a spawn point. And now we have pipes boring and scrolling my thing, you might look at it and think they slow laggy. And it's simply because the frame rate isn't high.
And that's nothing to do with the application or close to dx as to simulate off trade. And not just this version, but default version that will be created on my devices and it works great. It's just because of the simulator first and something you'll have to bear in mind. But again, you're not selling it so people could sell it on I mean using on the simulator That's it for this tutorial. In the next part of the series, we're gonna be looking at the Flappy Bird class creation. If you have any questions feel free to message us at support at solar systems.
Co UK, the email will be in the description you can comment on this video or just directly message us via YouTube. All the required links or source code will also be in the description. And as usual, thanks for watching. I hope you have a great day.