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 ...
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 ...
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
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 ...
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 ...
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
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 ...
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 ...
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 ...
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
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 ...
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 "...
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 ...
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 ...
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.
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 ...
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 ...
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:
...
1
vote
Image Does Not Animate and is Stuck in one Frame
In LevelOneScreen, make your update method call update on ...
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-...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
android-studio × 80android × 49
libgdx × 33
java × 32
unity × 9
animation × 4
andengine × 4
graphics × 3
maps × 3
scene2d × 3
collision-detection × 2
ios × 2
game-mechanics × 2
game-loop × 2
game-maker × 2
opengl-es2 × 2
mobile × 2
sound × 2
asset-management × 2
build-process × 2
gradle × 2
c# × 1
opengl × 1
2d × 1
camera × 1