Brendan M
user 13369439
San Antonio, TX
Post #: 1
Hey guys, here are a few resources for libgdx:

Main site:
http://libgdx.badlogi...­

Simple starter project example:
http://code.google.co...­

Project setup tool:
http://www.aurelienri...­
https://github.com/Au...­

Forum:
http://www.badlogicga...­
Jason
user 11475666
Group Organizer
Schertz, TX
Post #: 177
Thank you very much for sharing these resources Brendan!
Josh B.
user 80131042
San Antonio, TX
Post #: 5
Great. Thanks!
Brendan M
user 13369439
San Antonio, TX
Post #: 2
There is an ApplicationListener class in LIBGDX that adheres to the android life-cycle (start, resume, pause, destroy..) that the main game logic goes in. I actually use the Game class which implements AplicationListener and lets you easily switch between several different 'Screens'.

Then, in the Android project, you just need to create a simple java file that extends AndroidApplication and sets some basic config attributes for the program:

AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useGL20 = true;
cfg.hideStatusBar = true;

and initialize your game logic class with this information:

mMyGame = new MyGame();
gameView = initialize(mMyGame , cfg);

and then you have an android View that you can deal with however you want. For desktop it is very similar, just in the desktop directory for your project you have your Main class and method that use LWJGL to create a desktop instance of this same game logic:

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;­
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;­

public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "MyGame";
cfg.useGL20 = true;
cfg.width = 540;cfg.height = 900;

new LwjglApplication(new MyGame(), cfg);
}
}

Hope this helps, I'll see if I can find a good example project with Box2D. Here are some full source examples though:

https://github.com/li...­
Josh B.
user 80131042
San Antonio, TX
Post #: 6
Thanks for reaching out. I'll study up here.
Josh B.
user 80131042
San Antonio, TX
Post #: 7
Any suggestion here are appreciated:
-The libgdx tool works great. Just like magic. Can't wait to actually write something.

-I'd like to get the projects here: GitHub to run, but I have some dependency issues. I'm missing a lot of the com.google.gwt imports.

Here is an example of one that is missing:
import com.google.gwt.user.client.ui.TextArea;

I'll figure out where those libraries are eventually I bet, but if you have a tip I'm all ears.

Also, after looking over some of the code, I think the way in which I parse objects and textures in my wallpaper tutorial would port pretty easily, allowing you to create objects in blender and render them. You might consider looking it over. You might like the result of swapping out a 2D pistol button for a 3-D pistol that is created in Blender for example. A 3-D rotating pistol object might look really slick in the weapon upgrade panel.

--Just a thought of course. I look forward to seeing if I can port some of my stuff for sure.

Thanks for any tips concerning those imports. I love the fact I'm looking at the default libGDX banner on my phone.

Thanks again,
Josh


Brendan M
user 13369439
San Antonio, TX
Post #: 3
-I haven't gotten the html versions working yet, I think gwt stuff was my issue as well.

-Thanks for the idea on 3D stuff, I'll look into it. Right now I prefer my cozy 2D Orthographic Camera, but 3D would take it to the next level. I'd need to test what effect that would have on processing and memory.

-For textures (and other assets) I would suggest using the AssetManager class. Allows for asynchronous loading, and the TextureAtlas tools are very helpful as well. Also, 'Texture.setEnforcePotImages(false);' is your friend.

-I don't have too much advice on importing blender models, but am very interested. I have wanted to make a 3D game in LIBGDX for a future project so maybe we could get some SAGE collaboration on something.

Josh B.
user 80131042
San Antonio, TX
Post #: 8
-Good advice. I'll look into the AssetManager class. When loading textures on 3-D models I'll run into load time issues. My solution is to pop a dialog window that tells the user to wait for a few seconds. Every once in a while I think 'I should learn to do all that in a separate thread or something' but never get around to it. You read my mind on that.

-In the last meeting you mentioned you have a solid perspective on memory management as it relates to graphical resources. Just curious if you could shed a little light on how you make sure you don't have graphics resident in memory that don't need to be there. I've tried different things, but I'd like to hear your take.

Take it easy,
Josh



Electricdisk
Electricdisk
San Antonio, TX
Post #: 2
One trick is to use a spritesheet which can easily fake a 3d object without actually hooking to a real obj, by exporting all the available views, you can call any view from the sheet. The little man in this video is a rendered object exported to a spritesheet. (see 1:30)

http://www.youtube.com/watch?v=12Tm69jhMY4­
Brendan M
user 13369439
San Antonio, TX
Post #: 4
Sorry, forgot about this thread.

For memory management libgdx is really good at taking care of a lot for you. Just use the asset manager and make sure that you dispose of things that aren't used.

I ususally make some sort of system where certain load/unloads are done based on game state. If I know that I'm in the instruction screen, I'll asynchronously start loading the game assets. Once that state switches, I'll unload the instruction screen assets and start loading the win screen assets. This is only if it is resource-intensive, for a simple game I can get away with just loading on resume() and unloading on pause()/destroy().

https://code.google.c...­
https://code.google.c...­

Helpful video too, thanks. For LIBGDX a good way to make spritesheets like this is the texture packer:
https://code.google.c...­
Powered by mvnForum

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy