free3dom
  • Member for 8 years, 3 months
  • Last seen more than a month ago
1 answers
3 votes
4k views
OpenGL slower than Canvas
Accepted answer
6 votes

Instead of using an ImageView and transparent GLSurfaceView you should instead render your background using a fullscreen quad (just like you do with your sprites, but sized to fit the entire screen). ...

View answer
1 answers
2 votes
60k views
'Resetting' Google Play Games Services so app forgets it previously connected (so it shows confirmation screen again)
Accepted answer
5 votes

Follow these steps to "deauthorize" an app with G+ sign-in: Open the Google Settings app on your device. Next select the Connected apps option. Find your app in the list and select it. Finally click ...

View answer
6 answers
71 votes
53k views
How does Lua work as a scripting language in games?
4 votes

Since no one mentioned this, I will add it here for those interested. There is a whole book on the subject called Game Scripting Mastery. This is a fantastic text that was written quite a while ago, ...

View answer
2 answers
2 votes
2k views
How do I create curved ground in a 2D runner game?
4 votes

There is an easy way to fake this in a 2D tile game. First you create a tile that contains the curved shape (using alpha 0 for the "empty space"). Then for each pixel on the x-axis you store the ...

View answer
1 answers
2 votes
8k views
How to do frame by frame animation in android using open gl es
4 votes

First you'll need to be able to setup OpenGL ES for 2D rendering. Have a look at this answer on SO for some basic introductory info on how to setup and get a texture loaded and ready for 2D rendering. ...

View answer
3 answers
5 votes
1k views
How to handle collisions without ugly conditionals and type checking?
3 votes

While the conditional block is inevitable, your implementation has one serious flaw: Every new type of Entity you create will require you to alter the handleCollision() for every entity it could ...

View answer
1 answers
0 votes
4k views
What Type of Options should be on the Game Settings Menu?
Accepted answer
3 votes

Keep your options/config as simple as possible and include only what all players would likely use, such as volume. That said, it may be a good idea to add an Advanced or Extra button that takes the ...

View answer
2 answers
1 votes
5k views
How do I get an Android device's screen size in exact pixels?
2 votes

Not sure about doing it with JNI/C++ but in Java I just query the GLSurfaceView for it's size with surface.getWidth() and surface.getHeight(). This provides the exact pixel dimensions of the view/...

View answer
2 answers
3 votes
8k views
How can you check your users' unlocked achievements (Google Play Game Services)?
Accepted answer
2 votes

The Google Play Games service actually provides an API for doing just that. I have provided an example for querying the state of all achievements in this answer on SO - but I will provide that ...

View answer
2 answers
0 votes
152 views
How relevant is the ability to move/rotate buildings post construction in city builders?
Accepted answer
1 votes

I agree with your sentiment that the "punishment" in games are sometimes a bit harsh, especially when having to restart a game in order to fix one or two simple mistakes. Even in games that aim for ...

View answer
3 answers
0 votes
466 views
When to scale bitmaps in android game
1 votes

Scaling of textures when rendering is generally not very performance intensive - it can sometimes even be faster to render small textures that are scaled up (usually when there are lots of textures ...

View answer
1 answers
0 votes
733 views
Nullpointerexception when loading resources in openGL ES 2.0 Android project
Accepted answer
1 votes

You could wait for the asyncTask to finish by waiting for it in onSurfaceCreated using the get() method. This will be a blocking call though, so you might as well do your loading directly in ...

View answer
1 answers
0 votes
538 views
Animations / OpenGL (ES 2) in game menu
1 votes

The UI animations for games like Angry Birds is almost always done manually, i.e. not using platform specific elements. The reason of course being that the game will be released on multiple platforms. ...

View answer
2 answers
0 votes
64 views
How do I know when a player has crossed a point threshold?
Accepted answer
1 votes

I'm assuming you will award bonus time very some amount of points (i.e. every 100 points, starting at 200), But this can be modified to handle any type of case. Just use integer division to check if ...

View answer
1 answers
-1 votes
350 views
Making a sprite jump at a particular angle android
Accepted answer
1 votes

I'm assuming you want the sprite to jump towards the touch point, so instead of calculating and using the angle, rather just create a vector from the current position to the touch position: dir.x = ...

View answer
2 answers
0 votes
1k views
Recommended way to handle sprite assets for different screen densities (Android)
1 votes

Even though it does require more work and a little bit of thought, I think it does add value to your game. I personally use two resolution sets - one for all resolutions above some threshold and one ...

View answer
1 answers
0 votes
415 views
Feasability of mobile 2D multiplayer RPG game with interactive bitmap background
Accepted answer
1 votes

You should be fine doing all of this (tiles with states, various players, etc) as long as you maintain your world state (i.e. the state of each tile, player, etc) on the server. Each client would then ...

View answer
1 answers
2 votes
4k views
android: How to apply pinch zoom and pan to 2D GLSurfaceView
1 votes

You don't have to scale your GLSurfaceView; instead you should adjust your projection matrix in order to achieve "zooming". You are most likely using an orthographic projection for your 2D view, so ...

View answer
2 answers
2 votes
2k views
How can I create delays for sprite animations that work correctly when the application is killed and restored?
0 votes

I find it easiest to keep a delta time per frame updated in the onDrawFrame() of my surface view's renderer. This way it always reflects only the time that has elapsed since my last draw call, and I ...

View answer
1 answers
0 votes
789 views
libgdx game process dies on loading texture atlases
Accepted answer
0 votes

The amount of memory required for your 17 textures at 2048x2048 using 32-bit color is: 17 * 2048 * 2048 * 4 = ~272MB It's not too excessive, but that is just for graphics and it does not account for ...

View answer
3 answers
1 votes
316 views
Inconsistent sprite velocity?
0 votes

As specified in Mokosha's answer, this is most likely due to floating point error, and it is usually unavoidable. There are however a couple of things you can do: The first, and most obvious, is to ...

View answer
1 answers
2 votes
4k views
How to use mipmap in OpenGL-ES
Accepted answer
0 votes

Here is a good tutorial for using mipmaps (and other filtering techniques). To answer your other questions: It should work fine in Android 2.2+. Mipmaps are created from your base texture at ...

View answer
2 answers
1 votes
459 views
Easy Method to Change Color on UI Elements
0 votes

When i want to do something like this, I use white pixels form my images on the texture (usually flat shapes, and also for text). Then I use gl.glColor4f() to the color I want the item to appear in. ...

View answer