Transparency in GLSurfaceView I'm new in game development. I have a view using GLSurfaceview and call in MainActivity. I want to make transparent that view. I have tried setZOrderOnTop() method in MainActivity and glClearColor() but both are not working. public class RubikActivity extends Activity cubeView cv GLSurfaceView gv SuppressLint("NewApi") Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) setContentView(R.layout.activity) cv (cubeView) findViewById(R.id.cubeView) cv.initialize(PreferenceManager.getDefaultSharedPreferences(this)) cv.requestFocus() cv.setFocusableInTouchMode(true) cv.setEGLConfigChooser(8, 8, 8, 8, 8,0) cv.setRenderer( new CubeRenderer(getApplicationContext(), font, mWorld, rCube, mMenu, prefs) cv.getHolder().setFormat(PixelFormat.TRANSLUCENT) cv.setZOrderOnTop(true) cubeView.java public cubeView(Context context, AttributeSet attrs) super(context, attrs) font new TextureFont(getContext(), R.drawable.roboto regular, "roboto regular dims.txt") mWorld new GLWorld() public void initialize(SharedPreferences prefs) rCube new Rubec(mWorld, prefs.getInt("dim", 3)) mMenu new CubeMenu(rCube, font) renderer new CubeRenderer(getContext(), font, mWorld, rCube, mMenu, prefs) rCube.setRenderer( renderer) mWorld.setRubeCube(rCube) setRenderer( renderer) getHolder().setFormat(PixelFormat.TRANSLUCENT) setZOrderOnTop(true) cubeRenderer.java Override public void onDrawFrame(GL10 g) GL11 gl (GL11)g surfaceSetup(gl) gl.glClearColor(1.0f, 1.0f, 1.0f,0) gl.glClear(GL11.GL COLOR BUFFER BIT GL11.GL DEPTH BUFFER BIT) gl.glDisable(GL11.GL DEPTH TEST) gl.glMatrixMode(GL11.GL MODELVIEW) gl.glShadeModel(GL11.GL SMOOTH) gl.glLoadIdentity() GLU.gluLookAt(gl, 0f, 0f, 7f, 0f, 0f, 0f, 0f, 1f, 0f) gl.glGetFloatv(GL11.GL MODELVIEW MATRIX, modelViewMatrix, 0) if(!worldBoundsSet) getWorldBounds() gl.glColor4f(0.5f, 0.5f, 0.5f, 1) gl.glEnable(GL11.GL DEPTH TEST) gl.glEnableClientState(GL11.GL COLOR ARRAY) gl.glEnableClientState(GL11.GL VERTEX ARRAY) gl.glEnableClientState(GL11.GL TEXTURE COORD ARRAY) menu.draw(gl) mWorld.draw(gl) gl.glDisableClientState(GL11.GL TEXTURE COORD ARRAY) gl.glDisableClientState(GL11.GL COLOR ARRAY) gl.glDisableClientState(GL11.GL VERTEX ARRAY) gl.glFlush() I want the white color to show as transparent background in my layout. I am already use glClearColor(0,0,0,0) which shows as a black color and already use in xml file lt com.rtpl.rubikgame.cubeView android id " id cubeView1" android layout width "match parent" android layout height "match parent" android layout weight "1" android background " 000000" android windowIsTranslucent "true" gt lt LinearLayout gt but nothing happened when we use glClearColor(0,0,0,0) it shows this


Pass a single boolean from an Android App to a libgdx game I'm writing an Android application that needs to pass a single boolean into an Android game that I am also writing. The idea is that the user does something in the App which will affect how the game operates. This is tricky with LIBGDX since I need to get the bool value into the Java files of the game, but of course, you can't call Android specific things from within LIBGDX's main Java files. I tried using an intent but of course the same problem persists. I can get the boolean into the MainActivity.Java of the android output of the game, but can't pass it along any further since the android output and the main java files don't know about each other. I have seen a few tutorials that explain how to use set up an interface in the LIBGDX java files that can call android things. This seems like wild overkill for what I want to do. I've been trying to use Android's Shared Preferences with LIBGDX's Gdx.app.getPreferences, but I can't make it work. Anyhelp would be MUCH appreciated. I've set up two hello world applications. One is a standard Android app, with a single button that is supposed to write "true" into the shared preferences. The other is a standard LIBGDX hello world that is supposed to do nothing but check that bool when launched and if true display one image to the screen, if false, display a different one. Here's the relevant bit of the Android code import android.preference.PreferenceManager public void onClick(View view) if (view this.boolButton) final String PREF FILE NAME "myBool" SharedPreferences preferences getSharedPreferences(PREF FILE NAME, MODE WORLD WRITEABLE) SharedPreferences.Editor editor preferences.edit() editor.putBoolean("myBool", true) editor.commit() And here's the relevant bit of the code from the LIBGDX main file Preferences prefs Gdx.app.getPreferences("myBool") boolean switcher prefs.getBoolean("myBool") if(switcher true) texture new Texture(Gdx.files.internal("data worked512.png")) prefs.putBoolean("myBool", false) else texture new Texture(Gdx.files.internal("data libgdx.png")) Everything compiles fine, it just doesn't work. I've spent HOURS googling trying to find a way to pass this single boolean from android into a LIBGDX main and I'm totally stumped. Thanks for your help.


AABB Collision Detection Why does the simple broadphase algorithm work better? Hi I am working on barrier detection. I used this swept aabb algorithm http www.gamedev.net page resources technical game programming swept aabb collision detection and response r3084. It suggests two ways to detect collision. 1. broadphase this is a shorter algorithm which can only detect non collision 100 . 2. In order to make sure that there is a collision, the more detailed swept aabb algorithm has to be executed right after the broadphase one. Strangely the broadphase algorithm alone detects a barrier collision each and every time and the more precise one actually doesn't at all times. What I do in my code is basically the following My object moves towards the barrier with a constand speed vx direction speed delta (that's the amount it moves each frame). So positionx positionx (direction speed delta) each frame. The broadphase collision is calculated each frame by using vx and vy. Are there some rare cases where the broadphase can actually detect a collision like in this one I described? Thanks so much for your help Thanks so much


Is copying UI and layout of other apps legal? I would like to develop an Android App for Google Play and I am going to use Facebook and Whatsapp UI as background of the game (as a back story). I will use icons without copyright to emulate duplicate the style of Facebook and Whatsapp (they are not part of original drawable of the external app). I will inform the user about the objective of the game. I won't include any direct references to the emulated apps such as the title "Facebook" or "Messenger". The user is free to interpret what he is seeing. I will add the text "any name and reference is fictitious". However I have some great doubts After the development, will I be able to upload the app on an app store such as Google Play? Is copying UI and layout of other external apps legal? Does it break any law or rule?


How to implement a game launch counter in LibGDX I'm writing a game using LibGDX in which I want to save the number of launches of a game in a text file. So, In the create() of my starter class, I have the following code ..but it's not working public class MainStarter extends Game private int count Override public void create() Set up the application AppSettings.setUp() if(SettingsManager.isFirstLaunch()) SettingsManager.createTextFileInLocalStorage("gamedata") SettingsManager.writeLine("gamedata", "Launched " count ,FileType.LOCAL FILE ) else SettingsManager.writeLine("gamedata", "Not First launch " count ,FileType.LOCAL FILE ) Load assets before setting the screen Assets.loadAll() Set the tests screen setScreen(new MainMenuScreen(this, "Main Menu")) What is the proper way to do this?


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 disclaimer) infringes any copyrights? Would this come under "fair use" in the DMCA (I mean there are already so many not so legal sites using this "fair use" to continue running). What are the possible things I can do for making this game? I have seen many online browser games based on anime which use images and elements from that anime, while I have also seen many games advertise themselves based on a anime but just use diffrent names for characters of that anime (sometimes modifying the character images, too).


How to move gameobject with touch on Android I'm trying to make a game where you control a character via touch on Android devices. The player will have two degrees of movement. When you touch the touch screen and move your finger, the game object should move to your finger's location and follow your finger as you move it. Here is an example of what I'm trying to do http www.youtube.com watch?v OoqRC8QptzM t 01m01s ( 1 02). I already know I need to use Input.touches. I've tried using Transform.translate and Vector3.Lerp, neither gave me the results I wanted. Here is some of the code I've tried using pragma strict var speed float 1 function Start () function Update () if (Input.touchCount gt 0 amp amp Input.GetTouch(0).phase TouchPhase.Moved) Get movement of the finger since last frame var touchDeltaPosition Vector2 Input.GetTouch(0).deltaPosition var touchPosition Vector3 touchPosition.Set(touchDeltaPosition.x, transform.position.y, touchDeltaPosition.y) Move object across XY plane transform.position Vector3.Lerp(transform.position, touchPosition, Time.deltaTime speed)


Score won't save to Android in Game Maker Studio 1.4 I have oController as the first object to run when the game is opened. In oController's Game Start event I have the following code ini open(working directory quot SavedScores.ini quot ) var highscores ini read real( quot Highscores quot , quot Score quot , 0) ini close() global.LastScore highscores When the player has gotten their score, I use this code to save it if global.gameOver if global.LastScore 0 global.LastScore global.currentScore ini open(working directory quot SavedScores.ini quot ) ini write real( quot Highscores quot , quot Score quot , global.LastScore) ini close() else if global.currentScore gt global.LastScore global.LastScore global.currentScore ini open(working directory quot SavedScores.ini quot ) ini write real( quot Highscores quot , quot Score quot , global.LastScore) ini close() Whenever I relaunch the game on my phone, it won't load the score I got when I previously launched the game. Idk why it's not saving?


Thread runs faster on a faster processor... how to control Thread speed I have a thread that uses TimeUnit.MILLISECONDS.sleep(5) Problem is when I load my app on a faster phone say with a snapdragon, it runs at lightning speed. Is there a way to control this speed so processor speed is not an attributing factor? Thanks!


How can i get object from TMXTiledMap and store it in Dictionary variable ? I've been following a tutorial to make tiled map in cocos2d x 3.0 , but i couldnt complete the rest of the tutorial because its for coco2d x 2.0 version, How can i get a value of property that is stored in an object from TMXObjectGroup variable ? and my code is tileMap cocos2d TMXTiledMap create("ground.tmx") ground tileMap gt layerNamed("ground") this gt addChild(tileMap) TMXObjectGroup objects tileMap gt getObjectGroup("objects") ??? sign objects gt getObject("sign") it return ValueMap not Dictionary ?! how can i get a Dictionary of that object so i can get its values ??


Can I publish the games I learnt from tutorials and modified as per my style of game play? 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 about those. In fact I don't want to publish those games in my name ever. But then there are some small games that I made which are modified version from what I learnt of those games. Like I changed the game play style, made it simpler and ignored some features from a game. Can I publish them in play store? Or this would be any break of law or something? or Something that I should not do?


Project updates don't show up on mobile device I've made a small application with libgdx framework, which works perfectly on desktop. It runs on Android too, however once I change something in my main project and try to recompile it on my phone, it seems like the Android still runs the old version. I've tried to re install the app, but it does not help. The only way I can see the changes on my phone is to recreate a different Android project. Any ideas what might be causing this kind of behavior? My projects are created the way it is shown here http code.google.com p libgdx wiki ProjectSetup EDIT Not sure why, but everything seems to work fine after "re installing" Eclipse


LibGDX RPG walking animation I've been trying to nail down a walking animation with libGDX. I'm making an RPG with the character that can move up, down, left, and right. I have this movement in a spritesheet. I've been following a youtube tutorial called Java Tiled Map Game which can be found here http www.youtube.com watch?v qik60F5I6J4 He does a better job then some of explaining what the code does but he glosses over the part where he gets his character to do a walking animation (by which I mean he doesn't show it at all). I then moved to the tutorial found here http obviam.net index.php getting started in android game development with libgdx tutorial part 2 animation But this tutorial tells exactly what needs to be done in regular words and then just gives a block of code. I already know what I need to do in regular words but I'm not trying to learn english but programming which is a completely different language. I'm sure I could copy and paste that code and edit it to do what I need but I wouldn't understand HOW it works only THAT it works. I want to know the how of it all. I'm new to libGDX and this is my first RPG game. I really want learn how to do it myself instead of relying on others. My question is simply this Do you know of a tutorial which shows and (more importantly) explains how to do a simple walking animation? I'm hoping you can supply one for me.


Technique to have screen independent grid based puzzle with sprite animation let's say I have a fixed size grid puzzle game (8 x 10). I will be using sprites animation, when the "pieces" in the puzzle is moving from one grid to another grid. I was wondering, what is the technique to have this game being implemented as screen resolution independent. Here is what I plan to do. 1) The data structure coordinate will be represented using double, with 1.0 as max value. Puzzle grid of 8 x 10 Environment double width 0.8 double height 1.0 Location of Sprite at coordinate (1, 1) Sprite double posX 0.1 double posY 0.1 double width 0.1 double height 0.1 scale PYSICAL SCREEN SIZE drawBitmap ( sprite image, sprite image rect, new Rect(sprite.posX Scale, sprite.posY Scale, (sprite.posX sprite.width) Scale, (sprite.posY sprite.Height) Scale), paint ) 2) A large size sprite image will be used (128x128). As sprite image shall look fine if we scale from large size down to small size, but not vice versa. Besides the above mentioned technique, is there any other consideration I had missed out?


how to render small texture on another texture? can anybody help me to render small texture on another texture. i.e I have one background image, when user touches on the screen it should draw small(circle or any object) on it. can anybody suggest me good tutorial to starts with it?


Android LibGDX 1.9.6 Augmented Reality captured images are black Using LibGDX for an AR application and capturing image and merging lines and texts on LibGDX with image with this code. private Pixmap merge2Pixmaps(Pixmap mainPixmap, Pixmap overlayedPixmap) merge to data and Gdx screen shot but fix Aspect Ratio issues between the screen and the camera Pixmap.setFilter(Filter.BiLinear) float mainPixmapAR (float) mainPixmap.getWidth() mainPixmap.getHeight() float overlayedPixmapAR (float) overlayedPixmap.getWidth() overlayedPixmap.getHeight() if (overlayedPixmapAR lt mainPixmapAR) int overlayNewWidth (int) (((float) mainPixmap.getHeight() overlayedPixmap.getHeight()) overlayedPixmap.getWidth()) int overlayStartX (mainPixmap.getWidth() overlayNewWidth) 2 Overlaying pixmaps mainPixmap.drawPixmap(overlayedPixmap, 0, 0, overlayedPixmap.getWidth(), overlayedPixmap.getHeight(), overlayStartX, 0, overlayNewWidth, mainPixmap.getHeight()) else int overlayNewHeight (int) (((float) mainPixmap.getWidth() overlayedPixmap.getWidth()) overlayedPixmap.getHeight()) int overlayStartY (mainPixmap.getHeight() overlayNewHeight) 2 Overlaying pixmaps mainPixmap.drawPixmap(overlayedPixmap, 0, 0, overlayedPixmap.getWidth(), overlayedPixmap.getHeight(), 0, overlayStartY, mainPixmap.getWidth(), overlayNewHeight) return mainPixmap In 1.9.6 Pixmap.setFilter(Filter.BiLinear) is not available and it does not merge 2 pixmaps correctly. I tried setting BiLinear filter for both pixmaps or one at a time but none works.


Advantages and disadvantages of libgdx I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. So I would like to use it if there is no big obstacle. But when I tried to see how many developers employ this library, I could find not that many. Is there anything wrong with this library? In other words, I would like to know its advantages or disadvantages from any experienced developer. UPDATE After reviewing its documentations and trying to build simple games with libgdx, I decided to go with it as its documentations are good enough and its community is very active. What I liked the most is that it provides a bunch of demo games that I can learn a lot from.


How to change modify or animate an existing OpenGL object on Android? I maybe know understand it all a little bit better so i thoug i make a new shorter question to eventually get an answer. Get back or delete an existing OpenGL object, then change it and draw at new. How? So if and Admin reads this post, he can feel free to delete it. I'm working on OpenGL since a Week, so i'm new to the most stuff. (also my englisch isn't the best. Hop you can understand the most anyway) So i'm working on an Tamagotchi App for a school project and want to make it with OpenGL. I allready came this far But now i want to animate things. My mind told me that it shoud be possible to change or modify an existing OpenGL object. In my situation there are 3 opjekts Body Eyes Mouth For example her is my code from the mouth public class GLMouth private int points 1000 private float vertices 0.0f,0.0f,0.0f private FloatBuffer vertBuff private FloatBuffer vertBuff2 public GLMouth() vertices new float points 2 for(int i 0 i lt (points 3) i 3) double rad (Math.PI i) points vertices i (float)Math.cos(rad) vertices i 1 (float)Math.sin(rad) vertices i 2 0 ByteBuffer bBuff ByteBuffer.allocateDirect(vertices.length 4) bBuff.order(ByteOrder.nativeOrder()) vertBuff bBuff.asFloatBuffer() vertBuff.put(vertices) vertBuff.position(0) vertices new float points 2 for(int i 0 i lt (points 3) i 3) double rad (Math.PI i) points vertices i (float)Math.cos(rad) vertices i 1 (float)Math.sin(rad) vertices i 2 0 bBuff ByteBuffer.allocateDirect(vertices.length 4) bBuff.order(ByteOrder.nativeOrder()) vertBuff2 bBuff.asFloatBuffer() vertBuff2.put(vertices) vertBuff2.position(0) public void draw(GL10 gl) gl.glPushMatrix() gl.glTranslatef(0.0f, 1.0f, 0.0f) gl.glScalef(1.8f, 0.15f, 1.0f) gl.glColor4f(0.0f,0.0f,0.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() gl.glPushMatrix() gl.glTranslatef(0.0f, 1.0f, 0.0f) gl.glScalef(1.8f, 1.0f, 1.0f) gl.glColor4f(0.0f,0.0f,0.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff2) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() In my renderer i just creat a mouth object and then draw it with mouth.draw. So i thought i have allready drawn the mouth and now i can cange for example the gl.glScalef(1.8f, 0.15f, 1.0f) from that existing mouth to zero with some time in between to let it look like the mouth is closing. But how can i do that? I don't find anything with google, mostly because i don't know what i have to look up. If i understand OpenGL right, than it will just draw new mouths over the original. edit Or it is a question about where is the opjekt? Can i save it an take it back (delete it etc) and draw it new with other properties.


geometry shader shim for opengl es 2.0 I just have a few months of OpenGL experience, just starting to get the hang of it. I find geometry vertex fragment shaders to be very powerful. You have a few parameters that translates into a complex representation. One layer of your program can compute these parameters, the "model" only, and sharers can do the "view" part. That gives you a good separation of concerns and a lot of flexibility. It's a pity that OpenGL ES 2 doesn't have geometry shaders. I think the CPU could totally take over this part in case the GPU doesn't support it and if proper shim libraries were present. Is there any library that helps unfolding a model into vertexes vertex attribute parameters uniques, etc? Maybe one that uses the language of the geometry shaders?


Android opengles how to use glunproject How to use glunproject in my android app? I have the following parts in my engine A projection matrix A view matrix for the camera A model matrix for each of the objects in my world. This matrix is calculated from the parent objects model matrix and the objects own model matrix. These matrices are calculated from a translation, rotation and scale matrix. (this all works fine) These matrices are then multiplied and passed to my vertex shader. Now I understand glunproject needs the model matrix and the projection matrix and can caluclate a near and far 3d coordinate depending on the camera viewport settings ( for the near and far plane) Do I need to use glunproject for each of the objects in my world and then check if the ray produced by these near and far coords intersects my object? This seems quite expensive on the cpu? What is the proper use for glunproject


How does interpolation actually work to smooth out an object's movement? I've asked a few similar questions over the past 8 months or so with no real joy, so I am going make the question more general. I have an Android game which is OpenGL ES 2.0. within it I have the following Game Loop My loop works on a fixed time step principle (dt 1 ticksPerSecond) loops 0 while(System.currentTimeMillis() gt nextGameTick amp amp loops lt maxFrameskip) updateLogic(dt) nextGameTick skipTicks timeCorrection (1000d ticksPerSecond) 1 nextGameTick timeCorrection timeCorrection 1 loops render() My intergration works like this sprite.posX sprite.xVel dt sprite.posXDrawAt sprite.posX width Now, everything works pretty much as I would like. I can specify that I would like an object to move across a certain distance (screen width say) in 2.5 seconds and it will do just that. Also because of the frame skipping that I allow in my game loop, I can do this on pretty much any device and it will always take 2.5 seconds. Problem However, the problem is that when a render frame skips, the graphic stutter. It's extremely annoying. If I remove the ability to skip frames, then everything is smooth as you like, but will run at different speeds on different devices. So it's not an option. I'm still not sure why the frame skips, but I would like to point out that this is Nothing to do with poor performance, I've taken the code right back to 1 tiny sprite and no logic (apart from the logic required to move the sprite) and I still get skipped frames. And this is on a Google Nexus 10 tablet (and as mentioned above, I need frame skipping to keep the speed consistent across devices anyway). So, the only other option I have is to use interpolation (or extrapolation), I've read every article there is out there but none have really helped me to understand how it works and all of my attempted implementations have failed. Using one method I was able to get things moving smoothly but it was unworkable because it messed up my collision. I can foresee the same issue with any similar method because the interpolation is passed to (and acted upon within) the rendering method at render time. So if Collision corrects position (character now standing right next to wall), then the renderer can alter it's position and draw it in the wall. So I'm really confused. People have said that you should never alter an object's position from within the rendering method, but all of the examples online show this. So I'm asking for a push in the right direction, please do not link to the popular game loop articles (deWitters, Fix your timestep, etc) as I've read these multiple times. I'm not asking anyone to write my code for me. Just explain please in simple terms how Interpolation actually works with some examples. I will then go and try to integrate any ideas into my code and will ask more specific questions if need be further down the line. (I'm sure this is a problem many people struggle with). edit Some additional information variables used in game loop. private long nextGameTick System.currentTimeMillis() loop counter private int loops Amount of frames that we will allow app to skip before logic is affected private final int maxFrameskip 5 Game updates per second final int ticksPerSecond 60 Amount of time each update should take private final int skipTicks (1000 ticksPerSecond) float dt 1f ticksPerSecond private double timeCorrection


LibGDX I need to get from SpriteBatch to Batch in order to draw a Touchpad I have created a little game using LibGDX and it uses a SpriteBatch when it renders the game objects. Now I want to add a Touchpad to it, and the draw method of Touchpad takes a Batch as a parameter, but my game uses SpriteBatch. What can I do?


Overdrawn pixels vs many polygons, which affects performance the most? I know that having overdrawn pixels is not desirable as well as having many polygons since they can decrease performance. Often when I model I have an option to decrease the number of polygons by having disconnected polygons over. For example, considering this Let's imagine it has more turns that are not visible in this picture. I can decrease the number of polygons by having a pathway as a single disconnected face As a result I would have less poly count, but the bottom geometry would be overdrawn in many areas. Or I can model this as a single continuous mesh. As a result I would have more poly count, but no overdraw I very often have similar situations and I'm wondering which of these would be more performance efficient and cause less performance decrease on mobile devices?


Marketing PC Android 2d Physics Game I've been working on a game for couple years now, its fairly original, has definite potential within an indie market, and appeal for the masses also. I want to deploy on Android and PC, green light it on steam and looking into Kickstarter. I'm also going to set up a website where it can be played, have a dedicated server to link 'matches' and post demos on sites like mofunzone and armorgames. I've used Jbox2d, and am also curious about the licencing with this engine and can't seem to find documentation on that. I'm almost done the 'demo' and my question is, how should I market it? I was thinking I'd make the game free on android, charge something like 10 on steam, and charge say 1 month to play online (for the pc version) If anyone has any good links, research or advice from personal experience, it would be greatly appreciated.


Libgdx Animation Timing I'm having a small issue with libgdx animation. I'm using getKeyFrame() to get the current frame of the animation and I'm updating the state time by adding on deltaTime in my update function for the object. The animation is not looping. My problem is that the animation seems to play at different speeds depending on the frame rate. On my phone this animation plays particularly slow. My thinking was that the stateTime would cause it to skip a few frames when it's going slow, but this doesn't seem to be happening. Here is the code sprite Animation.getKeyFrame(stateTime, false) sprite.setRotation(angle) sprite.setPosition(position.x, position.y) sprite.draw(batch) Has anyone else experience this issue.


Resize the Texture Region (parallax background) to fit my screen size in libgdx I am using libgdx to make a running game. I am using vertical parallax background. I have successfully implemented parallax background many times. But for this game, I want my Texture region to fit my screen size. I tried several things but the texture region is streched badly.Here is a screenshot. I used this code texture bg loadTexture("data road1.png") bg new TextureRegion(texture bg, 0,0, 600, 600) that is obvious. Now ..what should I do... so that while making it as a parallax background... it would fit my screen... I am worried only about the width.... as if the width will fit the screen width... it will look like a running road... no matter how long the height is. I found some solution here https stackoverflow.com questions 7551669 libgdx spritebatch render to texture but not able to understand.. it seems somewhat complex. Please make it clear if it is the solution or suggest on other possibilties.


Unity Android Truecolor texture performance hit and alternatives for truecolor After integrating the graphics assets to my application, I noticed that when the textures are compressed they look very bad compared to truecolor. This happens to all the textures and it did not seem to help changing the texture type to GUI nor did it help to switch the 32 bit display buffering on. Does using truecolor textures make the application much heavier to run? Or does it just increase the size of the .APK? Are there alternatives to getting a good texture quality and a smaller texture size instead of using truecolor? EDIT I did some experiments with the dithering. I created a textures in GIMP 2.8, one which was RGB and one which was indexed with 255 colours and Floyd Steinberg dithering with reduced colour bleeding. In the Windows Explorer this looked promising, the image quality had hardly been reduced but the size was halved. But when they were imported to Unity, they were exactly the same size. And trying out different formats, there was not much noticeable difference between the image quality. Although the banding was a little bit less pronounced but still clearly seen. EDIT 2 I played around with the importing settings. And the only conclusion I can come up with is Don't use alpha! Without the alpha channel, there is no banding with the ETC compression which is supported by all OpenGL ES 2.0 GPUs. To have an alpha channel and no banding. I had to go all the way to RGBA 32 bit, which increased the texture file size to 64Kb compared to the no alpha channel ETC's 8Kb. Here again not much difference between the GIMP dithered and the RGB versions. So conclusion with this Dithering in GIMP did next to nothing.


Amazon FreeTime Unlimited Monetization So I've recently noticed how great FreeTime Unlimited is for my daughter. There's no ads, no in app purchases, etc. She can just play the games apps and I don't have to worry about it. As a develop I thinking it could an interesting avenue to go down, but there's a few things that I for the life of me can't get Amazon support forums to answer in any logical manner. So the idea according to their information is that the apps are highly scrutinized to verify they are child friendly content, which is excellent. Also, you can't use webviews, ads, or in app purchases. My question is How do devs monetize these applications? Clearly they're not just giving away their work for free? The only logical answer I can guess at, is that it uses the Amazon Underground scheme of earning based on the amount of time the user spends in the app game?? Does anyone have and actual experience or information on this? As I said, I've reached out to multiple people at Amazon, and keep getting the runaround with all of them pointing me to the same useless link.


How to implement a Play As Guest feature on a mobile device using PhoneGap? I have a Facebook Web Game that I converted to Android and iOS using PhoneGap. I can use Facebook for authentication on my mobile apps, but I would also like to allow the user to play as a guest. I've seen various games implement this workflow before and I'm curious how it is actually done. What unique identifier is the phone sending to the server to authenticate against? Does each phone have something unique about it that PhoneGap can expose via a plugin? Does anyone know the logic behind the "Play As Guest" feature many mobile games implement? Thanks!


Best way to manage sprite sheets on Android using NME I'm creating a 2D game for mobile touchscreen devices, specifically Android and iOS. I would like to know what is the best way (regarding performance and best practices) to manage sprite sheets. Should I create different sprite sheets (for ldpi, mdpi and hdpi) and then scale according depending on the screen resolution or there is a better solution?. I know that maybe the solution that someone could provide me would be platform independant but I'm using the NME framework (http www.nme.io ), perhaps you know a good solution using this framework.


GLES2.0 3D Android game performance and multi threading the update? I have profiled my mixed Java C Android game and I got the following result As you can see, the pink think is a C functions that updates the game. It does things like updating the logic but it mostly it generates a "request list" for rendering. The thing is, I generate DrawLists on C and then send them to Java to process and draw using GLES2.0. Since then I was able to improve update from 9ms down to about 7ms, but I would like to ask if I would benefit from multi threading the update? As I understand from that diagram is that the function that takes the most time is the one you see it's color on the timeline. So the pink area is taken mostly by update. The other area has MainOpenGL.Handle as it's main contributor(whch is my java function), but since it's not drawn to the top of the diagram I can conclude other things are happening at the same time that use the CPU? Or even GPU stuff that isn't shown in this diagram. I am not sure how the GPU works on this. Does it calculate stuff in parallel to the CPU? Or is it part of the CPU usage as in SoC? I am not sure. Anyway, in case GPU things DO happen in parallel to CPU, then I would guess that if I do this C Update in parallel to the thread that makes the OpenGL calls, I might make use of "dead CPU time" due to GPU stalling or maybe have the GPU calls getting processed earlier because it won't have to wait for Update to finish? How do you suggest to improve performance based on that?


Concerns about Google Play Games security I want to develop a Android game using LibGDX. Let's take a classic example some player can battle another one in turn based matches. The outcome of match defines the reward in some ingame currency. There will be premium currency with in app purchases, and both can be used to purchase some upgrades. I am discovering both Android and GPG at this point. GPG allows some P2P turn battles, matchmaking and cloud saves, making it looks like quite the thing I need. However, I have concerns regarding its security. The currencies needs, for obvious reasons here, to be fully secure, non corruptable by altering saves on the device. In the same way, it is my understanding that the turn based (and real time) matches are P2P, between devices. My question is, what GPGS does to enforce security on both (cloud) saves and P2P matches ? Will I need to use some backend server for this case ? And if yes, how can I authenticate a player logged in GPG on this backend server ? Thanks for any clues about that.


Porting to Android...what is the equivalent of Properties.Settings.Default? I'm porting my MonoGame OpenGL app to Android. My game uses Properties.Settings.Default to store user preferences. What is the equivalent of this in Android?


Advantages and disadvantages of libgdx I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. So I would like to use it if there is no big obstacle. But when I tried to see how many developers employ this library, I could find not that many. Is there anything wrong with this library? In other words, I would like to know its advantages or disadvantages from any experienced developer. UPDATE After reviewing its documentations and trying to build simple games with libgdx, I decided to go with it as its documentations are good enough and its community is very active. What I liked the most is that it provides a bunch of demo games that I can learn a lot from.


Android Jump Run Random map generation I'm pretty new to game development but I work on an android app. It's a 2D Jump and Run game. I do it in Eclipse and the map is readed out of a txt file right now. But I want to do a Jump and run game, where the player must jump over holes in the ground. Theses holes should be created randomly. So I want an infinite map, which is created randomly. Can somebody give me tips how to begin with this? How can I do a randomly generated map? I don't want the full code or something else, just a little tip how to start because I don't know how I can do this randomly generating. Thanks in advance! Hope u know, what I mean!


Why is this animation jerky? I am trying to create a simple game on android but I am unsure the best way to do the game loop. Looking at the LunarLander sample the game loop just loops like a variable time step loop (elapsed now lastupdate). I tried using this method to draw a circle that grows in size to a max radius then shrinks to a min radius and repeats. However, when I run the program the growing stage is very choppy and slow (it takes longer than it should to get to max radius). My Code public void updateSize(double elapsed) if (mGrowing true amp amp mRadius gt mMaxRadius) mGrowing false if (mGrowing false amp amp mRadius lt mMinRadius) mGrowing true if (mGrowing true) mRadius mDRadius elapsed else mRadius mDRadius elapsed mDRadius is the number of pixel the radius should change per second and elapsed is the number of seconds that has passed. I tried putting in a sleep of 2ms and 5ms in my game loop and I get the same result. I converted my loop to a fixed time step (only run physics update if now lastupdate TIME STEP) and the animation was a lot smoother. UPDATE I change the sleep to 15ms and it's a lot smoother. Every other example I've seen of an android game does not have a sleep in the main loop. Is this because my sample is just so simple that it takes virtually no time to update and all other examples just have a longer update time or am I missing something?


How would I make an air hockey AI? I am making an air hockey game for Android using AndEngine and its Box2D extension. How would I make an AI for an air hockey game? For it to work the AI would not only need to move its paddle side to side to defend but also move forward for an attack. What kind of code would I need to implement this?


HaxeFlixel, Font gets fuzzy android upscale I made a simple game for android with a small native resolution (320x480). When text gets upscaled it loses its sharpness. Tried having anti aliasing on and off and both results were fuzzy. The size of the text is 16 (read that with some fonts the size should be dividable by 8). Also tried different fonts, but had the same result. Any solutions to that?


Android Some textures not loading after resuming twice This is an odd one. When I press home and then restart my game I reload all my textures (checking glIsTexture on the id's first). If I do this once, all textures load as expected, but if I do it twice or more one of my textures doesn't load (the texture is white). I have checked glGetError and there are no errors (assuming GLES10.glGetError() is the correct way to do this) Do I need to do any tidying up when home is pressed? I currently call myGlView.onPause() and myGlView.onResume() when the onPause Resume activity events are triggered. I was under the impression that's all that's needed. Is there anything else (perhaps non openGL) that needs to be cleaned up? Perhaps I'm hitting a limit of some kind I am also using the NDK for some physics and rendering functions if that is relevant, but all resources are loaded using java.


libgdx continuous movement while touch and hold (even after jump)? So, I have these buttons where I have implemented a method to handle 'touch and hold' (without polling). If the player touches and holds the walk button ..it will keep walking till the button is released. Problem is when I combine jump with it ... In the update method, if (activeTouch) translateScreenToWorldCoordinates(touchCoords.x, touchCoords.y) if (touchPoint.x lt 5) Code for walk left else if (touchPoint.x gt VIEWPORT WIDTH 5) Code for walk Right else if ((touchPoint.x gt 6 amp amp touchPoint.x lt VIEWPORT WIDTH 6) amp amp player.isGrounded() amp amp player.getState() ! Player.State.Falling) Code for Jump The touchdown and touchup events, public boolean touchDown(int screenX, int screenY, int pointer, int button) touchCoords.set(screenX, screenY) activeTouch true return false Override public boolean touchUp(int screenX, int screenY, int pointer, int button) activeTouch false return false So i can move right,left and also jump. But my problem is, while walking if I jump ... it will jump and then stop walking. How to continue walking after the jump if the player is still holding onto the walk button?


Switching from OpenGL ES 1.0 to 2.0 I have been developing an Android app using OpenGL 1.0 for quite some time using a naive approach to rendering, basically making a call to glColor4f(...) and glDrawArrays(...) with FloatBuffers each frame. I am hitting a point where graphics is becoming a huge bottleneck as I add more UI elements and the number of draw calls increases. So I'm now looking for the best way to group all of these calls into one (or two or three) draw calls. It looks like the cleanest, most efficient and canonical way to do this is to use VBO objects, available from OpenGL ES 2.0 on. However, this would require a HUGE refactoring on my part to switch my whole graphics backend from ES 1.0 to ES 2.0. I am not sure if this is a good decision, or if there are acceptable ways to group my drawing calls in 1.0 that would work fine for relatively simple 2D data (squares, rounded rectangle TRIANGLE FANs, etc.), or if it really might be worth biting the bullet and making the switch. I might also mention that I have a HEAVY reliance on translation and scaling that is so convenient with the fixed pipeline of ES 1.0. Looking around, I am surprised to find almost NO people in my position, talking about the tradeoffs and complexity at hand for such a switch. Any thought?


Speed up loading of png files (used for textures) in Android OpenGL Game My game has a few texture atlases that need to be loaded (in my XHDPI folder they total 3.49MB) and on a top end device they don't take that long to load, however on a low end device they seem to take an age. An example would be my old Samsung Galaxy Ace which uses the MDPI folder for it's resources (total 1.51MB), this takes 16 seconds, which I personally consider far too long. Originally, I had a separate atlas for each sprite, so I merged the majority of my atlases into one big atlas after reading that it may speed things up. Unfortunately, it hasn't really made any difference to the load speed. This is how I'm loading my png files atlas BitmapFactory.decodeResource(view.getResources(), R.drawable.atlasimage) As the default load format is ARG B8888, I though I'd attempt to load them in RGB565 as this is supposed to be quicker to load and render as well as take up less memory. So I tried this BMFOptions new BitmapFactory.Options() BMFOptions.inDither false BMFOptions.inPreferredConfig Bitmap.Config.RGB 565 atlas BitmapFactory.decodeResource(view.getResources(), R.drawable.atlasimage, BMF Options) Unfortunately, although this does reduce the quality of the image, it doesn't reduce the load time and yields no noticible performance increase. Also, (and this may be expected), it doesn't reduce the memory footprint of my app. So my question is how can I optimise this so that my png's are loaded quicker (rendering speed increase not being as important at the moment as load speed).


How do I make a puzzle piece move smoothly between locations? I'm building a 2048 clone to sharpen my Libgdx skills, but I don't know how to ease a tiles between board locations. When I slide my finger, the tile moves rather swiftly. How I can make the movement smoother? This is the code I'm using to make it move to the left for(float t 0 t lt getMax(currentTile) t shapeRenderer.begin(ShapeType.Filled) shapeRenderer.setColor(230 255.0f, 220 255.0f, 230 255.0f, 1) shapeRenderer.rect(q t, r, a, b) shapeRenderer.end()


How to read monogame log files on android device I am working on a monogame android project where I want to log some data. First try was something like this Log.Info(tag, message) This works great when debugging in Visual Studio via the Android Device Logging Window. But when I run the app on my mobile android device I have no idea how to view the log entries. As far as I know the logging happens in the so called CatLog, which can be viewed with some Apps. But unfortunately these apps need root access, which I think cannot be given to them on a "normal" android device. Is there any way to either view the Logfile on my Android device or is there a better way of adding logging to my project? Thanks in advance Nick


Word Search Game Issue I am developing a game like word search. I have used AndEngine for this and for displayig grid of words I have used TiledMap. In this game, we need to join letters to make a word as we drag our fingure it will draw line on tiles and make connection between letters. I am able to draw lines vertically and horizontally accurately but as I try to draw line diagonally it goes to the nearby tile and draw line from last touched tile to nearby tile. But as I carefully move to the diagonal tiles it draws line accurately. Can any one help me to solve this issue? e.g. 1 2 3 4 5 6 7 8 9 10 11 12 as shown in above e.g. I am able to draw line for "1234" amp "159", It means all horizontal and vertical positions works accurately. But for "963" its not as accurate as i draw for horizontal and vertical. I want to draw line on one board as shown above. There will be letters below lines and need to connect correct words.


How to check in single event if two objects are clicked at the same time in libGDX? I am newbie to libGDX and I have written two functions for touchdown, LockerKeyHalfImage.addListener(new InputListener() public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) System.out.println("clickrd Locker gt gt gt gt gt gt gt gt ") return false ) MasterKeyHalfImage.addListener(new InputListener() public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) System.out.println("clickrd Master gt gt gt gt gt gt gt gt ") return false ) My problem is to check if these two images are clicked at the same time (multi touch detection). I tried to use the following lines without success InputMultiplexer im new InputMultiplexer() GestureDetector gd new GestureDetector(ui) im.addProcessor(gd) im.addProcessor(ui) Gdx.input.setInputProcessor(im) Can anyone point me in the right direction?


Max Row and Col for Animating Sprite in Andengine I want to animate a Sprite in Andengine , I have used the following this.mSnapdragonTextureRegion BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.mBitmapTextureAtlas, this,"arrow.png", 10, 10) As show above in code its array is 10x10 that means I have 100 images to be animated, here is the image (I had individual image and joined it online so I created image below) My issue is if I place this code and image it show black patch instead of animated image, i hv tried with 2x3, 4x2 animated sprite that is working fine . Is my issue because of 10x10 ? what is the max row and col I can place to animate a Sprite in Above Code Here is my output


How to decide to use OpenGL ES 1.0 or 2.0 for Android? I started learning some Android development and one of the first things I thought I could make is a simple game. However, I'm faced with one difficult question right off the bat. Should I use OpenGL ES 1.0 or 2.0? The game I have envisioned will be pretty simple graphically, utilizing 2D(tiled top down type graphics) and fixed camera isometric views. I've never used OpenGL in a desktop environment, so I'm oblivious on if shaders will be something I'll use, etc. According to this page I should use OpenGL ES 2.0 generally for new development. My own phone however just recently(past year) got an update to get it to the required Android 2.2. (I don't even know if it has OpenGL ES 2.0 support) So basically my question is, will I benefit from any of OpenGL ES 2.0's features over 1.0 and or is it worth it in terms of compatibility?


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 normally use something like a plist. What would be the best way to do something like this in Java and Android?


How can I transform a group of objects in libGDX? I'm new in LibGDX. I created group with actors in show method and add listener (where i calculate rotation matrix) and want to rotate all actors from group with batch.setTransformMatrix(matrixResult) but nothing happens. How can I force to rotate all actors of group? Override public void show() camera new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) camera.position.set(0f, 0f, 120) camera.lookAt(0,0,0) camera.near 0.1f camera.far 300f camera.update() stage new Stage() shader new ShaderProgram(vertexShader, fragmentShader) myBatch new SpriteBatch() shapeRenderer new ShapeRenderer() sphere BuildSphere(5, 100) group new Group() Override public void draw(Batch batch, float parentAlpha) batch.setTransformMatrix(matrixResult) super.draw(batch, parentAlpha) group.setTouchable(Touchable.enabled) group.addListener(new InputListener() Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) Gdx.app.log("MOUSE X BEG", Float.toString(x)) Gdx.app.log("MOUSE Y BEG", Float.toString(y)) begX x begY y return true Override public void touchDragged(InputEvent event, float x, float y, int pointer) endX x endY y isRotate true float translationX endX begX float translationY begY endY float length (float)Math.sqrt(Math.pow(translationX,2) Math.pow(translationY,2)) Vector3 axis new Vector3(0, 0, 0) if(length gt 0) if(begX endX 0) axis.x 1 else float angle (float) (Math.atan(translationY translationX) Math.PI 2.0 (translationX lt 0 ? 1 1)) axis.z 1 axis.x (float) Math.cos(angle) axis.y (float) Math.sin(angle) quaternion new Quaternion(axis, 0.02f length) Matrix4 rotation new Matrix4(quaternion) matrixResult rotation.mul(matrixRotationOld) matrixRotationOld matrixResult ) group.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) for (CenterCoordinate cenCoordinate sphere.getPolygonCenterCoordinates()) Vector3 vector cenCoordinate.getCartesianCenter() Polygon polygon new Polygon(1, cenCoordinate.getType().getCode(), cenCoordinate.getRadius(), cenCoordinate.getPsi(), cenCoordinate.getKsi(), vector, cenCoordinate.getRotation()) group.addActor(polygon) stage.addActor(group) Gdx.input.setInputProcessor(stage) Polygon extends Actor draw method Override public void draw(Batch batch, float parentAlpha) translation.setToTranslation(vertex.x, vertex.y, vertex.z) matrix.mul(translation) shader.begin() shader.setUniformMatrix("u worldView", matrix) mesh.render(shader, GL20.GL LINE LOOP, 1, mesh.getNumVertices() 1) shader.end() matrix.idt()


Any good smartphone simulators available? I'm trying to find a good smartphone simulator to test HTML5 games on. Doesn't matter if it is only 1 phone or a library of phones, iOS or android. As long as it's as close as it can get to the touchscreen experience. Any suggestions?


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 socket library? Can Unity3D can be used solely to support what I need without using other socket servers like SmartFox or Electro?


Best method for 2 layer tile based map scrolling What is the best general approach to implement scrolling for a 2D tile based game? I need to scroll the map with a constant speed, lets say 2 pixels every frame (like in a top down shooter). The tiles are 32x32 and the map is quite big, lets say 10 x 300. There are 2 layers first is the background layer second is the forgeground layer with obstacles and enemies The target plattform is android and I want to use OpenGl. What is best practice? a) Draw only the visible Screen all the time (every frame) b) Load complete map into memory and just move the camera Is there a difference in performance and determining collision etc.? Thanks for any help!


Rotate a bitmap and bitmap is getting blur in android I am developing an android game. and in this I want to move an object along a Bezier path. my object is rotating with some angle on this curve. I used this piece of code public void update() check collision with bottom wall if heading down if (droid.getSpeed().getyDirection() Speed.DIRECTION DOWN amp amp droid.getY() droid.getBitmap().getHeight() 2 gt getHeight() 2 amp amp droid.getY() droid.getBitmap().getHeight() 2 lt getHeight() 2 100 ) int pointX , pointY pointX new int 4 pointY new int 4 int X , Y pointX 0 getWidth() 2 pointX 1 getWidth() 2 50 pointX 2 getWidth() 2 25 pointX 3 getWidth() 2 pointY 0 getHeight() 2 pointY 1 getHeight() 2 25 pointY 2 getHeight() 2 50 pointY 3 getHeight() 2 100 Log.i(TAG, "In the While Zone of Last Half Zone") X (int) ((pointX 3 u u u) (3 pointX 2 u u (1 u)) (3 pointX 1 u (1 u) (1 u)) (pointX 0 (1 u) (1 u) (1 u))) Y (int) ((pointY 3 u u u) (3 pointY 2 u u (1 u)) (3 pointY 1 u (1 u) (1 u)) (pointY 0 (1 u) (1 u) (1 u))) Log.i(TAG " Value of X ", Double.toString(X)) Log.i(TAG " Value of Y ", Double.toString(Y)) double deltaX X droid.getX() double deltaY Y droid.getY() Log.i("deltaX ", Double.toString(deltaX)) Log.i("deltaY ", Double.toString(deltaY)) double angle Math.atan2(deltaY, deltaX) Log.i(TAG " Angle ", Double.toString(angle)) Matrix mtx new Matrix() mtx.preRotate((float) angle) mtx.postScale(1, 1) Bitmap rotatedBMP Bitmap.createBitmap(droid.getBitmap(), droid.getX(), droid.getY(), X droid.getX(), Y droid.getY(), mtx, true) droid.setBitmap(rotatedBMP) droid.curveUpdate(X, Y) u u 0.001 Log.i(TAG " Value of U ", Double.toString(u)) check collision with top wall if heading up Update the lone droid else droid.update() my object is moving and rotating as i supposed but image is getting blur. am not getting why is so. Please suggest what can be the problem. Thanks.


Android Live Testing I am making a game for android and in it I am using sensors which are not available in the emulator. At the moment I am connecting my device and transferring the apk, then installing to test but that is a pain to do, and I have gotten to the stage where I need to start logging values for debugging. I have gone into the run configs of my app and set it to prompt me to pick a device, but my device is never in the list when it is connected to my PC and I try to run it. How am I supposed to set it up to work properly? Thanks for the help.


Reducing APK File Size by using JPG instead of PNG for game background images I've just finished my (openGL ES 2.0 Android) game and it's almost ready for Alpha testing. When I export the application to an APK File, the file is taking up 16MB and I would like to reduce this as much as I can. Here are some points about what the project contains and what I've tried to reduce the size already 222kb of Ogg Vorbis files used for Sound Effects 1 x MP3 file at 5.59MB (128kbps Bitrate) 4 x sets of PNG files used for textures (XHDPI, HDPI, MDPI amp LDPI I'm not using XXHDPI) Just over 1MB of code What I've tried thus far to get where I am I've optimised the PNG files using Optiping I've applied ProGuard to my code before exporting, this didn't really help by much as 99 of my app is resources. So my question is, is there really much else I can do to reduce the size of the APK? I was thinking about maybe using JPG format source files for my Background OpenGL textures instead of PNG anyone have any experience with this? Does it hurt performance at all? I can see that it would make quite a difference my atlas of backgrounds in PNG format for XHDPI is 1.7MB and a 90 compressed JPG comes in at around 650KB. I'm just not sure if it's a good idea as everyone always advocates PNG JPG. Any pointers from personal experience would be helpful amp also if I've overlooked anything other than using JPG's.


Smooth pixels while rotating sprite I just started with andengine, so this maybe gonna be silly question. How to make my sprites more smooth while I rotate them? Or maybe it because this is screenshot from tablet? Thanks JohnEye it works Just need to change my BitmapTextureAtlas from BitmapTextureAtlas carAtlas new BitmapTextureAtlas(this.getTextureManager(),100, 63) to BitmapTextureAtlas carAtlas new BitmapTextureAtlas(this.getTextureManager(),100, 63, TextureOptions.BILINEAR)


Android Google play enable download app for devices that supports opengl extension I am using OpenGL ES 2 in my game. However, for simplicity i have used some extensions like VAO. Is there a way, how to disable dowloading of my app for devices, that do not support this (and other) extensions? I can check it in code, but that is a little late, when user already bought my game and it wont work.


Are OpenGL Textures more memory efficient than Android Bitmaps? I have a custom application that deals with many Bitmaps tiles that are 256x256 images (png,jpg). I'm currently using the View 2d canvas and bring in all images as RGB 565. Although I'm generally happy with the applications performance, I have features I'd like to add that will require even more map tiles (Bitmaps). I've been thinking about using opengl ES 2.0 but am fairly new to it. Would opengl Textures be more memory efficient than keeping Bitmaps around? I assume you can load a Bitmap into a Texture and then dispose of the Bitmap Is it an acceptable practice in opengl to dynamically load many different Textures at runtime? Do you need to cache Textures or does the GPU handle that for you?


Which app markets should I deploy my Android game to? I just launched my Android game today. I'm curious to know where I can deploy it. Of course, Google Play is the veritable king of markets, and my own game site will be next. After that, which marketplaces are mature and are worth deploying to? I looked at SlideMe GetJar Soc.io And some other ones that I didn't use YAAM (kept crashing and erroring out) 1Mobile (couldn't figure out how to upload my app) Insyde Market My question is really, which ones are out there and are worth uploading too? (And 1Mobile seems good, but just can't figure out how to upload.) Each site requires their own size screenshots and logo, so it's a bunch of extra work. I'd rather stick to the 80 20 rule and apply 20 effort to hit 80 of the markets.


Can a 3g network work for this project and is my understanding correct? I want to make a game for the android phone using unity. As you can tell by my last post i wanted to use networking to make this happen. I decided unity would be a good choice and in no time i was able to have two android devices connect to a simple game using unity master server and i was able to see both of my cubes update in real time over both phones. My end goal is to make a game where you are a sphere and your goal is to knock your friends off the the arena(A sumo game). The arena will slowly get smaller until only 1 sphere is remaining. My question revolves around how doable this would be with a 3g network over the phone. It does not appear that unity3d has bluetooth support for android and i could not find a plugin for it anywhere. This would be ideal to have bluetooth local networking and if i am incorrect, please tell me. The way I understand cell phone data transmission is you have your cellphone and it sends the data to the cell tower. The closer you are to the tower the better. Does your relative position to one another(Two clients connecting ) matter if you are both in range of the same cell tower? While my cubes updated just fine I know that 3g can be spotty. Is 3g viable for this idea? Is bluetooth usable for android with unity3d if not? Thank you


How do I dispose of OpenGL resources cleanly on Android? I am creating a framework for OpenGL ES 2.0 for Android. How can I cleanly dispose of my OpenGL resources when my Android app is done? I check for isFinished() in the onPause() event and then dispose of the resources but it calls the OpenGL functions from the main UI thread so it gives me an error (0x501). When I try to call isFinished() inside my onDraw() in my GLSurfaceView.Renderer class, it is never called when I quit my app. Anyone got any ideas?


Problem converting FBX file into XNB I create a Monogame Content Project to convert assets into XNB. For FBX file without texture there is no problem the file is correctly converted and when I load XNB into my project everything is ok. The problem occours when i have associated to fbx file a texture map in this case both FBX and PNG files are converted to XNB but when i try to load these XNB files into my project the following problem occours "ContentLoadException Could not load Models maze1 asset as a non content file!" Note maze1 is the XNB file that was converted from FBX. How can I solve this problem? Thank you in advance


What is the right way to implement a loading screen in cocos2d js? We have two scenes that are loaded with heavy computation a map screen and a puzzle screen. When we change the scene from A to B, the app gets stuck on scene A for a while before it renders scene B. So to avoid confusion, we created a dummy scene with 'Loading...' written on it and then on it's onEnter function we change to scene B. The game now gets stuck on the dummy loading scene now instead. But the loading scene takes in touch inputs and the device's native button inputs and triggers it as soon as scene B enters. So the map scrolls if you swipe on the loading scene and puzzle takes input on tapping the loading screen. Has anyone implemented a proper loading scene with cocos2d js?


Screen not rendering after restarting game Game works fine on the initial launch on Android, but after that restarting game does not render the graphics on the screen properly. It is a copy of the question Sprites not being rendered on screen change Android Libgdx but there is no solution yet for the question


Keeping Android Screen bright during Game I have a game that uses the accelerometer to move a guy back and forth on the screen. After a few seconds the screen goes dim. Is there any way to keep it alive and bright during the game activity?


Cocos 2D putting things on the cocos thread or not? We are using Cocos 2D for Android and are unsure if it's a good thing to execute our non ui tasks on the Cocos thread as a way to get the animations in our game to pause. What is the recommended practice?


Location of drawables Is it possible to get the location of a drawable in Android Studio? Example drawable.getLocationonScreen() I want to use it for collision detection.


Is it worth planning to be cross platform in mobile game development? Disclaimer my goal is not to use cross platform frameworks like Unity. I am currently planning a mobile game which I intend to first launch on iOS. However, I am wondering if it is better to write everything in Objective C, thus locking the code into the platform, and to do a complete rewrite for other platforms (ie Android). The other option would be to write the game logic in C or C and to only write the code that interfaces with each OS in the preferred language (Objective C( ) or Java). I understand that this must depend on the size of the code base, so what program size should mark the separation? Finally, if I write cross platform code, should I stick to C (since Objective C is a superset of C, making it easy to use C and to use the code samples and because the NDK and the JNI interfaces are more C oriented)? The only advantage I see with C in that case is the fact that it is object oriented and thus it is easier to represent game entities).


Flash Professional vs FlashBuilder 4.6 for mobile app development From the marketing materials I see online, it seems to me that FlashBuilder 4.6 is a subset of the functionality available in Flash Professional. If I understand correctly, mobile app development target iOS and Android started as a plugin for Flash Pro and has since been made a separate product. But can Flash Pro still do all the multi platform targeting that FlashBuilder 4.6 can do? What other considerations are there between the two applications that are critical to understand for mobile app development? Thanks!


Really weird peaks when profiling a simple scene with Unity3D I need some help optimizing my game. I have spent last 3 days digging around with no luck. I have noticed really odd results in the unity profiler so, I have created a simple scene with just a cube and a camera, and again, really odd results. Could anybody have a look at this screenshots? You will see some significant peaks that make the frame time too high (30fps sometime or less). Scene hasn't any script, no coliders, no rigid bodies (notice the Physics simulate in one of the shots). Could anybody explain what is happening? PD. Target platform is Android. This are taken from a Nexus 4 device. PD2. Somebody can argue that this is not a real scenario, but I have had this problems in a real game myself and wanted to show a simple example to expose the problem. Thanks in advance.


Android Action Move when moving between specific screen areas OK so I know how to iterate through the different pointers that are currently touching the screen so I know what the coordinates are of these pointers using the following Code snippet case MotionEvent.ACTION MOVE Count through all the pointers currently touching the screen for(int index 0 index lt event.getPointerCount() index ) Is finger on the left button? If so, then go (or continue going) left if (event.getY(index) gt renderer.leftButton("top") amp amp event.getX(index) lt renderer.leftButton("right")) renderer.setSpritewState('l', true) renderer.setSpriteState('r', false) Or is finger on the right button? If so, then go (or continue going) right else if (event.getY(index) gt renderer.rightButton("top") amp amp event.getX(index) gt renderer.rightButton("left") amp amp event.getX(index) lt renderer.rightButton("right")) renderer.setSpriteState('l', false) renderer.setSpriteState('r', true) break However, this is constantly triggering one of the two conditions I guess as it's picking up minute movement of the finger s. And, more importantly, if there is a finger on each 'button' the sprite goes a bit crazy as each condition fights with the other and constantly flags the sprite to move left and then right etc. What I'm really after is this something like this So, if a finger moves within a specified area, nothing happens as it's counter productive. But if a finger moves from one area to another, then the action is triggered. I'm guessing the code for this would need to save the old position of each of the fingers to compare to the new positions, but I'm not really sure how to go about this. Help would be appreciated. Thanks.


Drawing and rotating bitmaps (with transparency) efficiently in Android I just started making a game for Android and I'm already having some issues regarding performance. You can imagine the game as being some kind of Tower Defense game with a top view, and the enemies can move in all directions, so I need to be able to make the sprites rotate in all directions. I'm currently using a sprite sheet with transparency for the enemies and using canvas.rotate() to make all the enemies face a given target. When there are 60 enemies on screen, it takes about 25ms to rotate and draw the enemies, but if I remove the rotation part, it takes about 7 ms. In itself, it doesn't seem too bad, but there are going to be many more enemies at once on screen eventually, with projectiles, other entities, etc. and I'm drawing the background tile by tile (around 80 tiles), so that's 80 more bitmaps to draw, although at the moment it's only 4 different bitmaps being drawn multiple times. Here is part of the code that draws and rotates the enemies In the "render" method in a SurfaceView, called in the gameloop for (Enemy enemy level.getListEnemies()) if (enemy.isVisibleInView(level.getCamera(), screenWidth, screenHeight)) enemy.draw(level.getCamera(), level.getAngle(enemy), canvas, paint) Enemy.draw public void draw(Camera camera, float angle, Canvas canvas, Paint paint) float x1 this.getPosX() level.getCamera().getOffSetX() this.getSizeX() 2 float x2 this.getPosX() level.getCamera().getOffSetX() this.getSizeX() 2 float y1 this.getPosY() level.getCamera().getOffSetY() this.getSizeY() 2 float y2 this.getPosY() level.getCamera().getOffSetY() this.getSizeY() 2 Rectangles declared in the constructor, change depending on which frame to draw drawingLocation.set((int) x1, (int) y1, (int) x2, (int) y2) imageSubset.set((int) (frameId getSizeX()), 0, (int) (frameId getSizeX() getSizeX()), (int) getSizeY()) canvas.save() canvas.rotate(angle, x1 sizeX 2, y1 sizeY 2) canvas.drawBitmap(knightAttack, imageSubset, drawingLocation, paint) Heath bars paint.setColor(Color.RED) canvas.drawRect(new Rect((int) x1, (int) (y2) 10, (int) x2 10, (int) y2 14), paint) paint.setColor(Color.GREEN) canvas.drawRect(new Rect((int) x1, (int) (y2) 10, (int) (x1 (((x2 10) x1)) this.currentHealth this.maxHealth), (int) y2 14), paint) canvas.restore() Change frame in the image every SPRITEFRAMELENGTH if(frameCount SPRITEFRAMELENGTH 0) frameId if(frameId gt MAXFRAMEID) frameId 0 frameCount 0 Those times I mentionned earlier are by using SurfaceView.getHolder().setFormat(PixelFormat.RGB 565) And creating the images (once, all the enemies use the same image reference) BitmapFactory.Options op new BitmapFactory.Options() op.inPreferredConfig Bitmap.Config.RGB 565 Bitmap image (Bitmap)BitmapFactory.decodeResource(context.getResources(), imageId, op) if(resizeWidth ! 0 amp amp resizeHeight ! 0) image Bitmap.createScaledBitmap(image, resizeWidth, resizeHeight, true) But I noticed that if I don't specify RGB 565, it is much slower because of transparency, especially for the background, which don't have transparency. What's even weirder is that using RGB 565 works properly on my Galaxy Nexus, but on my friend's S3, some images (with transparency) are not displayed at all. I'm using 4.2.1 and he's on 4.1.1. So, how can I rotate my images more efficiently? Would using OpenGL improve performance a lot or would it be about the same? Is there a better solution?


Multiplatform game, save game state and resume it on other platform This is for a personal and knowledge acquiring project. I want to create a little TIC TAC TOE multiplatform game, app amp web. The choosen technology for the app will be Android or Flutter and for the web Angular. My doubt is, during a game if the user wants to change from the mobile version to the web version, how to resume or change the game to the web application? What would be the best way to save the game state and load it into the other platform? Having in consideration that the user will play only in one platform at a time, which is the best way to implement this restriction too? Is this as simple and hard at the same time as implementing all controls in both platforms and storing all the data required in the database?


Make LibGDX game responsive to different phone screen sizes? I've been experimenting with small games to learn design concepts, LibGDX, and Box2D. I am wondering how you would implement "responsiveness," so to say. For example, this is the rendering part of my game and its just drawing to coordinates. https github.com Elsealabs Stacker blob master com elsealabs stacker ScreenGame.java For example I'd like it to look good on Android phones of different resolutions or if the user resizes it on desktop. I am asking about design patterns or practices that would make this possible. Any solutions I can think of seem like they wouldn't scale or would over complicate the game. If you know of any articles or design practices that cover this topic, or have any of your own knowledge, or example LibGDX Java games, I'd love to see them.


How to get asset folder path in android native activity? I am trying to create a small game with android native activity. I wish to load textures using stb image. I don't know how to get the path to assets folder. Is there any API to get path to apk directory so that I can use that to get textures? Thanks.


Acceptable sound quality stereo needed for an Android game? I have various simple short sound effects (damage sound, dying sound, thunderbolt, fanfare, breaking) for a game that is developed for Android currently. I use OGG files 96kbps VBR, 44.1KHz, 2 channels (that means stereo, right?). I read the other stackexchange topics about "acceptable sound quality", but they're too general, address too many things. My experience is that even with 80kbps, my effects sound OK. But I tested it on a limited number of Android devices (including a Sony Ericsson Xperia Neo and a HTC Desire HD). My questions For mobile phones and tablets, generally, what parameters are recommended? Won't my 80kbps sounds be bad on a newer device (such as a modern tablet)? I don't hear any difference between stereo and mono (2 channels vs. 1 channel, right?), is there any noticeable difference at all for mobile phones tablets? (in terms of the player experience) May it worth it at all? I assume that stereo sounds take much more in memory (when they're decoded to PCM), despite of the fact that the compressed OGG size is practically the same. Reacting to Roy T.'s great comment Actually, I couldn't measure the PCM size (Android decodes OGG internally), but I thought that stereo will take more space than mono when uncompressed After throwing out one of the WAV channels in Audacity, and re exporting it The new WAV file size is half than before The OGG file size is practically the same as before The sound effects and game music was recorded by my friend who is an experienced hobby musician composer, but he knows little about computers amp software so he just gave me some high quality WAV files generated via his hardware.These were stereo, but if I check them in Audacity, both channels appear to be exactly the same.Can I consider them the same ( moving to mono), or might there be some unnoticeable differences to the human eye?


OUYA Developer Kit throws various errors on start I followed these instructions for Mac OS X using an existing IDE (shell text editor) instead of the Eclipse ADT thingy. I activated Use Host GPU , and installed Intel HAXM. Installing the ouya framework.apk and ouya launcher.apk appears to go well. But when I start up my AVD there s a dialog box saying Unfortunately, the OUYA Launcher has stopped. , I still get the choice of starting up the OUYA Launcher. When I do so there s another dialog box saying Can t play this video . I skip the controller settings, and then there s a JOIN A WIRELESS NETWORK screen which I can t get past. This is the ODK 1.0.2, and I tried it using both Mac OS X 10.8.3 and 10.7.5.


How can I save my game state so it can be resumed when my application resumes? I've found that after resuming my game the whole engine is reloaded and application is reinitialized. I want to save engine state and in "onResume," resume the game process from where it left off. I've tried to save the engine (mEngine) and then after resume the game in "onLoadEngine" return saved engine. I think it is a bad solution and it doesn't work anyway. What is the best solution for resuming my game (after the power key was pressed, for example) in AndEngine ?


Can I use real currency name symbol as an in game currency? Can I use a real currency name (i.e USD, PKR) or symbol ( , Rs.) for my in game currency with the same exchange value as original currency? I couldn't find anything about it in google play store policies neither in government websites. Of course I have other options, I can call it gold or silver etc but I'm just wondering if it is allowed or not.


Any open source game engines for Android? Is there any open source android gaming engine ?


How to create a splash (loading) screen in cocos2d for Android? How to create a splash (loading) screen in cocos2d for Android? I need a loading screen that shows my app name and after that the next scene will show automatically. Thanks


How well does Unity 3d work for both Android and iPhone? First off this question might be a bit broad so I apologize if it is. I am really just looking for peoples experiences and personal knowledge on the subject. I am looking to create a game for both Android and iPhone platform. I know Unity is a great game engine and my question is how well does it work for creating one code base to build for both Android and iPhone platforms? Time is a constraint on this project so I am very interested in how smoothly the process usually is when trying to build both applications and how much custom code must be written for each specific application. Any insite that people have on this topic would be much appreciated thanks.


Game Loop delay the right way and game speed I am a newbie game developer. I am trying to find a right way to create my game loop. Consider following example. Simple Android Game I have a game with a simple gameplay bouncing ball. I want to have a control of the ball speed. Also I want my game to have the same framerate (framespeed) on all devices. Where the speed logic should be implemented ? In my case I have simple ball object with a velocity vector. I can change the velocity vector properties in order to make my ball move faster or slower, am I right ? The Main Loop. I have read a lot of about this part of a game. I found this article http gameprogrammingpatterns.com game loop.html . And decided to use this code example double previous getCurrentTime() double lag 0.0 while (true) double current getCurrentTime() double elapsed current previous previous current lag elapsed processInput() while (lag gt MS PER UPDATE) update() lag MS PER UPDATE render() I have a lot of questions about this example. I have the similar loop in my game. Override public void run() while (mIsRunning) processGameInput() updateGameState() drawGame() I cannot understand while update() is called while waiting for a constant delay ? Why not the render method ? Maybe I am missing something. Here is how my update for the ball looks like. public void updatePosition() mCenterX mVector.x mCenterY mVector.y As you could see, each time I increase the position of the ball by the value of the velocity vector. But as can guess, in case of using the example from the article, the update method will be called for instance 100 times. And the render method only once per 100 update method calls. So in this case I guess, I the ball will be changing its position lagging. My goal is to control the speed of the ball, for example from 0.1s 2s. How can achieve this ? Please help to understand this topic. Any help would be highly appreciated.


How do I get and install the Android SDK on my Ubuntu OS? I heard that it would be a lot easier to do java type games and then move on to Android gaming? I AM a total beginning but with motive and I have been reading about it from several sources, including similar questions on this site alone. But I need to know specific things from experienced users. As for getting the SDK and Eclipse on the computer, I'm having trouble with it, I am running Ubuntu btw so exe files are useless. But I have tired terminal use but I kind of failed because I don't think the SDK and Eclipse are installed, just downloaded. Ubuntu users especially, I can use help from you seeing how complicated Ubuntu can be compared to windows "click install" setups. Also if you guys really suggest me learning Java first (which is still a big question cause I don't want to waste time with something I don't want to really use, but getting the feel of gaming is pretty important I know) I am looking at this tutorial http zetcode.com tutorials javaswingtutorial And it talks about using swing toolkit, but idk how to get that exactly, I tried searching. Sorry for the noobness, but gotta start somewhere and I'm new to this site so I'm really hoping you guys can really help me. I want to make simple games to put on the android market, and then advance. So going to the tutorial above, it just kind of starts with giving me coding and whatnot which is fine, just copy it but idk where exactly to do all this on (Swing toolkit?) so I can't even start with that. But really I want help getting this SDK and Eclipse plugins on my computer and then I can continue with this guide www.rbgrn.net content 54 getting started android game development Which is the main guide that I probably should follow, and would be great if some expert skims it a little at least to see if I should start with that guide and skip the java. But again, I'm stuck on the SDK stuff. Sorry for the long questions, I am new and I really want to get out of this beginner stage, it's the worst part. Tank you to all and if you want my facebook or AIM to help me through with IM to at least get this SDK and stuff installed fine with Ubuntu OS, ask please (


How do I scale room transition surfaces to fit mobile display? I followed a tutorial on how to add a left swipe room transition, which works very well. My problem is that it won't scale to my Android display. I know that it's being drawn to the GUI layer and I've tried resizing the GUI to the display width and height but I didn't see any changes. It's a really nice effect that I want to get working for my game. Create Event currentframe 0 maxframes 45 persistent true when changing room keep this object alive copy the old room so we can display it on the second room sur oldroom surface create(room width,room height) surface copy(sur oldroom,0,0,application surface) We have recorded what the old room looks like so we can instantly go to the next room. room goto(rm game) Destroy Event surface free(sur newroom) surface free(sur oldroom) Step Event currentframe if (currentframe gt maxframes) instance destroy() The transition has finished so destroy it We are now on the second room so record that room. if (currentframe 2) sur newroom surface create(room width,room height) surface copy(sur newroom,0,0,application surface) Draw GUI Event if (currentframe gt 1) convert the number of frames that have passed into a number between 0 and the room width var slideamount EaseOutQuad(currentframe,0,room width,maxframes) if (surface exists(sur oldroom)) draw surface(sur oldroom, slideamount,0) if (surface exists(sur newroom)) draw surface(sur newroom,room width slideamount,0) I do this to hide the flicker where the next room pops up for 1 frame if (currentframe 1) if (surface exists(sur oldroom)) draw surface(sur oldroom,0,0) I'm using Game Maker Studio 1.4.


Ground for 2D AndEngine game with physics I am using AndEngine to create a 2D Game for Android platform using Java and AndEngine. I have learned how to use Tiled editor to create tiled maps. The only problem I am having is that I don't know how to place an object such as a character on the ground, and have it count as the ground. How do I go about doing this or what is the best way to do this?


Getting the height of Keyboard on Android Hi I need to know the height of my keyboard so I can move up some textfield I have in my app. I'm using cocos2D X but the app don't recognize the keyboardWillShow method. Thanks


Why does my game freeze when I try and display a menu? I make a MenuScene when my Game loads, which grabs some intro text from levelData and displays it and a button to start playing the level. When the MenuScene is created and displayed in onLoadComplete() it's fine. However when I display it again when advancing the level (levelData is loaded with new data and the MenuScene reset) it freezes, showing the game at the point the level was beaten. The menu is not displayed at all. I'm just calling loadIntro() this.mScene.setChildScene(this.mIntroScene, false, true, true) this.mEngine.stop() to display the MenuScene (the same both times, it works the first time but not the second), where loadIntro() is private void loadIntro() this.mIntroScene new MenuScene(this.mCamera) final TextMenuItem intro new TextMenuItem( 1, mFont, levelData.getIntroText()) intro.setBlendFunction(GL10.GL SRC ALPHA, GL10.GL ONE MINUS SRC ALPHA) intro.setSize(400, 150) this.mIntroScene.addMenuItem(intro) final SpriteMenuItem startMenuItem new SpriteMenuItem(MENU START, this.mMenuStartTextureRegion) startMenuItem.setBlendFunction(GL10.GL SRC ALPHA, GL10.GL ONE MINUS SRC ALPHA) this.mIntroScene.addMenuItem(startMenuItem) this.mIntroScene.buildAnimations() this.mIntroScene.setBackgroundEnabled(false) this.mIntroScene.setOnMenuItemClickListener(this) What am I doing wrong?


How do I handle user input with good class structure architecture for an Android game? How do I handle user input having quot good quot class structure and following normal game architecture ?(see below). At first I didn't think this question was Android specific, although, after seeing a great response in C I would appreciate some insight on this question using Android architecture. Current way I handle input for my Android Game Created controller class that takes X,Y screen events and X,Y character position and returns an int that represents a direction the character should move. Call the controller method in the game's update. Send that direction value to my character update. Character's update calls move (which is also passed this value). Basic switch statement determines the direction my character moves. Getters and setters for the position of the character.(should I have them for this direction also) Is there a better way of handling input? This doesn't feel like the best way. Where does input fit in with class structure and game architecture? I'm going to accept the C answer but I would really like to see a Java answer for Android in the future. D


Make paid app free for specific user Is it possible for me as an developer owner of my paid app (released on the Google Play market) to unlock its full version for specific user?


Make a 2D character stop moving and going back when encounter an obstacle I am using a 2d character who is sliding infinite ( huge incrementation of the X or Y value ) when moving. He can only move up, down, left, right inside a virtual grid, made of multiple squares. Now I want to add obstacle to stop his sliding and make him go back to the center of the previous square The obstacles can be of different size and are located in the center of a square, so the collision occurs with the obstacle and NOT when the character enter the square containing this object ! How can I manage to stop the incrementation of X or Y when colliding ? And get the previous value of X or Y for which the character was on the center of the square just before the one containing the obstacle. Thank you everybody ! I am not certain to have the good reasoning. Actually I was thinking about something like that Lets say each square is 5 5 and each square center is at X 5 from the previous square center and X 5 from the next. I was thinking about a loop which is moving the character from 5 on the X axis and checking if there is a collision. If yes, the character goes back to the previous square center, if not, the loop keep going. So assuming that my character is in ( 0 0 ) coordinates and the obstacle is in ( 20 0 ) coordinates ( but not filling the square ), my character will be in ( 5 0), then ( 10 0 ), then ( 15 0 ), then it will collide with the object in ( 18 0 ) ( because the object dont match exactly with the square size, considering the fact that on object can be 3 3 and just drop on a 5 5 square ), and the character will go back to ( 15 0 ). With this reasoning is the movement of my character going to be smooth ( like a slide ) or is it going to be square by square ? if checking the collision BEFORE moving, is my character going to move from ( 15 0 ) to ( 18 0 ) and bounce back to ( 15 0 ) or is it just going to stay in ( 15 0 ) ? because I would like to have my character to move smoothly AND bouncing back when colliding ! Thank you


Android Synchronizing timers across multiple devices Im writing a turn based multiplayer game that implements a chess timer. When the current players turn starts, all devices start timing for the current player, however, as his turn proceeds, the timers fall out of sync, and at the end of his turn(say for example he took 1 minute to make a move) his time on the other players devices are sometimes up to 10 seconds ahead or behind. I understand theoretically its impossible to time sync devices down to the millisecond, but if i can get it atleast within a second, that will work just fine. I tried the following the try overcome this Sync time across devices at the beginning and end of current players turn. Sync time whilst it is current players turn. Combination of the two. The problem with these attempts is that they cause a lot of flickering on the clock, and, at the end of the turn, when other players see the current players time increasing by 5 10 secs, they feel cheated, and it just doesnt look good. Newbie here so be gentle with your responses )


Develop a 2d isometric mobile game on Flash I'm building a game on Flash that will run on web Android iOS. The game is 2d isometric.I heard that developing mobile apps on Flash sucks and the graphics looks just awful.It'd be quite uncomfortable to write code for every platfrom separately.What would you guys recommend stay with Flash or some other platform? By the way,do i need to build the game specially on MAC so that i can later port it on iOS? Thanks


How do I implement tilt controls that work even when the device is not vertical? I'm using libGDX to develop an Android game. The main character can be moved freely in the 2d plane by tilting the phone. The relevant part of my current implementation looks somewhat like this Vector2 mainCharacter float speedX, speedY public void render(float delta) speedX 0.6f speedX 0.4f Gdx.input.getAccelerometerX() speedY 0.6f speedY 0.4f Gdx.input.getAccelerometerY() mainCharacter.move(speedX, speedY) This simple implementation works quite well as long as the player sits or stands upright. But there are two situations where this approach fails If the player holds his phone almost horizontally (e.g. if he lies in bed, see fig. 1). Neither the computation of speedY nor the computation of speedX works properly in that situation. Inside a moving vehicle. When the vehicle speeds up or slows down, this has a strong impact on the values returned by Gdx.input.getAccelerometerX Y. So my question is Is there anything that can be done to solve these two problems? How can I get satisfying results independent of whether the player is lying, standing or sitting? And is there a reasonable way to reduce the influence that the movement of a vehicle has on the output of the accelerometer? fig. 1


Libgdx Hud with two stages I have an app that's currently working with a single stage but i need to add a side display section as a HUD, with scores lives etc on it, so that the HUD is on the left, and the main hand screen on the right. The main game screen will be fixed and will not move around. From researching I've found a couple of solutions. 1 two stages 2 a group with two groups to it, possibly using a horizontalgroup 3 two cameras one stage 4 one stage, one camera, but changing the position of the camera for each set of actors. I think, option 1 is my preference, but i have some questions. Do stages always fill the whole screen, or can i start then where i want? This would make it easier for the right hand screen to calculate positions based on 0,0 of that screen rather than always having to add the width of the HUD on to any calculations. Do i need to work about viewports? Currently I'm not using one (which i think means my stage is set to scaling by default) but nothing looks stretched as a result of this. I don't know much about viewports, but there always seems to be a compromise to be made with them, i.e. black bars top or sides. If I have two stages, do they each have their own camera? Do I need to with about this? Can I possibly aim the right hand camera at an offset so i can still draw things from 0,0 with that being the bottom left corner of the right stage, not the whole screen? Finally, off topic, I am a little confused about spritebatch. I'm not currently using one, because I use a stage. Is that OK, or should i still be using one in conjunction with a stage somehow? And add all my actors to that?


Sign APK of several games with same or different key? When you choose a key for signing your APK for publishing in GooglePlay, you need to care of this key for the next 25 years if you want to do updates. The key should not be shared with anyone. The key should not be lost. If you do several games, you face the question of having your key DeveloperName and sign all games with it, or have multiple keys like DeveloperName GameOne for one game, DeveloperName GameTwo for another, and so on. Google says here http developer.android.com intl es tools publishing app signing.html that if you sign several APPs with the same key, they may talk to each other. So it seems that having all with one key will allow future interoperability between games easier. Instead, if at some point someone wants to buy you one of your games, but not the other, you don't want to give the keys to the non sold games but still you don't want the buyer to break the update flow. So it seems that having each game with a different key is better. Question 1 What exact benefeits will one have if one signs 2 games with the same key? Is that necessary? Is that worth for future interop between games? Question 2 What is the correct practice for an indie doing several games regarding the signature of them?


Keeping track of onscreen objects in opengl es on Android In a small game Im working on I was able to implement ray picking with an opensource 3d engine called min3d but I cant figure how to keep track of what object is onscreen. I will some times have upwards of 120 objects to render within my scene and the raypicking is off occasionally. What id like to do is keep track of how many screen objects are within the camera and being rendered onscreen and set a boolean value based on that to add or remove objects from my arraylist I iterate through when the screen touch is registered and the ray picking method goes off. So how can I check for which objects are onscreen and offscreen in opengl es on android.


Specific Physics Lessons and Reference for Game Development What "Physics stuffs" should I learn in game developments? I'm reading about Verlet Integration, and I'm wondering what other lesson should I learn and if there are available resources can you please provide some link or anything. Thanks.


How do I get an Android device's screen size in exact pixels? On every single android device emulators from ldpi to xxhdpi, both DisplayMetrics and native JNI EGL return width 320 and height 526. Even on actual HTC ONE mobile it returns something like 320x526. This is annoying. I need to know the exact pixel dimensions of the GL rendering surface framebuffer renderbuffer etc . How can I do that ? From Java activity class I am doing DisplayMetrics metrics getResources().getDisplayMetrics() int widthPixels metrics.widthPixels int heightPixels metrics.heightPixels From the JNI C code I am going following with NO luck (again output Size 320 x 526) int W, H EGLDisplay display eglGetCurrentDisplay() EGLSurface surface eglGetCurrentSurface(EGL READ) eglQuerySurface(display, surface, EGL WIDTH, amp W) eglQuerySurface(display, surface, EGL HEIGHT, amp H) LOGI("JNIGlue.cpp Init EGL Width d", W) LOGI("JNIGlue.cpp Init EGL Height d", H) glGetRenderbufferParameteriv(GL RENDERBUFFER, GL RENDERBUFFER WIDTH, amp W) glGetRenderbufferParameteriv(GL RENDERBUFFER, GL RENDERBUFFER HEIGHT, amp H) LOGI("JNIGlue.cpp Init RB Width d", W) LOGI("JNIGlue.cpp Init RB Height d", H) So how do I get the exact OpenGL rendering surface buffer size ?


Advantages and disadvantages of libgdx I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. So I would like to use it if there is no big obstacle. But when I tried to see how many developers employ this library, I could find not that many. Is there anything wrong with this library? In other words, I would like to know its advantages or disadvantages from any experienced developer. UPDATE After reviewing its documentations and trying to build simple games with libgdx, I decided to go with it as its documentations are good enough and its community is very active. What I liked the most is that it provides a bunch of demo games that I can learn a lot from.


Sprite Animation in Android with OpenGL ES How to do a sprite animation in android using OpenGL ES? What i have done Now I am able to draw a rectangle and apply my texture(Spritesheet) to it What I need to know Now the rectangle shows the whole sprite sheet as a whole How to show a single action from sprite sheet at a time and make the animation It will be very help full if anyone can share any idea's , links to tutorials and suggestions. Advanced Thanks to All