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 ...
  • 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 ...
  • 113k
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. ...
  • 4,296
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 ...
  • 123
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 ...
  • 15.8k
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 ...
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 <...
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 ...
2 votes

Why does Intersector.overlaps return false?

It very much looks like your boundingRect is incorrectly calculated. From your log you've got 5 boundingRects (I've re-ordered ...
  • 4,296
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 ...
  • 15.6k
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 ...
  • 7,680
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 ...
  • 7,680
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 ...
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. ...
  • 1,047
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 ...
  • 56
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 ...
  • 113k
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.
  • 639
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 ...
  • 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().
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 ...
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 ...
  • 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: ...
  • 2,502
1 vote

Image Does Not Animate and is Stuck in one Frame

In LevelOneScreen, make your update method call update on ...
  • 4,296
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
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-...
  • 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. ...
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 ...
  • 131
1 vote
Accepted

Is this how I use activities in android studio?

Every activity is an individual application screen, so you are correct in thinking they could be used for, as you put it, individual game scenes. The activity lifecycle is set up the way it is to ...
  • 216

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