Game Development Reference
In-Depth Information
Next, click on
Generate
to generate all the projects. It will take some time to generate
the projects. Now that all the projects are generated, you can now import these
projects into your workspace.
Refer to the
Creating a new application
section in
Chapter 1
,
Introduction
to LibGDX and Project Setup
, for more details.
Next, go to the
Project Explorer
window in Eclipse and open the
strings.xml
file
under
CanyonBunny-android/res/values/strings.xml
. There is a
name
variable
that is used for the application name that users will see on their smartphones. The
Project Explorer
window can be opened by navigating to
Window
|
Show View
|
Project Explorer
.
Currently, the line of code should look like this:
<string name="app_name">My LibGDX Game</string>
Change the name to something more appropriate such as
Canyon Bunny
:
<string name="app_name">Canyon Bunny</string>
Save and close the
strings.xml
file. Also, in the
Project Explorer
window, remove
the following two files and a directory that comes with the generated projects:
• Remove the
CanyonBunnyMain.java
file from the
com.packtpub.libgdx.
canyonbunny
package of the
CanyonBunny-core
/
CanyonBunny
project
• Remove all the images and folders inside the
assets
folder of the
CanyonBunny-android
project
Then, open the starter class for the
CanyonBunny-desktop
project and change the
resolution parameters for
width
and
height
to
800
x
480
pixels respectively,
as shown here:
cfg.width = 800;
cfg.height = 480;
Save and close the file to continue. All done! You have finished the project setup for
Canyon Bunny.