3 – NAVIGATING YOUR PROJECT MULTIPLE PROJECTS You
will notice that in Eclipse, you have two (or more) projects. You have one core project that will contain
all of your Java files. And then you
have a desktop project which will use your core’s files to create a desktop
application. In
fact, had you chosen to include other platforms (ios,
android, html), they would each have their own project that would also depend
on the core project. SCREEN CAPTURE Here
is a visual of how the projects look like in the Eclipse project explorer: CORE
PROJECT Initially, the core project contains
only one class. It extends the ApplicationAdapter class which is designed to allow
LibGDX to run your application on different platforms. We will learn more about this later. However, for now, just know that all your
new classes needed to create your game also need to be in the core project. DESKTOP
PROJECT The desktop project will not be used
much. You will only use it when you
want to run your game. It is specially
configured using Gradle so that it depens on the core project. The DesktopLauncher.java class is the file
that contains the main function for your game. TEST
IT OUT Your current project contains a simple
application that displays the company’s logo. Try
it out to see by running the main function in DesktopLauncher.java. |
|
|