22 votes

Unity Method count exceed the limit of 64K

This answer relies heavily on Android's official documentation (the quoted parts, specifically). How to setup Multidex Support for Unity Project What is Multidex: Android application (APK) files ...
Rakesh's user avatar
  • 539
9 votes
Accepted

Main game objects as static

It won't hurt performance. It might in fact be (very, very negligible) faster because you save the overhead of passing these objects to the game objects. The reason static classes are often frowned ...
Philipp's user avatar
  • 118k
5 votes
Accepted

Is there an optimal method to implement moving background?

Don't keep newing up TextureRegions, try re-using one and just change the parameters of that. ...
bornander's user avatar
  • 4,461
4 votes

Better Way to Detect Line Cross

I would suggest that you keep track of the position of the obstacle until you have passed it and added a point. I would also suggest against trying to make a perfect size object for a collision, this ...
Arthur's user avatar
  • 133
3 votes
Accepted

Better Way to Detect Line Cross

To me, your basic idea of checking overlapping rectangle is workable; you only miss a small part: For each of your obstacles, have a two-state flag: untouched overlapping When you create the ...
Vaillancourt's user avatar
  • 16.3k
3 votes

Main game objects as static

If you're definitely only ever going to have one instance of these objects, and presumably you are, then this would be a better way to go. However, maybe a better solution would be to use the ...
Steve Smith's user avatar
3 votes

How can I exclude my enemies from spawning in certain zones generated at random?

If your corner sprites are as simple as you show here, you can avoid collisions by changing how you generate the random positions. E.g. for the top, you currently generate a random int between 0 and <...
Chris Mills-Price's user avatar
3 votes
Accepted

Can I make a multiplayer Android Game using Android Studio?

Of course! You can make multiplayer game with Android Studio, you can utilize Firebase too if you don't have any online server to manage peer connection. If you prefer using Java Socket Library, you ...
StefansArya's user avatar
2 votes

Should I use Unity for a "non-game" mobile app?

This is very dependent on the app. Unity is not only useful for games, but it should still be something game-like (eg. an architectural walkthrough). For a typical mobile UI app, I would recommend ...
jhocking's user avatar
  • 15.7k
2 votes
Accepted

Android Studio with libGDX doesn't recognize boolean

(from chat) You should not be restarting your entire program when you wish to restart your game. Instead reset the variables that control your game to their original state. Take this game as an ...
Charanor's user avatar
  • 7,800
2 votes
Accepted

How to know if these profiler values are good or bad?

There are no definitive "bad" or "good" value, but in general fewer calls are better since you spend less time doing what you're doing (e.g. drawing to the screen). The only way to know if your ...
Charanor's user avatar
  • 7,800
2 votes
Accepted

LibGDX: Why won't certain actions work on my Actor?

You need to draw you actor with a method that handle rotation ...
Sebastien Servouze's user avatar
1 vote

How to make members of an Array into an actor and add them to stage?

An EnemyAnimation is an actor in itself, you do not need to create an actor from the list of EnemyAnimation as the title of your post suggests. ...
realUser404's user avatar
  • 1,057
1 vote

LibGDx android : Show animation on button click

You missuse the animation class. you need to do the following: currentframe = animation.getKeyFrame(Gdx.graphics.getDeltaTime(), true); Currently you use an ...
Keey's user avatar
  • 56
1 vote

Libgdx black rectangles problem

Just had the same issue. Problem was that I had some texture regions as static fields. And to avoid finding texture region over and over for each object I added some extra static variable "...
MilanG's user avatar
  • 121
1 vote

Libgdx black rectangles problem

According to this section in the AssetManager page. When Android pauses, then the managed libgdx elements, like Textures, get cleaned up an have to be reloaded when the app resumes. To do this, you ...
spectacularbob's user avatar
1 vote
Accepted

Simplifying Object Factory

The nice thing about the Factory pattern is that the base class can be abstract and you can have different derived Factory classes. That means you can have an ...
Philipp's user avatar
  • 118k
1 vote

Should I use Unity for a "non-game" mobile app?

This questions is a bit overly broad, but the simplest answer is use the best tool for the job. If you don't think Unity can best suit your application, use the technology that will.
JonBee's user avatar
  • 659
1 vote
Accepted

Memory leak while loading libgdx game screen

Are you using the AssetManager? You can load/unload only when a texture is needed and in the end discard all at once. Furthermore, there should never exist more than 1 instance for every unique ...
Adolf's user avatar
  • 111
1 vote

Memory leak while loading libgdx game screen

Maybe you have local variable and you create those objects with those variables. Textures in libgdx doesn't have garbage collector. You must free the memory yourself with the method dispose().
Jordan Motta's user avatar
1 vote
Accepted

Actor in Stage Does Not Update the MoveTo XY Location

I have found the answer to my own question, I have separated both class to a different stage and this solution works. I know that there is a better way of doing this and I am open for any edits or ...
JAlmazan's user avatar
1 vote

Actor in Stage Does Not Update the MoveTo XY Location

I think the problem is because you are calling this.act(delta) in your ArrowClass' draw method. When you call ...
John's user avatar
  • 660
1 vote
Accepted

Image Does Not Animate and is Stuck in one Frame

I wrote a Ninja class for you. You can test it cause I don't have GDX on this PC here: ...
Jacob's user avatar
  • 2,522
1 vote

Image Does Not Animate and is Stuck in one Frame

In LevelOneScreen, make your update method call update on ...
bornander's user avatar
  • 4,461
1 vote

libGDX, Android Studio assets not found but linked properly

Did you make sure to set the file path to ".../android/assets/" in the configuration settings? Your error message is exact same as one I had and I remember that was my problem anyway
Big T Larrity's user avatar
1 vote

libGDX, Android Studio assets not found but linked properly

You have to set the working folder in the Run Configurations. Go to Run => Run Configurations.. => choose DesktopLauncher, Arguments Tab => Working Directory => Others then browse to yourproject-...
Adolf's user avatar
  • 111
1 vote

LibGDX touchDown event continues

The reason why the player continues to shoot is once you press the button downPress=true. It will stay true until you release the button. You could just call the shoot method from the touchDown event. ...
Klemmensen's user avatar
1 vote

Better Way to Detect Line Cross

Your "long thin line" object is basically a funny shaped coin. Make the "long thin line" object wider (to avoid missing it), and simply delete it after it's collected rather than needing it to be as ...
Random832's user avatar
  • 131

Only top scored, non community-wiki answers of a minimum length are eligible