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
18
votes
5answers
16k 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? ...
22
votes
4answers
10k 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 ...
5
votes
1answer
19k 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 ...
4
votes
1answer
688 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 ...
10
votes
1answer
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 ...
10
votes
2answers
11k 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 ...
8
votes
2answers
6k 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 ...
3
votes
2answers
10k 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. ...
1
vote
2answers
388 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 ...
27
votes
5answers
16k 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 ...
6
votes
4answers
7k 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 ...
12
votes
1answer
837 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 ...
5
votes
1answer
4k 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/...
11
votes
4answers
4k 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 ...
89
votes
15answers
194k views

2D Gaming Libraries/ Frameworks/ Engines for Android [closed]

Are any such things available to help me build my Android game?
28
votes
2answers
11k 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() ...
26
votes
5answers
13k 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 "...
22
votes
4answers
26k 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 ...
11
votes
5answers
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 ...
7
votes
3answers
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 ...
1
vote
5answers
5k 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 ...
14
votes
2answers
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, ...
40
votes
5answers
30k 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 ...
10
votes
1answer
1k 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 ...
19
votes
8answers
6k 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 ...
9
votes
2answers
29k 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 ...
8
votes
2answers
3k 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 ...
12
votes
6answers
7k 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/...
8
votes
2answers
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 ...
6
votes
1answer
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-...
16
votes
1answer
11k 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 ...
3
votes
1answer
529 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 ...
11
votes
3answers
5k 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 ...
9
votes
2answers
14k views

How do I find the angle between two vectors?

I have 3 points on my screen: ...
5
votes
2answers
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 ...
3
votes
2answers
445 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 ...
3
votes
2answers
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 ...
1
vote
0answers
79 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 ...
1
vote
2answers
957 views

Moving sprites using the accelerometer (Android)

In my previous game, I was moving my sprite like so: ...
-2
votes
2answers
2k views

Road parallax background

I am a beginner in game development. I want to create a parallax background that merges at the front and expands at the bottom. I'm sure there is a way to do this, but I'm missing something. My ...
6
votes
3answers
317 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, ...
4
votes
1answer
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 ...
2
votes
4answers
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 ...
1
vote
1answer
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 ...
1
vote
1answer
6k 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 ...
0
votes
2answers
225 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 ...
0
votes
1answer
783 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-...
0
votes
0answers
525 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 ...
0
votes
1answer
96 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 ...
-5
votes
4answers
6k views

How to implement a 2d collision detection for Android

I am making a 2d space shooter using opengl ES. Can someone please show me how to implement a collision detection between the enemy ship and player ship. The code for the two classes are below: ...