Unity 3D : Programming Flappy Bird Gameplay (In 4 Minutes!!)

  Рет қаралды 10,634

Royal Skies

Royal Skies

Күн бұрын

Пікірлер
@TheRoyalSkies
@TheRoyalSkies 3 жыл бұрын
Today actually Marks us reaching 100,000 subs - Thank you so much everyone for watching, subbing, commenting, and supporting the show! It's been my pleasure to be able to share my experience and knowledge with you guys these past 2 years. I truly am humbled at the sheer number of people here. You guys have really changed my life, so I'll do my best to continue to return the favor and share the rest of my skills. At this point, I've almost taught you everything I know now - There's a few more things I'd like to share, but I hope you guys understand how lucky I feel to be part of such an incredible community here:) If you enjoyed this video, please leave a like to thank the Patreons and KZbin members who voted for the creation of this "Full Project Demo". We decided that demonstrating all the code together in action would be the best way to close the Unity Intro course :) Please continue to stay safe everyone - And, as always, hope you have a Fantastic Day, and I'll see you around -! All Code Can be found below : public class BirdDemoBounce : MonoBehaviour { public float ySpeed; public float yTarget; public GameObject soundBounce; void Update() { transform.Translate(0,ySpeed,0); ySpeed = Mathf.Lerp(ySpeed, yTarget,.025f); if (Input.GetKeyDown("space")) { Instantiate(soundBounce, transform.position,transform.rotation); ySpeed = .05f; } } } ----------------------------------------------------------- public class BirdDemoCollision : MonoBehaviour { public GameObject deathExplosion; public GameObject checkpointSound; public int score; public Text board; void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "environment") { GameObject deathObj = Instantiate(deathExplosion, transform.position, transform.rotation) as GameObject; Destroy(gameObject); } else if (other.gameObject.tag == "checkpoint") { score += 1; board.text = "SCORE: " + score.ToString(); Instantiate(checkpointSound, transform.position, transform.rotation); } } } ----------------------------------------------------------- public class BirdDemoEnvironment : MonoBehaviour { public float sendTimer = 0; public float frequency = 9.93f; public GameObject floor; void Update() { sendTimer -= Time.deltaTime; if (sendTimer
@GettingItUp
@GettingItUp 3 жыл бұрын
It's really cool to see you finely make it to 100k subs! woot woot! btw do you have a discord? and fyi i did have a wonderful day, you released a new vid. ;-)
@masonwheeler6536
@masonwheeler6536 3 жыл бұрын
Hey! Congrats on 100k, Royal. You've definitely earned it!
@TheGamersShade
@TheGamersShade 3 жыл бұрын
Congrats man, love your stuff.
@ianandrew1997
@ianandrew1997 3 жыл бұрын
Congratulations man, you deserve all the subs and more. Thank you for sharing your knowledge and experience!
@hoapham7389
@hoapham7389 3 жыл бұрын
Most underrated tutorial channels out there!
@nevill2947
@nevill2947 3 жыл бұрын
this is absolutely nuts. Mad respect to get this into 4 minutes, and such a clear explanation too.
@notme0126
@notme0126 3 жыл бұрын
I wrote this as a reply down in another comment but I guess it shouldn't hurt to have it separately here too; In order to avoid using too much memory(since you will end up spawning a lot of objects at one point) and also to not have to move too much(or at all) in the game space you can do the following: -have the player move only up and down, and have a fixed pool of objects(prefabs) that simply go active to disabled(and vice versa) and get moved wherever they are needed. You are working only in the space which the camera view covers. That way you get to save on game space(and memory ofc) and object destruction scripts. Only problem with that method that I can see right off the bat is that you will need to get the positions done right and tight, also the camera needs to not see the swap. Hope this sparks interest in the readers.
@IchigoFurryModder
@IchigoFurryModder 3 жыл бұрын
That way there's also much fewer malloc calls which is always a plus, unless you're stress testing the CPU, then by all means malloc over and over :)
@acez28
@acez28 3 жыл бұрын
Thanks you for holding our hands through this journey❤
@masonwheeler6536
@masonwheeler6536 3 жыл бұрын
This is pretty cool, and at this scale, it will probably work well enough. A few problems to be aware of, though. First, if you keep going far enough in any direction, (several thousand units,) the rendering will begin to get glitchy. (The reason why is kind of technical, but the basic explanation is that a floating-point variable only has so much room available to store data, and the more you have to use to hold a large number, the less is left over to store information about the high-precision details after the dot. So the engine's ability to keep track of precise vertex positions begins to degrade with distance, and vertex positions affect *everything* in 3D rendering, so the whole thing starts looking glitchy.) You generally deal with this with a "floating origin" script, which is basically a script that says "if our player GameObject's position gets too far away from the Origin (the 0,0,0 point), move it back to the Origin, and at the same time move everything else in the world by the same amount so the player doesn't notice the difference." Second, if you keep instantiating new objects endlessly, you're going to end up running out of memory, and before you reach that point the game will begin to lag noticeably as the CPU spends more and more time dealing with all those GameObjects. Since the game always proceeds endlessly in one direction, you should probably have something destroying objects behind you once they get off camera. These are real issues you'll need to be aware of if you want to actually release a game. But as a pure proof-of-concept demo, this is pretty cool!
@notme0126
@notme0126 3 жыл бұрын
Good point. A simpler work around that I would recommend is to have the player move only up and down, and have a fixed pool of objects(prefabs) that simply go active to disabled(and vice versa) and get moved wherever they are needed. That way you get to save on space and object destruction scripts. Only problem with that method that I can see right off the bat is that you will need to get the positions done right and tight, also the camera needs to not see the swap. Hope this sparks interest in the readers.
@white_meat_chicken
@white_meat_chicken 3 жыл бұрын
@@notme0126 This is definitely the way to do this - I've never heard of anyone, ever, moving every object in a scene back to the origin for these types of games. Keep the player stationary (or within defined bounds), have a spawner on the right out of the view of the camera and a despawner to the left. Once an object gets it a certain distance from it's spawn point, spawn another object that handles its own movement and cleanup.
@masonwheeler6536
@masonwheeler6536 3 жыл бұрын
@@white_meat_chicken maybe not for these types of games, but for open-world type things, floating origin is very standard. That's more my background, so it was the first solution that came to mind. 😋
@white_meat_chicken
@white_meat_chicken 3 жыл бұрын
@@masonwheeler6536 That's totally fair - open world stuff is outside of my wheel house for sure. I'm old, so most of my game development is small 2D things, which is why I thought the conveyer belt option was obvious. Apologies if I offended.
@francescagreetham1804
@francescagreetham1804 2 жыл бұрын
I am now so hooked on your channel
@kriegs8315
@kriegs8315 3 жыл бұрын
Yes
@gonderage
@gonderage 3 жыл бұрын
My mans just obliterated the top industry secret in 4 minutes
@TheEDOTONY
@TheEDOTONY 3 жыл бұрын
I did it in ue4 with almost no prior knowledge of blueprints, it took me 4/5 days but i’ve also implemented the main menu and a “record” variable that saves even when the game is restarted
@jasonwilliams8730
@jasonwilliams8730 3 жыл бұрын
I love this tutorial!
@franciscoichazo750
@franciscoichazo750 3 жыл бұрын
So... When I try to make the "floor generator" it works until the original floor destroys itself and an error pops up: MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. If anyone knows how to solve this, I'd appreciate it
@SnareTomCrash
@SnareTomCrash 2 жыл бұрын
Thank you for the concise and understandable tutorial! For me it would have been really useful to be able to download the project from you, since I have no idea where to get the emissive material and grid object from. I would have been happy to pay for it too, so maybe project files could become one of your Patreon perks. :)
@akashkawle4286
@akashkawle4286 3 жыл бұрын
Wonderful and esyest tutorial ever ❤️👍
@jafeth-jpro507s
@jafeth-jpro507s 2 жыл бұрын
I have an error in the control parts I write the code in the correct way but in unity I get a Vector3 error
@prinzpablo527
@prinzpablo527 3 жыл бұрын
I just realized something. You steam game battle UI thing looks familiar like Peach Beach. XP
@antondingir884
@antondingir884 3 жыл бұрын
pls use bolt visual scripting for tutorials
@Hhwhjsjuw
@Hhwhjsjuw 3 жыл бұрын
How to see your legs in unity 3d , game is fps
@theofficialamt6626
@theofficialamt6626 3 жыл бұрын
Can you make a tutorial of making exact clone of Flappy bird using visual scripting BOLT. I'd love to learn to make it for Android and work with any screen resolution.
@HarrisonK08
@HarrisonK08 3 жыл бұрын
Hey man can you please make a tutorial on how to have multiple animations with different lengths I’ve found nothing useful (for blender)
@TheRoyalSkies
@TheRoyalSkies 3 жыл бұрын
That series is scheduled for June, we'll be creating a character with animations for the community first. Then I'll show how to program it flexibly and fluidly -
@RisuNiku
@RisuNiku 3 жыл бұрын
currently getting mad at youtube because I didn't get the notification
@TheRoyalSkies
@TheRoyalSkies 3 жыл бұрын
Man that sucks, do you have the bell active?? I've heard that might be why :(
@wearwolf4202
@wearwolf4202 3 жыл бұрын
Anything GUI related is done in .UI
@ali32bit42
@ali32bit42 3 жыл бұрын
i wish stuff like this existed for other skills too. my ADHD brain cant watch another 8 hour video for the same basic concepts .
@wearwolf4202
@wearwolf4202 3 жыл бұрын
You obviously never been to skillshare
@ali32bit42
@ali32bit42 3 жыл бұрын
@@wearwolf4202 i am obviously too poor to try
@oscarishino5883
@oscarishino5883 3 жыл бұрын
poggers
@IchigoFurryModder
@IchigoFurryModder 3 жыл бұрын
Hi, I did this, and I added some stuff to it and did some improvements, I put it up on GitHub for everyone like I said I would :) -alsoiforgottocongratulateyouforthereallybignumberearliersorry- My version uses kind of an object pool for the obstacles, it's not really a pool but it behaves the same way, each object moves to the left, and when they're far away from the camera they teleport to the opposite side, no instantiating, so no pointless malloc calls. The floor and ceiling are static, I'm just using a procedural grid texture for those based on world coordinates, and shifting them by some amount controlled through .NET to make the movement, again, no malloc calls that we don't need. Also now the player rotates to face the speed direction, and they have sunglasses because why not. Also also, the scene now has some j u i c y post processing applied to it. Also also *a̷͕̖̦͛̋̂ľ̸̫̝̘s̴̢̪̰̈̽̌͗̎̅o̷̢̯̩͎͉͂͆̿́ͅ* there's score, and high score. I think that's about it, might have forgotten something but meh, it's under the MIT license, and I put it out there for people to study it and also improve it in some way if they can, I'll be checking the repo on a daily basis for a while, and if you have any suggestion to make it better, and you know how to do it, then do it because that's kinda the point of it, unless you can't do it yourself, then tell me about it instead, but preferably give it a try yourself. Here's the link to the repo: github.com/ChloeZamorano/RoyalBirb
@TheRoyalSkies
@TheRoyalSkies 3 жыл бұрын
I REALLY like how the floor just recycles itself instead of constantly sends new floor! Awesome adjustment, and thank you for putting this up :)
@IchigoFurryModder
@IchigoFurryModder 3 жыл бұрын
@@TheRoyalSkies Thank you for the compliment, and for these actually pretty great tutorials! If you ever think I could help with anything or you wanna ask me something or whatever, you can add me on Discord dvwf#1365, I'm here to help and contribute because I think you're awesome :)
@Doktor_Resurrection
@Doktor_Resurrection 3 жыл бұрын
@@IchigoFurryModder dvwf#1365?
@Doktor_Resurrection
@Doktor_Resurrection 3 жыл бұрын
@@IchigoFurryModder sorry if I come across as accusatory, but is the casing correct?
@IchigoFurryModder
@IchigoFurryModder 3 жыл бұрын
@@Doktor_Resurrection Yeah, accidentally wrote a 6 instead of a 7
@thedude4039
@thedude4039 3 жыл бұрын
*Emphasis on gamePLAY*
Unity 3D : Menus Part 1 (Panel Backgrounds)
1:03
Royal Skies
Рет қаралды 12 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
I Made a Very Stupid First Person Shooter (And You Can Play It)
8:40
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 548 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
So I made every block act differently..
11:41
Element X
Рет қаралды 175 М.
Unity 3D Controlling Position & Parenting (INTRODUCTION)
4:22
Royal Skies
Рет қаралды 8 М.
Unity 3D : Menus Part 2 (Text-Mesh-PRO in 5 Minutes!!)
5:19
Royal Skies
Рет қаралды 6 М.
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2,1 МЛН
Controlling Sound In Unity - (In 5 Minutes!!)
5:25
Royal Skies
Рет қаралды 10 М.
What does a Game Engine actually do?
16:45
Ellie Rasmussen
Рет қаралды 173 М.