[MUSIC]
Good day, good day.
It's Tim Buchalka here again, the Aussie Android dev guy.
And in today's video we're going to go ahead and configure and
set up libGDX which is a game framework using Android Studio for Windows machine.
If you're running a Mac or you're running a Linux machine,
refer to the links to my left, the little icons, click on those.
And you can take it to a video where I'll show you where to do that for
your platform.
Now lip genie x, I mentioned it's a game framework.
It's a free and open source one and it actually supports so
many different aspects of game development.
It's really, really popular.
Lot's of games have been developed with it and again, just to confirm this.
We're gonna go through and configure it and install it.
Set it up using Android Studio for a Windows machine.
So, let's get into it!
So first things first, let's do a search for libgdx in Google,
now that will take you to libgdx.badlogicgames.com.
We'll just go in there, click on that to open it.
We'll go into the download Then click on download setup app.
We're gonna save it.
It's only a small file, so it's gonna download quickly.
We're gonna go open, or go to that folder.
We're now going to double click it.
You can see by double clicking it it's now opened this libGDX project generator.
Now what this does,
it will actually create a structure that we can then import into Android studios.
So this is a once only setup Once you set it up, front that point onward,
you don't use this project generator anymore.
You go into Android studio.
What it needs is the two things.
It needs the destination.
It needs to know the Android STK and obviously the name and
packaging game class.
Let's start with the Android STK.
So, now what we need to do now is open Android Studio.
We're going to start and open Android Studio.
And we're just go in and have a look at the Android SDK location again and
we're just gonna past that in.
Can also use that browse button if we wanted to,
that's probably quicker to just pasting the location.
So gonna find that, quickly go to Configure, Project Defaults,
Project Structure.
And you can see that's the location there of our SDK.
So I'm gonna take a copy of that.
I'm going to cancel out of that.
We go back to lib GDX project generator and I'm gonna paste that in Android SDK.
Next we need to know where the destination, where we want to create this.
Now this should be the directory where you're creating your project
because what we're doing is once we open it in android studio it doesn't copy it
to another location.
It opens it in that location so this should be the location.
So obviously the dan lines is not a good option probably for our project,
so I'm going to go back to android studio.
And you can see by default, the default folder was the home folder,
Android studio projects, and we can just confirm that, opening up Explorer.
Go to [INAUDIBLE].
And there's Android studio projects.
So if we just put in Android studio projects, and
we're gonna create a sub folder, and we'll just call it test.
So, what I would do for that one, destination, We'll go back
to Michalka Android Studio projects and click on Open there, I'm also
gonna put a sub-folder, I'm just gonna call it Test, that's gonna be the name.
And next we need to come up with a game name, let's start with something simple,
we're just gonna call it My First Game.
Packages, we're not gonna talk about that too much in this video
we need to come up with a unique package.
I"m going to come up and call mine comdotchimberchowder dot myfirstgame.
Likewise for game class.
This is the class that is executed, the main game class.
I"m just going to leave it under the default mygdxgame.
The libGDX version won't change depending on when you downloaded the java file.
With the sub projects we're only dealing with Android here so
I'm going to click off this top iOS and HTML so we've now only got Android.
Now these are optional extensions that provide a lot of functionality so
you might want to consider using those.
Some of them are really cool you can hover over
them to see what they do if you aren't sure.
So one is a physics library, is a graphics, sorry font library.
Tools gives you things like a texture packer and creation of bitmap fonts.
Controllers is for gamepads and joysticks.
Box 2D is a physics engine.
And Box 2D lights goes with those.
It gives you lights and shadows that sort of work with Box 2D.
Ashley is an entity framework and AI is artificial intelligence as well.
So these are all extensions of are part of the libGDX.
And the option you can go into third-party extensions,
and there's a level editor there.
You could grab that as well, if you wanted to.
So select which ones you want.
You don't necessarily have to do them, but probably a good idea at this
project generation time if you know you're gonna use those to actually add those.
But for the purposes of this test I won't do any of that now.
So once I've selected everything there, I'm gonna click on Generate.
It comes up with a warning, or it may come up with
a warning cause on this machine I've only just updated the Android tools.
It's saying this is the more recent version.
Do you want to use this version?
I'm gonna say yes, but if there was a problem, you could always go back and
download the older version of the tools that they need and try it again.
But in this case,
I'm gonna click on yes, cause most of it's gonna be okay Likewise for the API.
I do know that it works under Android Lollipop.
But if you wanted to go back to an older API you could do that as well.
But I'm gonna leave it on API 21 as well and click on yes.
And, of course,
it knew that by looking in the Android SDK folder as to what we downloaded and used.
So down on the bottom of the screen now,
what it's doing is it's generating this project.
So it has to actually download some more files.
That are necessary for this project to actually work.
So I'm gonna go ahead and let that finish.
And once it's finished we'll come back and finish this off.
Okay can see there that builds have been successful.
Took about one and a half minutes on my machine.
Speed will be dependent on the speed of your computer and
the speed of your Internet.
So we're not finished with the project generator so we'll close that down.
And we'll shoot back to Android Studio.
Next, we'll just go back to the main menu, and we can select on, select, rather,
Import non Android Studio project.
Click on that.
We need to navigate to the folder that contains the project we've just had
created for us.
And if you recall, that was in Users in my case Android studio projects.
And there's a folder in there called tests, so
I'm gonna select that test folder, click OK.
And Android studio will come up and download that, or sorry open that for us.
Now we get this message about the [INAUDIBLE] plugin, click on OK, and
it will be upgraded for you automatically.
For the first time that Android studio goes ahead and
imports this project into Android studio.
It will take a little bit of time so keep that in mind.
And also just to be clear not only is it importing into Android Studio,
it's importing it into the same folder.
So it's not creating a new folder structure somewhere else.
It's sort of just importing that code into Android Studio.
So once we're done and once it's finished we're going to have to do all our editing.
For the game within Android Studio we won't need to go back to
that project generator.
That was like a once off and something you don't need to worry about again.
I'm just gonna close that down.
If you do get the message language level changes will take effect unload.
Yes I wanna do that.
I'll reload that.
It's a standard that comes up when you a project.
And we'll close that and also we'll so we can see what's going on.
And access.
And at the bottom you can see we're still chugging away now so
it's actually updating various repositories and grabbing the information.
So again as I said it does take awhile the first time,
but once the projects in Android studio, it's a lot faster.
I'm just gonna click on I don't agree to this little dialog that comes up.
We don't want to send user statistics to Android or to Google.
That's got nothing to do with this project by the way.
That just coincides with the fact that I previously created a video for
installing Android Studio.
Ok we complete.
Now it did leave that for awhile, it does take some time that first time depending
on the speed of your internet connection and just the processing power of your
computer to install or I'm sorry to import the project.
But it's now finished, you can see there's no more processing.
down the bottom right hand corner.
So we're good to go at this point.
Just to have you look at the structure,
you can see the manifest file is there now.
Java is being created automatically.
Launcher code has been put in there.
This has been a code that has been created essentially by
the GDX project crowd creator tool, the project generator.
you've got all the standard things you've normally got in a project as well.
Looking core and imaginex, remember that was the class that we chose.
This is the code that is going to be executed the first time or
when this project is created.
And in this case it's just gonna literally put an image on the screen.
So that's it in a nutshell.
And we're done, dusted, complete, and fully set up.
So GDX is now ready to go on your machine.
Please now subscribe to my channel,
click on the subscribe button to the left hand side and you'll be kept up to date.
With new videos as I release them.
If you've got a moment can I also ask you to please check out my android development
course.
Over 25 hours in video training showing you how to become a better
Android developer.
Feel free to also peruse some of the videos there to my left hand side and
it really gets you a feel so to speak of more Android App goodness.
Last but by no means least, please comment on this video,
let me know what you thought about it, but
also please give me some feedback on what you'd like me to cover in a future video.
And I will aim to do just that,
to cover as many of the layers requests as I can in future videos.
This is Tim Buchalka, the Aussie Android dev guy signing off.
And I'll see you in another video, cheers for now.