Questions tagged [android]

Android is an operating system for mobile devices developed and maintained by Google, Inc. This tag should contain specific programming questions about Android.

Filter by
Sorted by
Tagged with
23 votes
4 answers
12k views

Saving player's progress in a Unity game

I am making a game using the Unity game engine. I want to save the player's progress including level, experience points, chosen character, etc. Presently I am using playerprefs but I want to know ...
Shantanu Singh's user avatar
19 votes
5 answers
17k views

How can I develop my Android game for different phone resolutions?

For instance, the Motorola Droid is as wide as the G1, but has more height. Should I try to spread the UI out across the extra height found on the Motorola Droid? How do others handle this problem? ...
Bryan Denny's user avatar
  • 5,103
14 votes
2 answers
17k views

How to calculate shot angle and velocity to hit a moving target?

I am developing a 2D Android game and I am making an aiming algorithm for AI projectiles to hit enemies either following a path, or free moving. At the moment it just calculates where the target will ...
Guen's user avatar
  • 141
8 votes
1 answer
38k views

What sprite size should I use for 2D game?

I try to create a 2D game for Android. It looks like Cut the rope (it isn't a clone but it have same level representation) if it has a value. My problem that I can't understand that optimal sprite ...
Denis Steinman's user avatar
9 votes
2 answers
31k views

How to force keep the aspect ratio and specific resolution without stretching the output screen view?

I'm using Screen.SetResolution() But when I run in Android device, it shows the output image is stretched to fill up the full screen which I don't want. I want it to keep the aspect ratio properly. ...
elliotching's user avatar
4 votes
1 answer
925 views

Platformer collision problems

I am working on a platformer 2D, and i am currently focusing on collision. I have the actual rectangle(class: Rect) and i can detect if the player-model is intersepting it. However, when it comes from ...
user avatar
10 votes
1 answer
13k views

What's the best way to create animations when doing Android development?

I'm trying to create my first Android game and I'm currently trying to figure out (with someone that will do the drawings and another programmer) what the best way to create animation is. (Animations ...
Jumbala's user avatar
  • 275
9 votes
2 answers
8k views

How do you triangulate an arbitrary polygon?

I need to triangulate a polygon for rendering in OpenGL ES on Android (no GLU triangulation available). Is there an already known algorithm for polygon triangulation? The polygon can be convex or ...
Jason's user avatar
  • 461
1 vote
2 answers
591 views

How to Refresh Dependencies after Adding FreeType Extension in Android Project

I'm planning to use FreeType fonts in my game (LibGDX and Android Studio) and I already added the freetype dependencies in my project. How can I refresh the dependencies after adding them? I have ...
JAlmazan's user avatar
27 votes
5 answers
17k views

What should I keep in mind when making 2D games for multiple resolutions?

I'm making a 2D (Android) game. Android devices vary quite a lot in screen resolution; what do I need to keep in mind when making my game? Do I need to keep big versions of all images and scale down ...
ashes999's user avatar
  • 11.3k
13 votes
1 answer
917 views

When and why is a Pool class needed to hold objects?

I've been studying opengl es and an example I saw was using a "Pool" class to keep track of touch and keyboard events. Could someone please explain how and why a pool class is needed. From what I was ...
jaysonpowers's user avatar
11 votes
4 answers
7k views

Should I move the world or move the player?

I'm about to start developing a sidescrolling game where the player's goal is to travel as far as he can in the horizontal axis before touching down. Note that I do not need to ever travel back on the ...
monoceres's user avatar
  • 233
6 votes
4 answers
8k views

Which Side Was Hit?

I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am ...
Alex_Hyzer_Kenoyer's user avatar
5 votes
1 answer
5k views

Cocos2d-x supporting multi-resolution using density independent pixels

Is there a way to use Density Independent pixels(dp) in cocos2d-x? I am developing an Android game using Cocos2d-x 3.0. The Android reference http://developer.android.com/guide/practices/...
whiteSkar's user avatar
  • 183
4 votes
5 answers
6k views

How do I approach large companies if I have a killer mobile game idea?

I have an idea for a game that has potential, but I'm not a programmer. How do I tell this to development companies without having my idea stolen? All I want from the company is for somebody to ...
b9d's user avatar
  • 57
28 votes
2 answers
12k views

How many threads should an Android game use?

At minimum, an OpenGL Android game has a UI thread and a Renderer thread created by GLSurfaceView. Renderer.onDrawFrame() ...
kvance's user avatar
  • 383
26 votes
5 answers
20k views

How to design an AssetManager?

What is the best approach to designing an AssestManager that will hold references to graphics, sounds, etc. of a game? Should these assets be stored in a key/value Map pair? I.e. I ask for "...
Bryan Denny's user avatar
  • 5,103
22 votes
4 answers
27k views

Resolution Independence in libGDX

How do I make my libGDX game resolution/density independent? Is there a way to specify image sizes as "absolute" regardless of the underlying density? I'm making a very simple kids game; just a bunch ...
ashes999's user avatar
  • 11.3k
14 votes
2 answers
2k views

How do I create a World Healing Wave effect?

I want to change my dark and depressing background to a happy grassy background, in real-time, such that the happy background is shown in a radius around a game character. A forcefield of happiness, ...
Green_qaue's user avatar
  • 1,903
11 votes
4 answers
6k views

2D collision detection

Let's assume I'm using this character. (source: iconbug.com) How would you implement collision detection for it? Using a bounding box doesn't seem to be a good approximation, because the bird's shape ...
async's user avatar
  • 745
7 votes
3 answers
4k views

building a game for different resolution phones

I am starting some tests for building a game on the Android program. So far everything is working and seems nice. However I do not understand how to make sure my game looks correct on all phones as ...
Jason's user avatar
  • 461
2 votes
3 answers
6k views

Will I have copyright issues making a mobile game based on an anime?

I have been wanting to create a mobile game based on some of my favorite anime. I want to know if using character images and names from those anime (even after giving full copyright credits and ...
user39111's user avatar
1 vote
1 answer
6k views

Reducing mobile build size

This is my second time making and game and I want to make sure that I fit under 50 mbs. So far my plan is to fit all the games artwork into two 2048x2048 sprite sheets. I tested a empty unity3d ...
Uri Popov's user avatar
  • 3,027
40 votes
5 answers
33k views

Workaround to losing the OpenGL context when Android pauses?

The Android documentation says: There are situations where the EGL rendering context will be lost. This typically happens when device wakes up after going to sleep. When the EGL context is ...
Nick Gotch's user avatar
19 votes
8 answers
8k views

What all should be happening during the "Loading" screen?

Do I just need to be creating instances of all of my graphics into memory that are loaded from file? What is the best way to handle this? Do I just need some sort of assets manager that creates ...
Bryan Denny's user avatar
  • 5,103
16 votes
1 answer
13k views

Max texture size Android : which settings for 2048x2048?

I want to use a texture atlas of 2048 x 2048 in my game, and I would like to warn the users with a "too low" device to not download the game. With a texture atlas of this size, what requirements ...
Paul's user avatar
  • 679
12 votes
6 answers
8k views

Making (or emulating) a "D-Pad" on a touch-screen; virtual d-pad

With the proliferation of touch based devices, many lacking a true D-Pad, I'm wondering if anyone has any resources on how to emulate a D-Pad on a touch screen? I'm specifically interested in XNA and/...
Nate's user avatar
  • 5,054
11 votes
3 answers
24k views

Fitting Android game to different screen sizes

I am making an Android game that is only in portrait screen orientation. It works great when I run it on my phone, but when I run it on a tablet, even though the screen size is bigger, all of the ...
user1404512's user avatar
11 votes
3 answers
7k views

Android: Angry Birds Scaling

Anyone have any idea how the scaling is accomplished in angry birds? I want to make sure my images/background always scale to match the screensize and this game seems to have a similar effect. I ...
evermore's user avatar
  • 113
11 votes
1 answer
2k views

How can I reliably implement GPU skinning in Android?

I'm trying to get character skinning working on Android. The idea is quite vanilla: I have my skinning matrices, and along with each vertex, I send up to four matrix indices and four corresponding ...
Panda Pajama's user avatar
  • 13.4k
9 votes
2 answers
19k views

How do I find the angle between two vectors?

I have 3 points on my screen: ...
maffo's user avatar
  • 203
9 votes
2 answers
31k views

Resolution problems when porting a Unity game to Android

So, I'm porting a game to the Android for the first time in Unity3D. And I've run in to a few problems along the way. My current problem is the resolution doesn't seem to be right, it cuts off the ...
Timothy Williams's user avatar
9 votes
2 answers
5k views

How to handle pixel-perfect collision detection with rotation?

Does anyone have any ideas how to go about achieving rotational pixel-perfect collision detection with Bitmaps in Android? Or in general for that matter? I have pixel arrays currently but I don't know ...
DRiFTy's user avatar
  • 576
8 votes
2 answers
4k views

What do you use to support multiplayer turn-based network game for iOS and Android games?

If I'm doing a turn-based card game, what kind of technique do you use to support multiplayer gameplay over Internet? Is it socket? If it's socket, which SDK (CoronaSDK etc.) can provide solid ...
Devyn's user avatar
  • 223
6 votes
1 answer
6k views

How do I get smooth edges with OpenGL on Android?

Here is a screenshot that maybe makes clear what my problem is. I'm only drawing 2D circles with OpenGL. I already read the following: https://stackoverflow.com/questions/3512456/how-to-draw-...
Spenhouet's user avatar
  • 365
6 votes
3 answers
326 views

How can I deploy an Android game without going through the marketplace?

How do I deploy an Android app without publishing it in the marketplace? Let me back up a minute. I have short release cycles (2-4 weeks or less), and I would like to release a partially complete, ...
ashes999's user avatar
  • 11.3k
5 votes
2 answers
6k views

How do I store level-data in Android?

I'm building a game where enemies come in waves. I want to create a file where I can define data about the waves (# of enemies, spawn times, speeds, etc.). I come from a background in iOS and would ...
Slayter's user avatar
  • 185
4 votes
1 answer
3k views

How do I implement an AutoParallax Background in AndEngine GLES1?

I'm using AndEngine GLES1. In my game, I use AnalogOnScreenControl to move a sprite and when it moves vertically, the background image also moves vertically. I want to do something like this: that is ...
Bin's user avatar
  • 149
3 votes
2 answers
2k views

Why does my position interpolation code result in "jumpy" motion?

I am developing an android game with box2d and use a fixed timestep system for advancing the physics. However as I use this system it requires the box2d positions to be interpolates. I read this ...
Jason's user avatar
  • 461
3 votes
1 answer
808 views

How can I play user-provided music stored on the phone inside my game?

I am creating a car game. Is any way to play the music stored on the phone inside the game? I'd like the player to choose files that are already on their device and hear them played in the game. For ...
Manoj Balaji M's user avatar
3 votes
2 answers
496 views

Efficiently detecting objects inside multiple radius

I would like to create a game for mobile that require to calculate multiple time by seconds which moving objects are in the radius of moving points. The game is highly inspired from Gratuitous Space ...
Atol's user avatar
  • 143
2 votes
4 answers
5k views

per pixel based collision detection

I was wondering if anyone had any ideas on how to get per pixel collision detection for the android. I saw that the andEngine has great collision detection on rotation as well but couldn't see where ...
pengume's user avatar
  • 87
1 vote
2 answers
1k views

Moving sprites using the accelerometer (Android)

In my previous game, I was moving my sprite like so: ...
BungleBonce's user avatar
  • 1,927
1 vote
1 answer
7k views

OpenGL ES 2.0 gluUnProject

I've spent more time than I should trying to get my ray picking program working. I'm pretty convinced my math is solid with respect to line plane intersection, but I believe the problem lies with the ...
secheung's user avatar
1 vote
1 answer
184 views

How to make a sprite jump up and then return to original position android java

I am just starting out in game development and I am trying to make a simple android game using GDXLib. I want to make my sprite "ball" jump straight up in the air and then return to where it ...
Richard Flack's user avatar
1 vote
0 answers
90 views

Game is responding very slowly?

I have a very simple app which removes buttons and re-adds buttons to certain layouts when a button is clicked. The problem is, this process is taking a very long time. My question is: How can I make ...
NullPointerException's user avatar
0 votes
2 answers
428 views

Can I publish the games I learnt from tutorials and modified as per my style of game-play? [duplicate]

I am new to the world of making games and all. Well its been a few months or so. There are many tutorials that I have been watching. On the way, I made a few games that I saw and made. I am not asking ...
Sakib Zang's user avatar
0 votes
1 answer
1k views

Is there a way to use the RGB channels of a texture as the alpha channel when applying multitexturing using OpenGL ES 1.1?

I have been trying to get texture compression using ETC1 (specifically PKM files) working for some time now. I am trying to do this without having to upgrade to OpenGL ES 2 so I have been using multi-...
brent777's user avatar
  • 179
0 votes
0 answers
544 views

Landscape mode for game?

TL;DR: I have made 8 new layouts for each activity layout, but they are not showing up. For example, I have a layout-land directory with a layout, but that layout ...
Ruchir Baronia's user avatar
0 votes
1 answer
211 views

In Android, neat way to send input info from `GLSurfaceView` to `onDrawFrame` in `GLSurfaceView.Renderer`?

The input is pinch/drag for camera movement, which modifies a matrix to scale/translate, and sent to a vertex shader. It's working, but ugly. What's the proper way to do it? I've noticed: ...
hyperpallium's user avatar