Counting multiple touches using Cocos2dx 3.2 I'm trying to count the number of active touches in screen in order to perform an an action in case that there are two touches auto jumpListener EventListenerTouchAllAtOnce create() jumpListener gt onTouchesBegan (const std vector lt Touch gt amp touches, Event event) CCLOG("Multi touch detected d", touches.size()) if(touches.size() 2) this gt player gt jump() But even if I'm touching with two fingers, I get that only 1 touch has been made, any suggestions?


Android Swipe In Unity 3D World with AR I am working on an AR application using Unity3D and the Vuforia SDK for Android. The way the application works is a when the designated image(a frame marker in our case) is recognized by the camera, a 3D island is rendered at that spot. Currently I am able to detect when which objects are touched on the model by raycasting. I also am able to successfully detect a swipe using this code if (Input.touchCount gt 0) Touch touch Input.touches 0 switch (touch.phase) case TouchPhase.Began couldBeSwipe true startPos touch.position startTime Time.time break case TouchPhase.Moved if (Mathf.Abs(touch.position.y startPos.y) gt comfortZoneY) couldBeSwipe false track points here for raycast if it is swipe break case TouchPhase.Stationary couldBeSwipe false break case TouchPhase.Ended float swipeTime Time.time startTime float swipeDist (touch.position startPos).magnitude if (couldBeSwipe amp amp (swipeTime lt maxSwipeTime) amp amp (swipeDist gt minSwipeDist)) It's a swiiiiiiiiiiiipe! float swipeDirection Mathf.Sign(touch.position.y startPos.y) Do something here in reaction to the swipe. swipeCounter.IncrementCounter() break touchInfo.SetTouchInfo (Time.time startTime,(touch.position startPos).magnitude,Mathf.Abs (touch.position.y startPos.y)) Thanks to andeeeee for the logic. But I want to have some interaction in the 3D world based on the swipe on the screen. I.E. If the user swipes over unoccluded enemies, they die. My first thought was to track all the points in the moved TouchPhase, and then if it is a swipe raycast into all those points and kill any enemy that is hit. Is there a better way to do this? What is the best approach? Thanks for the help!


how to do sprinkle effect of water in opengl in android? I want to achieve sprinkling effect of water in android using opengl. so, do i need to achieve it with graphics? is there any other way to do it using opengl? or how can i start working on this,any links?


Box 2d Level Editor for AndEngine I am getting started with Box2d in AndEngine. I need to know if there is any level editor to be used with box2d and gives output capatable with AndEngine. Is there any tool which can help me building complex body with joints like a bike or car? What do you suggest which is the best way to do this kind of stuff.


What should I keep in mind when making 2D games for multiple resolutions? I'm making a 2D (Android) game. Android devices vary quite a lot in screen resolution what do I need to keep in mind when making my game? Do I need to keep big versions of all images and scale down depending on the resolution (doesn't that waste space)? Do bitmap fonts scale well or do I need to use something else? Anything else I'm forgetting?


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.


Extrapolation breaks collision detection Before applying extrapolation to my sprite's movement, my collision worked perfectly. However, after applying extrapolation to my sprite's movement (to smooth things out), the collision no longer works. This is how things worked before extrapolation However, after I implement my extrapolation, the collision routine breaks. I am assuming this is because it is acting upon the new coordinate that has been produced by the extrapolation routine (which is situated in my render call ). After I apply my extrapolation How to correct this behaviour? I've tried puting an extra collision check just after extrapolation this does seem to clear up a lot of the problems but I've ruled this out because putting logic into my rendering is out of the question. I've also tried making a copy of the spritesX position, extrapolating that and drawing using that rather than the original, thus leaving the original intact for the logic to pick up on this seems a better option, but it still produces some weird effects when colliding with walls. I'm pretty sure this also isn't the correct way to deal with this. I've found a couple of similar questions on here but the answers haven't helped me. This is my extrapolation code public void onDrawFrame(GL10 gl) Set Re set loop back to 0 to start counting again loops 0 while(System.currentTimeMillis() gt nextGameTick amp amp loops lt maxFrameskip) SceneManager.getInstance().getCurrentScene().updateLogic() nextGameTick skipTicks timeCorrection (1000d ticksPerSecond) 1 nextGameTick timeCorrection timeCorrection 1 loops tics extrapolation (float)(System.currentTimeMillis() skipTicks nextGameTick) (float)skipTicks render(extrapolation) Applying extrapolation render(float extrapolation) This example shows extrapolation for X axis only. Y position (spriteScreenY is assumed to be valid) extrapolatedPosX spriteGridX (SpriteXVelocity dt) extrapolation spriteScreenPosX extrapolationPosX screenWidth drawSprite(spriteScreenX, spriteScreenY) Edit As I mentioned above, I have tried making a copy of the sprite's coordinates specifically to draw with.... this has it's own problems. Firstly, regardless of the copying, when the sprite is moving, it's super smooth, when it stops, it's wobbling slightly left right as it's still extrapolating it's position based on the time. Is this normal behavior and can we 'turn it off' when the sprite stops? I've tried having flags for left right and only extrapolating if either of these is enabled. I've also tried copying the last and current positions to see if there is any difference. However, as far as collision goes, these don't help. If the user is pressing say, the right button and the sprite is moving right, when it hits a wall, if the user continues to hold the right button down, the sprite will keep animating to the right, while being stopped by the wall (therefore not actually moving), however because the right flag is still set and also because the collision routine is constantly moving the sprite out of the wall, it still appear to the code (not the player) that the sprite is still moving, and therefore extrapolation continues. So what the player would see, is the sprite 'static' (yes, it's animating, but it's not actually moving across the screen), and every now and then it shakes violently as the extrapolation attempts to do it's thing....... Hope this help


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.


ANDEngine 3d rotation in Particle System Im using ANDEngine and wants to create confetti particle system. But im unable to make flipping and rotation of confetti particle around z axis Since andengine is 2d engine, it doesnot support that. However like in the following example , 3d rotation has been implemented for a single sprite http code.google.com p andengineexamples source browse src org anddev andengine examples Rotation3DExample.java I want to do this for the particles. Am i missing something ? or do i hv to modify the particle system code.


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?


android game how to approach mutliplayer I'm making a single player game that is near completion, and I am already starting to think about giving the game multiplayer. The multiplayer would basically be finding someone to play against, likely in a waiting room or just have a match making function, and then having a pokemon style battle between the people in real time. I think it would be relatively simple as I'm just sending information about each attack(move chosen and damage) and what it did back and forth, but I'm not sure what resources to consult for this. I am very new to Android Java development and really just learning as I go. I have heard a bit about Skiller, but I'm still unfamiliar with using other SDK's and how easy it may be. Does anyone have any suggestions as to what SDK's or methods for accomplishing this. I currently have no money to spend on software development, but I'd like to get started on learning how to do this.


Export Blender 3D animation to be played by Android OpenGLES Below code snippet shows the way to export coordinate of bones def export bone matrix(armature, bone, label, file handler) SystemMatrix Matrix.Scale( 1, 4, Vector((0, 0, 1))) Matrix.Rotation(radians(90), 4, 'X') if (bone.parent) Export babylon.write matrix4(file handler, label, (SystemMatrix armature.matrix world bone.parent.matrix).inverted() (SystemMatrix armature.matrix world bone.matrix)) else Export babylon.write matrix4(file handler, label, SystemMatrix armature.matrix world bone.matrix) I have create a 3D character in Blender, and add keyframes in it by transforming in some frames. From the graph editor, you can easily tell the all displacement of transformation translate, rotate, scale are all measured with respect to the original value in frame 0. Is it possible to write OpenGL in Android to animate the same 3D animation in Blender? I'd like to transform the 3D character translate, rotate in each frame according to the displacement value exported from Blender. Below lists the python function to export translate, rotate displacement in each frame def get bone action location(action, bonename, frame 1) loc Vector() if action None return(loc) data path 'pose.bones " s" .location' (bonename) for fc in action.fcurves if fc.data path data path loc fc.array index fc.evaluate(frame) return(loc) def get bone action rotation(action, bonename, frame 1) rot Quaternion( (1, 0, 0, 0) ) the default quat is not 0 if action None return(rot) data path 'pose.bones " s" .rotation quaternion' (bonename) for fc in action.fcurves if fc.data path data path and frame gt 0 and frame 1 lt len(fc.keyframe points) rot fc.array index fc.evaluate(frame) return(rot) Or I need to transform the meshes with vertex group controlled by root bone by the transform matrix SystemMatrix armature.matrix world bone.matrix? And for those controlled by child bones by the matrix in terms of (SystemMatrix armature.matrix world bone.parent.matrix).inverted() (SystemMatrix armature.matrix world bone.matrix)?


Augmented reality on Mobile platform iOS Is there a way that we can control the iOS device camera to an extent what colors it sees, what shapes it sees ? etc I'm speaking about the ability to read information before the image is captured. Consider my question as Possibility of making an augmented reality game on iOS phones. I dont find relevant help for my query in internet iOS developer site. Hence posting here.


android game change background image at every level? I want to be able to have a different background image at each level of my game. Presently I have only one. There is no layout folder shown in Android Studio and all info I have searched shows how to do it with the layout xml. I have found this code in GameLayer.java of my game. Actually I am reskinning the game so everything is already there, I just need to know how to have different bg images now. Code background CCSprite bg new CCSprite("game game bg.png") bg.setPosition(G.displayCenter()) addChild(bg)


Using Unity3D from within Eclipse Is it possible to use Unity3D from within Eclipse? I've seen that I can import a Unity3D project into Eclipse, but I cannot seem to be able to access classes such as Terrain or Ray. I don't know if that's because I haven't imported the correct libraries or if that's a limitation and that data can only be accessed by methods within Unity3D. I am designing an Android game within Eclipse and would prefer to use Eclipse than Unity3D, even if that means my game will only be available for Android. The only real reason I'm using Unity3d is for use of the 3D terrain and to hopefully help in getting the data, such as slope, terrain type, collisions, etc.


Make a callback to android methods from libgdx How can I make a callback from libgdx to an Android method? I want to use the method to overwrite a file in the internal memory.


Monetizing an Android library? I'm developing a library ( i.e. a JAR file that you put into the libs folder in eclipse ) which would extend surfaceView, which other people would hopefully use to make games. I guess the best way to make any money off it would be to show banners on that surfaceview, right? Maybe someone had similar experience? What advertising company would you suggest? admob, leadbolt? would they agree that I would integrate their sdk into my library ( not a finished app )? Thanks!


How to move a sprite automatically using a physicsHandler in Andengine? I use a DigitalOnScreenControl (knob with a four directional arrow control) to move the entity and the entity which is bound to a physicsHandler. physicsHandler.setEntity(sprite) sprite.registerUpdateHandler(physicsHandler) From the DigitalOnScreenControl, I know which direction I want my sprite to move. Inside its overridden onControlChange function, I call a function animateSprite that checks which direction I chose. Based on the direction, I animate my sprite differently. Problem I want to automatically move the sprite to a specific location on the scene, say at coordinates (207, 305). My sprite is at (100, 305, which means it has to move down by 107 pixels. How do I tell the physicsHandler to move the sprite down by 107 pixels? My animateSprite method will take care of animating the sprite's downward motion.


Recommended way to handle sprite assets for different screen densities (Android) I am currently working on a 2D game for Android. All of the images that I render were created as SVG's and then exported to PNG's which I have placed in my assets directory. These images are also all sprites that I render using a sprite batcher. My question is around using different versions of the sprites for devices with different densities. I know that when developing a traditional android app you could place separate directories for separate density levels inside of res and then place the correctly sized versions of the images in question in these sub directories of res. What is a good approach when dealing with sprite images in the asset directory? Should I just have one copy of the sprites at a really high density resolution that I use for everything and I just render them on a coordinate system that is independent of screen size or should I resize the image based on screen density before I process it to create all my texture regions? Or is there another solution entirely? Currently I have one high resolution set of sprites that I use for everything, it just seems wasteful and inefficient for the lower density devices.


Drawing game app How to use vector graphics instead of bitmap in Android? I have a problem concerning the concept of using vector graphics instead of bitmaps in order to draw on canvas. Usually to draw on canvas we set a bitmap to that canvas and we start drawing pixels on it by simply moving our finger on the screen. However, this method will result very pixelated relatively low quality drawings. It is noteworthy that there are some drawing apps that result in very smooth curves when you want to draw via them. After doing some googling and researching, I knew that there is the new concept of use vector graphics that is being used in order to draw smooth edged drawings on the screen. Look guys, the thing is when I developed my drawing app, I used bitmap (which was already there as an object given by Android) in order to draw cubic Bezier curves. No matter how much I tried to smooth my drawings out, I always get stair like edges. If you are interested in how I developed the curve, please read this. If not, just ignore this bold paragraph In order to draw the cubic bezier curves I simply took the sampled touch points and for every 4 points in these sampled points I calculated the 2 intermediate control points (the ones that the curve never touch) to create a bezier through the sampled points. For the curve to appear, I used bitmap and paint objects given by android. After getting the undesired result (low quality curve), I decided that I want to use vector graphics in order to do the same thing but with a higher quality. The thing is that I am very new to Vector Graphics, that I don't know where to start. My question is simple as is Is there a platform given to me by Android in order to use vector drawable like in the case of bitmap? If not, am I supposed to start this from scratch? I am clueless and any tip or hint from you will be greatly appreciated.


How do I access device camera in GameMaker Studio 1.4? I've looked everywhere in the documentation for GameMaker and I didn't find anything about how to access the camera.


Multiplayer game sdk for ios and android I am working on a multiplayer game supporting Android and IOS. For IOS Game Center seems promising. But its IOS only. OpenFeint could be a option, but now GREE has stopped supporting it. Is there any other multi platform SDK which I can use for both IOS and Android? EDIT I could not find any good service which provides their own server and SDK for both IOS and android. So finally I chose to go with my own server on AWS EC2 python tornado Websocket. If anyone want to know more plz contact...


How do I use TextureRegion? I can't understand how to use texture region. I have a png file which has images (sprite sheet) and I must "extract" every image I want. From here it just says TextureRegion(texture, 20, 20, 50, 50) Where 20, 20, 50, 50 describes the portion of the texture, How can I find which portion has the image I want to extract? Should I open the png file with Gimp for example? And then I am search for some coordinates? And if yes, how?


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.


Graphical Android game Bad performance in some situations I am developing a simple graphical game for Android (Java and OpenGL ES). There is no high end graphics involved, basically a few (less than 10) sprites and some (about 10) dynamically drawn primitives. The performance of the game is quite fine, I get about 50 60 FPS on my HTC Desire. However, there is one specific performance issue. In my game I can fire a characters' gun, which then fires a laser beam that moves over the screen following its velocity vector. This beam is dynmically drawn. The thing is when I fire the gut the first time, the laser beam is moving very unsteady (its "hopping" over the screen). But, after this first time, when I then fire the gun for how often I like, the laser beam is moving very smooth over the screen. I first thought this might be an issue with Android's garbage collector. But I double checked my code. Not one single new object is created within the main game loop, I solely use pre created objects (i.e. class instances). I also doubt the problem is related to the dynamic drawing of my primitives (laser beam), because as said its working fine and very smooth for every gun shot after the first one. It is solely this first shot where I encounter this performance issue. So my question is, does this behaviour sound familiar to anyone of you guys? I would appreciate any idea very much.


Box2DLights in libGDX Bad quality of the light gradient on Android I am facing a problem while porting one of my libGDX project from desktop to Android My game uses Box2DLights. While the light effect look very fancy on the desktop version of the game, it looks really ugly on the Android version. The light gradient is not smooth at all. Take a look at the comparative screenshot below To use Box2DLights in my game, I use this code in my GameScreen rayHandler new RayHandler(world) rayHandler.resizeFBO(Gdx.graphics.getWidth() 5, Gdx.graphics.getHeight() 5) rayHandler.setBlur(true) RayHandler.useDiffuseLight(true) rayHandler.setAmbientLight(new Color(0.15f, 0.15f, 0.15f, 0.1f)) Of course, I tried to play with different parameters, such as RayHandler.useDiffuseLight(fasle) Or rayHandler.diffuseBlendFunc.set(GL20.GL DST COLOR, GL20.GL SRC COLOR) Or rayHandler.shadowBlendFunc.set(GL20.GL DST COLOR, GL20.GL SRC COLOR) Everything I tried so fare gave the same ugly light gradient. I already played games that uses Box2DLights that rendered very well on my tablet, thus, I don't think it's due to a limitation of Android. Does anybody know what's the trick to overcome this problem ? Thanks !


Receive UDP packet in android I'm sending UDP packet to android over a wireless network from some other software . how can I receive that in android ? should I write a client in android to get the data?


Adobe Air Mobile AS3 app challenges and how to overcome them? I made a PC flash game for LD 26 minimalism and I am working on porting it to Android. Some questions I'd like to ask Is it bad to heavily use vector graphics (ie. this.graphics.lineTo()) in Mobile Air? Does Stencyl completely alleviate this issue? Are there any inherit disadvantages to using Air Mobile that I'm missing? Where is the documentation for Air mobile (I googled and found no recent books or documentation pdf so far)


LibGDX strange status bar in background BUG I released an app and I noticed that some devices has a strange "bug" which I don't know if it's caused by Android, me or LibGDX. That bug is related to status bar, normally app let you see the bar (time, battery percentage ...). In my app the statusbar shouldn't be showed but it seems to exist in some devices. What is strange is that the bar isn't the same of the device but a general bar with random time and battery percentage. Sometimes the bar showed is an older Android version.


How can I delete an enemy's bitmap from a canvas? I'm learning to create an Android shooter game where I'll have multiple enemies. I must control the position on the screen and be able to delete each of then (via, for example, a die() function). But I use a canvas, which is most recomended, is it possible to delete just one bitmap and not the entire canvas (by delete I mean make it vanish from the screen, not just erase its value)? If so, how? Another approach, I guess, would be using the Android image view, which can be deleted and as well as controlled and positioned, but I think that can make my game run slow if I create various objects of a class enemy is that correct?


Loading Bitmap by name in Android Currently, I'm loading images as follows sampleimage BitmapFactory.decodeResource(context.getResources(), R.drawable.sampleimage) This automatically chooses the correct image from the drawable hdpi, drawable mdpi or drawable ldpi folders. How can I load the bitmap using the image name as the string "sampleimage.png"?


What's wrong with this Open GL ES 2.0. Shader? I just can't understand this. The code works perfectly on the emulator(Which is supposed to give more problems than phones ), but when I try it on a LG E610 it doesn't compile the vertex shader. This is my log error(Which contains the shader code as well) EDITED Shader uniform mat4 u Matrix uniform int u XSpritePos uniform int u YSpritePos uniform float u XDisplacement uniform float u YDisplacement attribute vec4 a Position attribute vec2 a TextureCoordinates varying vec2 v TextureCoordinates void main() v TextureCoordinates.x (a TextureCoordinates.x u XSpritePos) u XDisplacement v TextureCoordinates.y (a TextureCoordinates.y u YSpritePos) u YDisplacement gl Position u Matrix a Position Log reports this before loading compiling shader 11 05 18 46 25.579 D memalloc(1649) dev pmem Mapped buffer base 0x51984000 size 5570560 offset 4956160 fd 46 11 05 18 46 25.629 D memalloc(1649) dev pmem Mapped buffer base 0x5218d000 size 5836800 offset 5570560 fd 49 Maybe it has something to do with that men alloc? The phone is also giving a constant error while plugged ERROR FBIOGET ESDCHECKLOOP fail, from msm7627a.gralloc Edited "InfoLog " refers to glGetShaderInfoLog, and it's returning nothing. Since I removed the log in a previous edit I will just say i'm looking for feedback on compiling shaders. Solution More questions Ok, the problem seems to be that either ints are not working(generally speaking) or that you can't mix floats with ints. That brings to me the question, why on earth glGetShaderInfoLog is returning nothing? Shouldn't it tell me something is wrong on those lines? It surely does when I misspell something. I solved by turning everything into floats, but If someone can add some light into this, It would be appreciated. Thanks.


WiFi Game Controller Protocol I'm wanting to use mobile devices to control a game. I'd like to use an industry standard protocol for wifi game controllers rather than roll my own, but have been unable to find any standard. Does there exist any industry standard wifi game controller protocol? Is there some unofficial protocol many implement, preferably with quality Android iPhone client implementations available?


Android, apply a pixelshader on a canvas Can an opengl pixelshader be applied on a Canvas? I want to render a bitmap on a canvas, then apply a pixelshader to get, for example, a blur effect. Is this possible? I don't want to simulate the blur effect by creating a new bitmap and then blur this from java code because i'd like to be able to re use the shaders in openGL apps too.


Android multi screen rendering Is it possible on Android to render specifically only, to the connected Monitor TV on the hdmi port? If so, is it possible to use OpenGL ES to render a different scene on the monitor and on the device's screen? I would like the tablet to become more of an input device when it is connected with a monitor tv and my game to be rendered just to this screen. If nothing is connected, then the device's screen should be used. Ideally I would render a small interface (with buttons and text only) on the android tablet and the game itself on the monitor. Can this be done? How?


Libgdx Scene2D second screen animating and accept input while still loading I'm currently developing an app Scene2D that involves a small number of screen switches. I am having a problem that after calling set screen there appears to be a pause of a second or two (I think it's the non UI logic is being performed in the new screen constructor to aid setting up UI actors), which is fine. But during that second pause. It appears my second screen is already running in the background but not being rendered. I think this is happening because of two problems Animations and Actions that are supposed to begin when the second screen loads are already one or two seconds in progress by the time the second screen loads. During the pause before the second screen loads, the first screen is still rendered in freeze frame, but any user input is queued and processed in the second screen after it renders! Meaning that the user is effectively clicking on things that are not yet rendered which can cause some problems for their experience. I already am setting the input processor in the show method but it show appears to be called before the screen is actually visible and rendering frames. Is there something I have misunderstood about the life cycle? Or common pitfalls I may have fallen into? Only a problem on Android, Desktop is fine but possibly only because the loading times are too fast to notice either problem.


Using LibGDX within Android Fragment I want to use LibGDX with Android, but instead of modifying my Activity to extend AndroidApplication I want my to render my graphics inside Android Fragment The problem is that my class already extends Fragment, so I can't make it extend LibGDX AndroidApplication (Multiple Inheritance) is there any workaround for this ? Thanks


How do I create a scrollableparallax background in AndEngine GLES1 In my game I want my background to move side by side as the player moves on screen in AndEngine. I moved my sprite using analogScreenControl. I am using AndEngine GLES1. i don't want to move my background automatically but i want to move the background as per player moves on the screen with the help of analogScreenControl.


Detect android device rotation I am developing a game in android and I want to be able to use device rotation for moving. So, I am not sure what sensors should I use. I tried gyroscope, it will do, but there are not a lot of devices that supports gyroscope sensors. So, I want to use rotation around x,y,z axis not change like landscape portrait mode. What sensors would be the best? I already tried to google it but I couldn't find anything.


How do I draw a scrolling background? How can I draw background tile in my 2D side scrolling game? Is that loop logical for OpenGL es? My tile 2400x480. Also I want to use parallax scrolling for my game. batcher.beginBatch(Assets.background) for(int i 0 i lt 100 i ) batcher.drawSprite(0 2400 i, 240, 2400, 480, Assets.backgroundRegion) batcher.endBatch() UPDATE And thats my onDrawFrame.I'm sending deltaTime for fps control. public void onDrawFrame(GL10 gl) GLGameState state null synchronized(stateChanged) state this.state if(state GLGameState.Running) float deltaTime (System.nanoTime() startTime) 1000000000.0f startTime System.nanoTime() screen.update(deltaTime) screen.present(deltaTime) if(state GLGameState.Paused) screen.pause() synchronized(stateChanged) this.state GLGameState.Idle stateChanged.notifyAll() if(state GLGameState.Finished) screen.pause() screen.dispose() synchronized(stateChanged) this.state GLGameState.Idle stateChanged.notifyAll()


Centering GLViewport position within physical screen I'm developing my app on one device and want it to display at the same ratio on all other devices. Currently what I have is 'image 1' in my image below the game fits perfectly onto my development device's screen. If I keep the viewport at the same ratio then I get the results seen in 'image 2'. This is great, but now I need to center the viewport , and I'm not sure how to do that. What I'm aiming for is what is in 'image 3' just not sure how to get there. This is how I'm keeping the viewport at the same ratio the ratio is width height (this is 1.702127659574468 and we will use this explicitly) Set viewport size based on screen dimensions GLES20.glViewport(XVal, YVal, (int) (height 1.702127659574468), height) At the moment, XVal and YVal are both 0 I need to change XVal to move the image along. How do I work out the amount to move the viewport along by? (I know it will be equal to half of the space to the right of the viewport ('image 2') just not sure how to work this out.......)


How do I implement a subclass of CCSprite? Can someone tell me how to subclass CCSprite on Android? I've added this snippet of code into my CharacterSprite public static CharacterSprite sprite(String fileName) return new (CharacterSprite)CCSprite( CCTextureCache.sharedTextureCache().getTexture(fileName) ) But getTexture() can't be found. Can someone help me please?


Making use of the Android GPU debugging tools I tried following the manual to install the Android GPU debugging tools for android Studio 2.0. Unfortunately it has not been very successful. I have been following the instructions of the official documentation which are still for version 1 of the gpu debugging tools here http tools.android.com tech docs gpu profiler It also isn't that helpful otherwise. I am using an arm based emulator for testing since the abi specific folders specified in the manual are for arm abi's only. Also the red button above the gpu monitor that is used to start the debugging tools is grayed out for me and it tells me that the gpu debugging tools are not installed when I hover over it. Are there any extra steps I need to follow to get it to work?


Most common resolution used in Android phones as of 2013 Before making an Android app, I want to know what screen resolutions I should target. I know there are resolutions of 1280x800, 1280x720 and 800x480, but I would like to know which are most common. Are there any recent stats on the distribution of Android devices' screen resolutions?


Should I be using Lua for game logic on mobile devices? As above really, I'm writing an android based game in my spare time (android because it's free and I've no real aspirations to do anything commercial). The game logic comes from a very typical component based model whereby entities exist and have components attached to them and messages are sent to and fro in order to make things happen. Obviously the layer for actually performing that is thin, and if I were to write an iPhone version of this app, I'd have to re write the renderer and core driver (of this component based system) in Objective C. The entities are just flat files determining the names of the components to be added, and the components themselves are simple, single purpose objects containing the logic for the entity. Now, if I write all the logic for those components in Java, then I'd have to re write them on Objective C if I decided to do an iPhone port. As the bulk of the application logic is contained within these components, they would, in an ideal world, be written in some platform agnostic language script DSL which could then just be loaded into the app on whatever platform. I've been led to believe however that this is not an ideal world though, and that Lua performance etc on mobile devices still isn't up to scratch, that the overhead is too much and that I'd run into troubles later if I went down that route? Is this actually the case? Obviously this is just a hypothetical question, I'm happy writing them all in Java as it's simple and easy get things off the ground, but say I actually enjoy making this game (unlikely, given how much I'm currently disliking having to deal with all those different mobile devices) and I wanted to make a commercially viable game would I use Lua or would I just take the hit when it came to porting and just re write all the code?


Ranking system in an Android Open Source project This is my first question in any stackexchange board, but I've been reading Stack Overflow answers for a few months. I hope this question is appropriate for this one. I am developing a simple Android game using Java and libgdx. I want to make a typical ranking, a player who completes a level is awarded some points, and his score is compared with other players who sent theirs. This is all ok (well I still need to find a way to store players' scores). On the other hand, I may want my project to be released as an open source project, so others can look at its code freely. My question is, if anybody can get this code, modify it in order to get some advantatge, compile this game, and load it onto an Android device, how can I stop him her from sending his her score? It would by unfair to let them send highscores with a different game.


How do I run an APK in a device from the Unity IDE without rebuilding the binary? I know that the button Build creates the APK in my disk. And the button Build and Run creates it and sends it to a real device if connected via USB. Question Is there any way to "Run" from the Unity IDE an APK in a physical device without having to re build it (provided you properly built it a few minutes ago, for example?)


Rotating each quad in a batch separately? Background In my app I use the following code to rotate my quad Code Rotate the quad Matrix.setIdentityM(mRotationMatrix, 0) Matrix.translateM(mRotationMatrix, 0, centreX, centreY, 0f) Matrix.rotateM(mRotationMatrix, 0, angle, 0, 0, 0.1f) Matrix.translateM(mRotationMatrix, 0, centreX, centreY, 0f) And then apply the matrices Combine the rotation matrix with the projection and camera view Matrix.multiplyMM(mvpMatrix2, 0, mvpMatrix, 0, mRotationMatrix, 0) get handle to shape's transformation matrix mMVPMatrixHandle GLES20.glGetUniformLocation(iProgId, "uMVPMatrix") Apply the projection and view transformation GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, mvpMatrix2, 0) The above code works great when I'm drawing single quads. Problem However, if I have a few quads with the same texture to draw, I batch them up and draw them with one call to glDrawArrays. I can't work out if it is possible to rotate each individual quad before drawing them (or how to do it if it is possible) I realise, they will all be rotated the same amount at the same time but this isn't an issue). Rotation method public void rotateBatchQuads(int coordinates, int angle) for (x 0 x lt coordinates.length x 2) Center of quad (Along the x) float centreX coordinates x quadWidth 2 Pseudo code float centreY coordinates x 1 quadHeight 2 Pseudo code Center of quad (Along the y) Rotate the quad Matrix.setIdentityM(mRotationMatrix, 0) Matrix.translateM(mRotationMatrix, 0, centreX, centreY, 0f) Matrix.rotateM(mRotationMatrix, 0, angle, 0, 0, 0.1f) Matrix.translateM(mRotationMatrix, 0, centreX, centreY, 0f)


Connect Micromax A100 with Eclipse I want to know that I can connect micromax a100 with the eclipse for android development or not. From other community I found that for development purpose micromax device can not be used. Also I doesn't found any usb driver for that. So please help to come out that.


Upgrades in game with leaderboards? I am working on an endless mobile game right now and I'm currently in the designing phase. Most (or all) mobile games especially endless ones now have leaderboards and a player's position in the board is determined by their score. I want to implement a store from which people buy upgrades, new cool stuff that help them gain more score. Will this cause an unfair leaderboards. Should I remove the upgrades and replace them with only customizations in the store like clothes that don't affect the score? Thanks in advance.


How do I find an optimal FPS for best user experience while preserving battery life? I'm developing an Android game. The "graphics" I'm using need little CPU GPU, so they run with high FPS. Because saving energy is important on Android devices, I want to limit frame rate (if deltaTime lt limitDeltaTime gt Thread.sleep(...) ). How high should the frame rate be to get an optimal balance between saving resources and a "fluid" gameplay experience. At which point is the user experience optimal or no longer improving?


How to move a Entity without moving its children in AndEngine? I have a Entity in AndEngine and when I move it, all child move together with it. Which is great. But, sometimes, I need to move it without moving its children. Is it even possible? And, if it is, how can I do so?


Different kinds of collision detection in Android Are there any other ways to detect collision between two objects besides the bounding rectangle method and downloading another class to put into Android?


How do i set gravity towards a point in the centre in AndEngine with Box2D? I have a scene and i can set gravity in the PhysicsWorld like this.mPhysicsWorld new PhysicsWorld(new Vector2(0, SensorManager.GRAVITY EARTH),false) but i would like all bodies to gravitate to a point. I tried physicsWorld.setGravity(new Vector2(centerX, centerY)) but that has not worked i assume because i need to calculate the vector to the centre. But I'm not sure how to do that and where to calculate it so it changes. I would like the input (of force) to be from the touch handler of the sprite. The sprite at the moment can be moved via Override public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) this.setPosition(pSceneTouchEvent.getX() this.getWidth() 2, pSceneTouchEvent.getY() this.getHeight() 2) if (pSceneTouchEvent.isActionMove() pSceneTouchEvent.isActionDown() pSceneTouchEvent.isActionOutside()) this.setX(pSceneTouchEvent.getX() this.getWidth() 4) this.setY(pSceneTouchEvent.getY() this.getHeight() 4) return true I would like to do the calculation in there so as the sprite is dragged, the vector changes, then when it's released it should 'fall' to the centre EDIT Mass can be set as 1 unit since it's not relevant Thanks for the help.


Simple way to detect collision between two bitmaps on android surface view I'm looking for a standard way to detect collision between two bitmaps inside a surface view. I tried the intersect method with two rectangles, but it doesn't log. practiseA new Rect(500, 500, 500, 500) practiseB new Rect(500, 500, 500, 500) public void isIntersecting() Log.d("yeah", "hello") if (practiseA.intersect(practiseB)) Log.d("collision", "yes") So can someone tell me what I'm doing wrong or give me a different method? I saw this complicated algorithm but didn't understand what to feed it sqrt( ( ax bx ) 2 ( ay by) 2) lt aR bR What's aR and bR?


CopperCube game engine Android export failed I am using CopperCube 6.0.2 to develop my game. I am able to export my game to exe and webgl format, but when I try to export it to .apk format it says aapt tool .exe missing error I downloaded the sdk pakage and it now shows failed to find the android jar How can I resolve this issue?


How to emulate knob turning, based on x y movement? I'm doing a game where one component is that you turn a knob. I'm having trouble getting good "knob behavior". I know the current touch mouse X,Y location, and I keep track of the previous X,Y location, so I can determine if I'm going left or right and or up or down. It works, but it's crude. I suspect I have to take an average of any given direction over a period of time (say, last quarter second) to eliminate jitter because people don't move uniformly in the same movement every moment. I can't really use touchdown release because you should be able to put the touch down, then move left right up down continuously without release, and the knob would turn, just as if you had a free spinning audio control or video shuttle (say). Any thoughts in this direction on how to even it out?


Grayscale color mode texture not rendering in libGDX I am about to develop a game completely in shades of grey using libGDX and just for testing purposes, i created two textures in photoshop 2048 x 2048 plain white png image with RGB color mode of size 19.1KB 2048 x 2048 plain white png image with grayscale color mode of size 7.67KB ... so basically both are just plain white images to look at, but the GREY.png one takes comparatively less space than the RGB.png. While rendering the both the images one at a time, RGB image renders perfectly but the grayscale one does not render at all and the output is completely black. My code Override public void create() texture new Texture (Gdx.files.internal ("GREY.png")) ...just change to "RGB.png" to render RGB.png image.. batch new SpriteBatch () Override public void render() Gdx.gl.glClearColor (0, 1, 0, 1) Gdx.gl.glClear (GL20.GL COLOR BUFFER BIT) batch.begin () batch.draw (texture, 0, 0) batch.end () Override public void dispose() texture.dispose () This is all it...No cameras are used, just 2 lines in create() and 5 lines in render() method and 1 line in dispose() method, nothing fancy at all... Also it will be really stupid to load 19.1KB texture and render it in greyscale using shader when you can directly load same looking image of 7.67KB size. I don't understand why libGDX does not render the image with grayscale color mode, is it not supported? UPDATE grayscaled images are supported by libGDX and texture new Texture (Gdx.files.internal ("gs.png"), Pixmap.Format.LuminanceAlpha, true) solved my problem.


How do I handle game lag due to background apps I'm developing a game using libgdx and have noticed on several occasions that other background apps running can cause lag in my game especially when those apps are being updated in the background. I'm talking serious lag like from 50 60 fps down to under 10 fps while the other app installs. How should I handle this very noticeable lag? Thanks!


Button change texture after click I need to make a button with texture. After button is pressed I want to change texture of button permanently. For example on of sound button. I tried this but it changes image only while I hold button. Thanks mSoundButton new ButtonSprite(30, 30, ResourceManager.getSoundButtonTR(), tiled texture region with image for sound on and sound off ResourceManager.getEngine().getVertexBufferObjectManager()) Override public boolean onAreaTouched(TouchEvent pTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) if(pTouchEvent.isActionDown()) SFXManager.toggleSoundEnabled() this.setCurrentTileIndex(1) return super.onAreaTouched(pTouchEvent, pTouchAreaLocalX, pTouchAreaLocalY) mScene.registerTouchArea(mSoundButton) mScene.attachChild(mSoundButton)


Cocos2d x supporting multi resolution using density independent pixels Is there a way to use Density Independent pixels(dp) in cocos2d x? I am developing an Android game using Cocos2d x 3.0. The Android reference http developer.android.com guide practices screens support.html tells me not to use pixels in code but use dp when supporting multi resolution support. It also tells me to provide different images for different screen size groups and different density groups. However, cocos2d x tutorials use pixels for multi resolution support. If I were to use pixels, I think it means I need to have images for all these different resolutions 240x320, 240x400, 240x432 320x480 480x640, 480x800, 480x854 600x1024 640x960 1024x600, 1024x768 1280x768, 1280x800 1536x1152 1920x1152, 1920x1200 2048x1536 2560x1536, 2560x1600 Even if I don't support every screen resolutions, I think this requires more work than following the Android reference's best practice. Am I missing something on how supporting multi resolution works or do I indeed do need to do much more work using cocos2d x?


Profiling the GPU of a tablet We are working on a tablet game in Unity Pro (for the first time). Unity's profiler works great for probing the CPU, but the tablet's GPU isn't supported in the profiler, so we have no idea where the rendering bottlenecks are. Are there any other means of profiling the GPU of an android tablet? (We are working with a Samsung galaxy tab 2 10.1 ) How do other mobile devs do this? We are basically looking for any ways of getting info from the gpu as we're running the game. Benchmarking software wouldn't help we don't need benchmark scores. Cheers!


Android Density Independent Pixel Drawables Resource Folder I'm trying to get to grips with DIP in Android (using Eclipse). I'm writing a little game with OpenGL ES 2.0. Could I get some guidance and tips on what I'm not understanding doing right. From what I understand I need to make different sizes of the same image so that they appear correctly on different devices. This is because each device has a different aspect ratio and a 1cm by 1cm sprite on one screen might not be 1cm by cm on another screen. I read here that I need to place my sprite images in the res drawables folders. I did this, but when I try to reference the resource using mySpriteTexture new Texture(context, R.mysprite) the R class fails to find the .png. I have tried cleaning, rebuilding etc., and tried variations like R.res.mysprite. Although I don't see the point in trying R.res.drawables XXX as according to the article Android is meant to pick the correct images on running... I think it must be something to do with the XML manifest? But I have no clue. Any help would be welcome.


Polygon Collision Detection Android I am starting to try and figure out polygon collision detection in my Android game. I am currently doing pixel level collision detection and it just seems to be too slow (though it works). I was looking at this tool and it seems like it would be really handy to give me a set of vertices for my images. Does anyone have any ideas about how I should go about implementing this? Basically once I have a list of vertices that form a polygon, how can I detect if polygon A intersects polygon B? I can see that these vertices can be used easily with Box2D but I want to try to do this without Box2D first.


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


Is a separate thread for game loop compulsory for simple games? I am new to game development. In order to learn I am recreating this game on android platform. You can observe the game play video at the above link. It is a simple game. I have read a lot of articles on getting started with game development.Almost all of them recommended using a game loop on separate thread, which makes sense for other games. However, for this particular game do I need to start a separate thread ?


"Non additive" alpha blending in OpenGL ES 2.0, Android (AndEngine) I have several monochromatic sprites and I render them with alpha 0.25 (all of them the same value). I want to "paint" with them, so when they overlap, the alpha won't be added. I am not sure if I can express myself properly in English here is an image of what I want to achieve (background visibility is important). Is this achievable in OpenGL ES 2.0? I was trying to figure out the different modes of alpha blending, but without success. Also if anyone can tell me, how is this called, I can continue my search. If this is not possible, I was thinking maybe I can somehow render the monochromatic sprites (alpha 1) to a texture and only then render this texture on screen. How can this be done in AndEngine?


How do I change windows commands to android commands? I created a game and would like to test it on android, but it does not respond to any touch on the screen, I think it's because I have to adapt the game code for android. Click Touch I developed it and tested it with the selected target (windows) I was able to put it to run on an android virtual machine, but it does not respond to any commands How could he do that? How to adapt the function if (point in rectangle(window mouse get x(),window mouse get y(),60,250,104,313)) amp amp config false for example? For something that works for android. I hope I have been clear. What I want exactly is to turn all game mouse clicks into screen touches. Sorry for any translation error and thank you already


Upgrades in game with leaderboards? I am working on an endless mobile game right now and I'm currently in the designing phase. Most (or all) mobile games especially endless ones now have leaderboards and a player's position in the board is determined by their score. I want to implement a store from which people buy upgrades, new cool stuff that help them gain more score. Will this cause an unfair leaderboards. Should I remove the upgrades and replace them with only customizations in the store like clothes that don't affect the score? Thanks in advance.


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


How do I correctly destroy a MobFox ad? Is anyone here using MobFox to display their Android app's ads? I was previously using the AdMob SDK but recently switched to MobFox and while it only took a short time to integrate it, there are a few outstanding issues which I can't work out. With the AdMob SDK, in my onDestroy method, I would have this line adView.destroy() However, I've looked through MobFox but I can't see an equivalent, am I missing something?! (there is all the usual pause() , resume methods etc..... just can't find a destroy() method)


Why does my game display the wrong "required Android version" on Google Play? I'm porting a Unity game to Android, and I've set up the "Minimum API Level" in the Player settings to "2.3.3 (API level 10)". However, on the store, it says "Requires Android 1.6 and up". On the Google Developer Console I didn't find this setting, so I guess the store is just trying to "guess" it examining the application, and failing. Did I miss something?


Box2DLights in libGDX Bad quality of the light gradient on Android I am facing a problem while porting one of my libGDX project from desktop to Android My game uses Box2DLights. While the light effect look very fancy on the desktop version of the game, it looks really ugly on the Android version. The light gradient is not smooth at all. Take a look at the comparative screenshot below To use Box2DLights in my game, I use this code in my GameScreen rayHandler new RayHandler(world) rayHandler.resizeFBO(Gdx.graphics.getWidth() 5, Gdx.graphics.getHeight() 5) rayHandler.setBlur(true) RayHandler.useDiffuseLight(true) rayHandler.setAmbientLight(new Color(0.15f, 0.15f, 0.15f, 0.1f)) Of course, I tried to play with different parameters, such as RayHandler.useDiffuseLight(fasle) Or rayHandler.diffuseBlendFunc.set(GL20.GL DST COLOR, GL20.GL SRC COLOR) Or rayHandler.shadowBlendFunc.set(GL20.GL DST COLOR, GL20.GL SRC COLOR) Everything I tried so fare gave the same ugly light gradient. I already played games that uses Box2DLights that rendered very well on my tablet, thus, I don't think it's due to a limitation of Android. Does anybody know what's the trick to overcome this problem ? Thanks !


How can you check your users' unlocked achievements (Google Play Game Services)? Is it possible to see how many of your users have unlocked certain achievements on the Google Play Developer console? This information would be very useful. I guess that one could achieve this through integration with Google Analytics but I was wondering if there was a simpler way to get this data.


LibGDX Android Textures reload other textures, and transparent images get black backgrounds Pictures I have very strange problems with my LibGDX Game in Android The problem is that sometimes the textures get black backgrounds when they should be transparent, and sometimes when I remove the texture, or press the back button, the textures get replaced with other textures that I have. To clarify I'm using x texture to show the status of health. I'm using three x textures to show how many lives the player got, and when I lose health, and remove one texture, the x texture get replaced with y or z texture, or the remaining x textures get black backgrounds. Sometimes it works flawlessly, and the x texture gets removed, and the backgrounds are still transparent. I'm loading my textures via an AssetManager, and just load them on create(). In my render I use this Gdx.gl.glClearColor(1, 1, 1, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) Gdx.gl.glBlendFunc(GL20.GL SRC ALPHA, GL20.GL ONE MINUS SRC ALPHA) batch.enableBlending() batch.begin() for (Entity life LifeEntities) life.render(batch) batch.end() I'm also using this in my Launcher Class. AndroidApplicationConfiguration cfg new AndroidApplicationConfiguration() cfg.r cfg.g cfg.b cfg.a 8 MainGame myGame new MainGame(arrayName) initialize(myGame, cfg) I do dispose the textures also. I have looked up on google and on gamedev about this problem, but all the questions are for problems when the transparent always have black background, not when it is something that happens like a bug. Any suggestions on where the problem could be? Thanks a lot, if you need more code, please let me know. Pictures of the problem


Separate renderng thread in Android (OpenGL ES 2.0) I'm used to mainly working with the Canvas SurfaceView API on Android and have recently been learning openGL ES 2.0 With canvas I know that surfaceView gives you the ability to start a new thread to render on, but it doesn't specifically do this for you, so I was creating a new thread and managing that thread when the app was ended paused etc.... However, from what I've read with glSurfaceView it seems that this is actually done for you automatically? Does this mean I don't actually need to manually create start and manage my own rendering thread? (I'm talking specifically about a rendering thread (which could also be used for logic updates) which is separate the main UI thread. Clarification on this matter would be greatly appreciated.


2D Scrollable View with Matrix of Numbers on Android I would like to implement a 2D, scrollable view which can be scrolled horizontally, vertically or even diagonally (similar to a zoomed image which can be scrolled in any direction, but has bounds). In that scroll view, I would like to have matrix of numbers. Which component(s) should I use for this purpose.


Sprites are rendered as black rectangles in android 4.0.x only I have some problems rendering sprites correctly on a LG optimus vu (android version 4.0) with libgdx. Basically sprites are black rectangles, while other images that i declare as Texture are correct. I've tested my game with android 4.2 4.3 and 5.0 and I have no problems... Is there some difference between 4.0 and 4.2 in graphics rendering? Maybe it's Gl10 and not Gl20?


Sound isn't playing in Game Maker Studio when interacting with an object I'm making a small game in Game Maker Studio. I have a piece of code that moves the player to the next room when he touches obj star this works. I have another line that tries to play sound collect when the star is touched, but the game just moves to the next room without playing the sound. This code is in the Step event My code is as follows Get the player's input key right keyboard check(vk right) key left keyboard check(vk left) key jump keyboard check pressed(vk space) React to inputs move key left key right hsp move movespeed if (vsp lt 10) vsp grav if (place meeting(x,y 1,obj wall)) vsp key jump jumpspeed Horizontal Collision if (place meeting(x hsp,y,obj wall)) while(!place meeting(x sign(hsp),y,obj wall)) x sign(hsp) hsp 0 x hsp Vertical Collision if (place meeting(x,y vsp,obj wall)) while(!place meeting(x,y sign(vsp),obj wall)) y sign(vsp) vsp 0 y vsp Sounds if (place meeting(x hsp,y,obj star)) sound play(sound collect) Next Level if (place meeting(x hsp,y,obj star)) room goto next()


How much memory can i safely use on android? To make my game more fluid, I try to prevent memory allocations during the game I am writing. To that end, I allocate a whopping 16MB of buffers on startup and then use those as I go along. When I check in Eclipse my game now uses 24MB in total, which does not change noticeably during the game. This all works fine on the phone I have now (android 2.3, motorola defy) but I wonder if I'm going to run into problems with this on other phones or tablets that run android 2.2 or higher (which is what I'm aiming for)?


Unity5 build won't run on android 2.3.3 I made a game using one of the Unity tutorials on their site and now would like to run on my phone (LG P500). But when I try to run it on the device, it says Failure to initialize Your hardware does not support this application, sorry! What can I do in this case?


How to solve ArrayList outOfBoundsExeption? I'm getting 09 02 17 15 39.140 E AndroidRuntime(533) java.lang.IndexOutOfBoundsException Invalid index 1, size is 1 09 02 17 15 39.140 E AndroidRuntime(533) at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java 251) when I'm killing enemies using this method private void checkCollision() Rect h1 happy.getBounds() for (int i 0 i lt enemies.size() i ) for (int j 0 j lt bullets.size() j ) Rect b1 bullets.get(j).getBounds() Rect e1 enemies.get(i).getBounds() if (b1.intersect(e1)) enemies.get(i).damageHP(5) bullets.remove(j) Log.d("TAG", "HERE LOLTHEYTOUCHED") if (h1.intersect(e1)) happy.damageHP(5) if(enemies.get(i).getHP() lt 0) enemies.remove(i) if(happy.getHP() lt 0) end screen !!!!!!! using this ArrayList private ArrayList lt Enemy gt enemies new ArrayList lt Enemy gt () and adding to array like this public void createEnemies() Bitmap bmp BitmapFactory.decodeResource(getResources(), R.drawable.female) if (enemyCounter lt 24) enemies.add(new Enemy(bmp, this, controls)) enemyCounter I don't really understand what the problem is, I've been looking around for a while but can't really find anything that helps me. If you know or if you can link me someplace where they have a solution for a similar problem I'll be a very happy camper!


What should I keep in mind when making 2D games for multiple resolutions? I'm making a 2D (Android) game. Android devices vary quite a lot in screen resolution what do I need to keep in mind when making my game? Do I need to keep big versions of all images and scale down depending on the resolution (doesn't that waste space)? Do bitmap fonts scale well or do I need to use something else? Anything else I'm forgetting?


How can I check if someone bought a non consumable product on iOS Android? In my application are 10 free levels, everyone can play them without doing in app purchases. But if you want more levels, then you need to buy once a non consumable product in the application. After you purchased it, you will have access to all levels that are currently available and to all levels that will be released during the next weeks. But how can I know if someone bought the non consumable product? Is it necessary to send at every reboot of the application a request to the Apple App Store to check if the current Apple ID has bought the product?


Libgdx gesture dection I have made a card game, and have two methods that sort the players hand. sortHandBySuit() sortHandByValue() I would like one method to be called when the user slides their finger from left to right across the screen, and the other from right to left. public class InputHandler implements InputProcessor ............. public boolean touchDragged(int screenX, int screenY, int pointer) world.getHand().sortHandBySuit() return false ............. How can I use touchDragged to call my methods?


How remove banner adView from a Screen in libgdx? I have an AdMob banner in the game. But I need this banner not to be shown in Screen 1 and when user enter Screen 2 I need to show the banner. When I call AdView.gone() it dissapears from screen but coordinates becomes wrong and touch position doesn't match with coordinates. How can I properly remove AdView.


LibGDX Swipe Detection Left and Right I have displayed an image at the center of the screen with libgdx. If I swipe left, the image should move to the left and, if I swipe right, image should move to the right. Subsequent swipes to the left should move the image left. The same should happen for right. I used GestureListener. It works to some extent in the sense if I swipe left first image moves left. But after that if I try to swipe right the image still moves left. So how do I implement the expected behavior? class MyGestureListener implements GestureListener Override public boolean fling(float velocityX, float velocityY, int button) if (velocityX gt 0) iX 20 else iX 20 System.out.println("iX " iX) return true ... Gdx.input.setInputProcessor(new GestureDetector(0.0f, 0.0f, 0.0f, 5f, new MyGestureListener())) ... batch.draw(splashTexture, iX, iY)


Detecting image curve to move a truck on this surface I have an image background in surface view I want to move something according to black surface.But i can not do this using height of this image as it return same height.and one more thing bitmap.getPixel is also not working.and my background is moving.So what is the way to achieve this feat


Android OpenGL ES2 How do I set fragment shader value using C This should be easy So I am using the following to create a fragment shader. GLbyte fShaderStr "precision mediump float " "void main() n" " n" " gl FragColor vec4(1.0, 0.0, 0.0, 1.0) n" " n" I then render a circle (collection of lines) the circle comes our red. If I change the code to... GLbyte fShaderStr "precision mediump float " "void main() n" " n" " gl FragColor vec4(1.0, 0.0, 1.0, 1.0) n" " n" The circle is now purple. My question is how do I control this dynamically? So for example when I receive an input I toggle the two colors? I tried... GLbyte vShaderStr "attribute vec4 vPosition n" "attribute vec4 inColor n" "uniform mat4 Projection n" "varying vec4 fragColor n" "void main() n" " n" " gl Position Projection vPosition n" " fragColor inColor n" " n" GLbyte fShaderStr "precision mediump float " "varying vec4 fragColor n" "void main() n" " n" " gl FragColor fragColor n" " n" void initColor() LOGD("Initing Color") GLfloat vVertices 1.0f, 0.0f, 0.0f, 1.0f glVertexAttribPointer(1, 4, GL FLOAT, GL FALSE, 0, vVertices) However, this doesn't seem to work as the circle is now black.


My game is not shown in Play Market New Releases I've published my app for like an 36 hours ago. It is possible to find it with exact search query ("Village Keeper") and it is available via the direct link. Thing is I can't find it in "New Releases" ("New Free Games") and I can't find it by typing something like "village game" or "keeper". So I have only 3 installs by me and my friends. Is it a bug or is a new app not guaranteed to get in "New Releases"? I tried to google it but found no answers. If so, how can indie developer get into the market with no money for an ad campaign? P. S. I tried to contact Google Support twice and 24 hours after first email passed with no reaction.


In Android, neat way to send input info from GLSurfaceView to onDrawFrame in GLSurfaceView.Renderer ? The input is pinch drag for camera movement, which modifies a matrix to scale translate, and sent to a vertex shader. It's working, but ugly. What's the proper way to do it? I've noticed GLSurfaceView gets onTouch callbacks but Renderer has access to GL. Shaders and textures can only be loaded after the onSurfaceCreated() callback, so should be loaded there? Touch and graphics are on different threads, so should use queueEvent() or similar. Is there a game app on github that's a good example to follow? Thanks for any help!


How can I convert an image from raw data in Android without any munging? I have raw image data (may be .png, .jpg, ...) and I want it converted in Android without changing its pixel depth (bpp). In particular, when I load a grayscale (8 bpp) image that I want to use as alpha (glTexImage() with GL ALPHA), it converts it to 16 bpp (presumably 5 6 5). While I do have a plan B (actually, I'm probably on plan 'E' by now, this is really becoming annoying) I would really like to discover an easy way to do this using what is readily available in the API. So far, I'm using BitmapFactory.decodeByteArray(). While I'm at it. I'm doing this from a native environment via JNI (passing the buffer in from C, and a new buffer back to C from Java). Any portable solution in C C would be preferable, but I don't want to introduce anything that might break in future versions of Android, etc.


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?


AndEngine edit elasticity on action I'm making a game for Android with AndEngine. It's going quite well, but now I'm stuck on something. My main character has a elasticity set in its fixturedef so it bounces around throughout the game. Now i want the user to be able to not let the player bounce when he does a control. So my question how can I modify the elasticity of my character? Because I saw you can adjust the setDensity and setFriction, but I cant see the setElasticity.... Thanks in advance!


What is the better way of generating levels in android game using LibGDX I downloaded the source code of metagun for android from https github.com libgdx libgdx tree master demos metagun metagun android The game uses a png image to create the level. It uses the following code. I am finding it difficult to understanding. The following code is from Level.java SuppressWarnings("unchecked") public Level (GameScreen screen, int w, int h, int xo, int yo, int xSpawn, int ySpawn) this.screen screen this.xSpawn xSpawn this.ySpawn ySpawn walls new byte w h entityMap new ArrayList w h this.width w this.height h for (int y 0 y lt h y ) for (int x 0 x lt w x ) entityMap x y w new ArrayList lt Entity gt () int col (Art.level.getPixel(x xo 31, y yo 23) amp 0xffffff00) gt gt gt 8 byte wall 0 if (col 0xffffff) wall 1 else if (col 0xFF00FF) wall 2 else if (col 0xffff00) wall 3 else if (col 0xff0000) wall 4 else if (col 0xB7B7B7) wall 5 else if (col 0xFF5050) wall 6 else if (col 0xFF5051) wall 7 else if (col 0x383838) wall 8 else if (col 0xA3FFFF) wall 9 else if (col 0x83FFFF) BossPart prev new Boss(x 10 2, y 10 2) int timeOffs random.nextInt(60) ((Boss)prev).time timeOffs add(prev) for (int i 0 i lt 10 i ) BossNeck b new BossNeck(x 10 1, y 10 1, prev) b.time i 10 timeOffs prev b add(prev) else if (col 0x80FFFF) Gremlin g new Gremlin(0, x 10 10, y 10 20) g.jumpDelay random.nextInt(50) add(g) else if (col 0x81FFFF) Gremlin g new Gremlin(1, x 10 10, y 10 20) g.jumpDelay random.nextInt(50) add(g) else if (col 0x82FFFF) Jabberwocky g new Jabberwocky(x 10 10, y 10 10) g.slamTime random.nextInt(30) add(g) else if (col 0xFFADF8) add(new Hat(x 10 1, y 10 5, xo 31 x, yo 23 y)) else if ((col amp 0x00ffff) 0x00ff00 amp amp (col amp 0xff0000) gt 0) add(new Sign(x 10, y 10, col gt gt 16 amp 0xff)) else if (col 0x0000ff) if (xSpawn 0 amp amp ySpawn 0) this.xSpawn x 10 1 this.ySpawn y 10 8 else if (col 0x00FFFF) Gunner e new Gunner(x 10 2, y 10 10 6, 0, 0) e.chargeTime random.nextInt(Gunner.CHARGE DURATION 2) e.xa e.ya 0 add(e) walls x y w wall player new Player(this.xSpawn, this.ySpawn) add(player) I want some advice as to whether this is a good idea or not? This game was developed in 2010 using LibGdx. The other example I found using TiledMap is at http chrismweb.com wp content uploads 2013 03 superkoala at the offical site of libgdx.


Open GL ES 2.0 Android Texture,Shader, etc... loading I have gotten texture's to load along with shader's however it seems that I can only create shaders and textures in onSurfaceCreated in my implementation of the render interface. Is this truly the only place one can create shaders, textures, ...?


Change the scale policy of OpenGL ES in Android? I currently develop a game for Android in OpenGL ES 1.0, use libgdx library. I target the 720x480 screen size. For example, I design only one arts pack for 720x480. And what will happen in Android phones with screen size smaller or bigger than it, 480x320 for instance? Could you please tell me how to change the scale policy of OpenGL ES in Android? Or in libgdx specially? Is there anything like "Resample Image" like photoshop?(Nearest Neighbor, Bilinear, Bicubic etc..) for libgdx? Edit I found some tutorials about texture filter in OpenGL, test it with Linear and Nearest. Linear is good for scaling but slow down the game, and Nearest is on the contrary. What should I do to get a balance between those?


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?


Polygon Collision Detection Android I am starting to try and figure out polygon collision detection in my Android game. I am currently doing pixel level collision detection and it just seems to be too slow (though it works). I was looking at this tool and it seems like it would be really handy to give me a set of vertices for my images. Does anyone have any ideas about how I should go about implementing this? Basically once I have a list of vertices that form a polygon, how can I detect if polygon A intersects polygon B? I can see that these vertices can be used easily with Box2D but I want to try to do this without Box2D first.


How are buttons made to be clicked? I just want to ask a general question. According to that answer, I'll continue thinking. You know in games there are lots of clickable items. Play button, exit, combo boxes, etc. My question is Are those buttons drawn in same canvas with background and all other things, or for every different thing there is another canvas object? My question is a general sense. I'm not asking about a specific game, I'm asking how they are made generally. I'm planning to start a game on Android, and I'm confused actually how to design buttons, and other object. Probably I'm going to use View SurfaceView for now. I don't have much experience with OpenGL yet. Thanks in advance.


Android how to get opengl 3D coordinates in ontouch event I created a cube in opengl and it rotates in ontouch event. To to this I created a CustomSurfaceView as follows public class CustomSurfaceView extends GLSurfaceView Override public boolean onTouchEvent(MotionEvent e) float x e.getX() float y e.getY() Here x and y are screen coordinates. How can I get 3D coordinated from this? I have already looked gluProject and NeHe. But I dont know how to implement this in my project, it shows that there is no GLdouble,GLfloat class.


2015 android multiplayer server based Implementation There are a lot of old posts about multiplayer implementations on SE, so i'm looking for an up to date answer. What is the best server client implementation of real time multiplayer now? I have an Amazon MYSQL Server hosted by digitalOcean, I've made a REST web service that communicates with the Server and Android app, and I have my Android app running receiving and sending data. I want to add a multiplayer minigame to what I have right now where 2 players would see the same screen and one user would receive location data (which i'm already storing in the server and sending to all devices with the app) from the other and would have an interface to interact with the data they're receiving (like building towers around the location and deploying units). The computer AI would need to be synced between both devices. The matches would last maybe 3 minutes tops and the location data would have to be streamed constantly as well as the interaction from the other user. The computer AI would be streamed to both. I've done a lot of research on the topic, and most of my experience was from a bluetooth P2P game I created in 2011 using sockets. So what are the most common implementations today? What are the most common libraries? I'm currently using Android Studio for the app and Notepad for the PHP webservice. EDIT I'm fine with answers promoting their own products, but explain how your product is better than Google's Game Services (which appears to be the best choice right now). I'm really looking for a way to implement the multiplayer with the server I'm already using.


2D Scrollable View with Matrix of Numbers on Android I would like to implement a 2D, scrollable view which can be scrolled horizontally, vertically or even diagonally (similar to a zoomed image which can be scrolled in any direction, but has bounds). In that scroll view, I would like to have matrix of numbers. Which component(s) should I use for this purpose.


Efficiently detecting objects inside multiple radius I would like to create a game for mobile that require to calculate multiple time by seconds which moving objects are in the radius of moving points. The game is highly inspired from Gratuitous Space Battles, the radius being from the weapons. Thus, I would like to know if it's realist to expect to be able to know among 1000 moving objects, in which radius they are among 1000 moving points 100 times per seconds on an average android device. In term of complexity, if there is an algorithm better than O(N M), N being the number of moving objects and M the number of radius from M moving center and if an algorithm can benefit from the fact that the moving objects are near their precedent position.


Phone complains that identical GLSL struct definition differs in vert frag programs When I provide the following struct definition in linked frag and vert shaders, my phone (Samsung Vibrant Android 2.2) complains that the definition differs. struct Light mediump vec3 position lowp vec4 ambient lowp vec4 diffuse lowp vec4 specular bool isDirectional mediump vec3 attenuation constant, linear, and quadratic components uniform Light u light I know the struct is identical because its included from another file. These shaders work on a linux implementation and on my Android 3.0 tablet. Both shaders declare "precision mediump float " The exact error is Uniform variable u light type precision does not match in vertex and fragment shader Am I doing anything wrong here, or is my phone's implementation broken? Any advice (other than file a bug report?)


In OpenGl ES 2, should I allocate multiple transformation matrices? In OpenGl ES 2, should I declare just one transformation matrix, and share it across all objects or should I declare a transformation matrix in each object that needs it? for clarification... something like this public class someclass public static float 16 transMatrix new float 16 ... public static void translate(int x, int y) do translation here public class someotherclass ... void draw(GL10 unused) someclass.translate(10,10) draw verses something like this public class obj1 public static float 16 transMatrix new float 16 ... void draw(GL10 unused) translate draw public class obj2 public static float 16 transMatrix new float 16 ... void draw(GL10 unused) translate draw


Sounds make Andengine Scene junky I have a GameScene which has a character (animated sprite), AutoParallaxBackground background with quite large textures and no more than 3 other items attached to the scene at a time, previous 3 items are dispose() ed accordingly, background music and item sounds. Background music is instantiated with MusicFactory, Sounds are played on SoundPool. In between switching these scene we are loading resources asynchronously, reading the streams and instantiation is done in AsyncTask and the loading textures to the hardware is done on UpdateThread GLThread. If I turn off the background music, this starts to happen totally random. I'm experiencing scene junking on at first flow MenuScene 1st Stage (GameScene). After a while lag does not happen, rather than occasionally or random. Junk is happening when aforementioned 3 items are attached on the Scene and a sound is played along, note that background music is playing at the same time. Detaching previous 3 items is "optimized" to reduce GC calling almost perfectly. When the lag occurs GC EXPLICIT is showed in the logcat. What I have tried Playing the sounds and music on different thread, IntentService, dedicated Service. Reduced calls to mScene.detachChild(child) and other scene methods to avoid iterations over children of the scene. Detaching IEntitys with matcher to avoid iteration. Inspected sound files' integrity with ffmpeg for possible errors Could .dispose(), unloading the textures from hardware or detachChild() causing this junk? Could be marked object for GC from the async tasks be causing this? What else could be contributing to this issue?


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


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?


Using AdMob with Games that use Open GLES Can anyone help me integrating Admob to my game. I've used the badlogic framework by MarioZencher ... and My game is like the SuperJumper. I am unable to use AdMob after a lot of my attempts. I am new to android dev...please help me..I went thru a number of tutorials but not getting adds displayed ... I did the following... get the libraries and placed them properly My main.xml looks like this android layout width "fill parent" android layout height "wrap content" android text " string hello" My Activity class onCreate method public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) RelativeLayout layout new RelativeLayout(this) adView new AdView(this, AdSize.BANNER, "a1518637fe542a2") AdRequest request new AdRequest() request.addTestDevice(AdRequest.TEST EMULATOR) request.addTestDevice("D77E32324019F80A2CECEAAAAAAAAA") adView.loadAd(request) layout.addView(glView) RelativeLayout.LayoutParams adParams new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP CONTENT, RelativeLayout.LayoutParams.WRAP CONTENT) adParams.addRule(RelativeLayout.ALIGN PARENT BOTTOM) adParams.addRule(RelativeLayout.CENTER IN PARENT) layout.addView(adView, adParams) setContentView(layout) requestWindowFeature(Window.FEATURE NO TITLE) getWindow().setFlags(WindowManager.LayoutParams.FLAG FULLSCREEN, WindowManager.LayoutParams.FLAG FULLSCREEN) glView new GLSurfaceView(this) glView.setRenderer(this) setContentView(glView) glGraphics new GLGraphics(glView) fileIO new AndroidFileIO(getAssets()) audio new AndroidAudio(this) input new AndroidInput(this, glView, 1, 1) PowerManager powerManager (PowerManager) getSystemService(Context.POWER SERVICE) wakeLock powerManager.newWakeLock(PowerManager.FULL WAKE LOCK, "GLGame") My Manifest file looks like this .... lt activity android name "com.google.ads.AdActivity" android configChanges "keyboard keyboardHidden orientation smallestScreenSize" gt lt application gt lt uses permission android name "android.permission.WAKE LOCK" gt lt uses permission android name "android.permission.WRITE EXTERNAL STORAGE" gt lt uses sdk android minSdkVersion "7" gt When I first decided to use the XML for admob purpose ..it showed no changes..it even didn't log the device id in Logcat... Later when I wrote code in the Main Activity class.. and run ... Application crashed ... with 7 errors evry time ... The android configChanges value of the com.google.ads.AdActivity must include screenLayout. The android configChanges value of the com.google.ads.AdActivity must include uiMode. The android configChanges value of the com.google.ads.AdActivity must include screenSize. The android configChanges value of the com.google.ads.AdActivity must include smallestScreenSize. You must have AdActivity declared in AndroidManifest.xml with configChanges. You must have INTERNET and ACCESS NETWORK STATE permissions in AndroidManifest.xml. Please help me by telling what wrong is there with the code? Can I write code only in xml files without changing the Activity class ... I will be very grateful to anyone providing support.


Libgdx Android app Avoid fullscreen and show titlebar I am developing an app using Libgdx and I don't want the app to go fullscreen and want to show the title bar but the app goes to fullscreen and hides title bar despite all efforts. Here is my style.xml file lt style name "MyStyle" parent "android Theme.Light" gt lt style gt Here is AndroidManifest.xml lt application android allowBackup "true" android icon " drawable ic launcher" android label " string app name" android theme " style MyStyle" gt lt activity android name "com.mygdx.game.android.AndroidLauncher1" android label " string app name" android configChanges "keyboard keyboardHidden orientation" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.LAUNCHER" gt lt intent filter gt lt activity gt Here is AndroidLauncher class protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) AndroidApplicationConfiguration config new AndroidApplicationConfiguration() config.hideStatusBar false initialize(new MyGdxGame(), config) setContentView(R.layout.main activity) tv (TextView)findViewById(R.id.tv) tv1 (TextView)findViewById(R.id.tv1) button (Button)findViewById(R.id.button) button.setOnClickListener(new View.OnClickListener() Override public void onClick(View v) if (Build.VERSION.SDK INT lt 19) Intent intent new Intent() intent.setType("image ") intent.setAction(Intent.ACTION GET CONTENT) startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) else Intent intent new Intent(Intent.ACTION OPEN DOCUMENT) intent.addCategory(Intent.CATEGORY OPENABLE) intent.setType("image ") startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) ) public void onActivityResult(int requestCode, int resultCode, Intent data) if (resultCode RESULT OK) if (requestCode SELECT PICTURE) Uri selectedImageUri data.getData() selectedImagePath getPath(selectedImageUri) Intent act2 new Intent(this ,AndriodLauncher2.class) act2.setData(selectedImageUri) startActivity(act2) public String getPath(Uri uri) String projection MediaStore.Images.Media.DATA Cursor cursor managedQuery(uri, projection, null, null, null) int column index cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA) cursor.moveToFirst() return cursor.getString(column index)


Should Starting a Quick Game via Google Game Services be Iterated? I have been following this tutorial for Google Play Game Services. I am a little unclear as to if the room matching algorithm should be looped or not. Can I just initialize this process once and let it time out? Or by iterating through it is it somehow rechecking it? If anyone had the approximate timeout that would be great as well. The problem stems from the fact that even when both phones are signing into the Game Services (at virtually the same time, my friend and I logged in), the room is not registering multiple people. One time my friend's phone even entered the game map, showing that he somehow was able to progress from the room initialization process. Relevant screen update methods which I am starting this matchmaking process Override public void update(float deltaTime) game.options.updateTiles() if(!isInitiated) startQuickGame() private void startQuickGame() auto match criteria to invite one random automatch opponent. You can also specify more opponents (up to 3). if(game.mGoogleClient.isConnected() amp amp !isInitiated) Bundle am RoomConfig.createAutoMatchCriteria(1, 3, 0) build the room config RoomConfig.Builder roomConfigBuilder RoomConfig.builder(Network.getInstance()) roomConfigBuilder.setMessageReceivedListener(Network.getInstance()) roomConfigBuilder.setRoomStatusUpdateListener(Network.getInstance()) roomConfigBuilder.setAutoMatchCriteria(am) RoomConfig roomConfig roomConfigBuilder.build() create room Games.RealTimeMultiplayer.create(game.mGoogleClient, roomConfig) go to game screen this.mRoom Network.getInstance().getRoom() if(this.mRoom ! null amp amp this.mRoom.getParticipants().size() gt 2) game.setScreen(new MultiGameScreen(game, this.mRoom)) isInitiated true else game.mGoogleClient.connect()


Sprite drag drop andengine How to drag an andEngine sprite anywhere on the phone screen? I have written this code in onAreaTouched function of IOnAreaTouchListener interface which is implemented in my activity, but its not working public boolean onAreaTouched(TouchEvent pSceneTouchEvent, ITouchArea pTouchArea, float pTouchAreaLocalX, float pTouchAreaLocalY) TODO Auto generated method stub Log.v(TAG,"Sprite Touched ") secondSprite new Sprite( CAMERA WIDTH 2, CAMERA HEIGHT 2, playerTextureRegion, this.getVertexBufferObjectManager()) Override public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) secondSprite.setPosition(pSceneTouchEvent.getX(), pSceneTouchEvent.getY()) System.out.println(String.format("spriteB fx f", pSceneTouchEvent.getX(), pSceneTouchEvent.getY())) return true scene.registerTouchArea(secondSprite) return true


irrlicht for android I was just wondering after noticing that moblox was.built with irrlicht if there is an android port of it? Or did the dev make his own port from scratch? From my research I noticed a port project on github but it seems far from ready.


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.


Opengl ES 2.0 Is there a way to use less resources to draw in game background texture 1.Should my in game background be drawn with my game loop renderer, or if 2.I don't want to draw my background image every frame in my main renderer since it could possibly be a heavy job while the game loop is running. Do I need to use a separate thread or some other method to achieve this? FYI, the background should be able to scale and translate with zooming function, it should be flexible.


How can I get pre release reviews of my mobile game? My iOS and Android game is at its last stage of development. Is there a way for me to get pre release reviews from people? Or maybe from the press? How should I proceed?


Rotate canvas along its center based on user touch Android I want to rotate the canvas circularly on its center axis based on user touch. i want to rotate based on center but its rotating based on top left corner . so i am able to see only 1 4 for rotation of image. any idea.. Like a old phone dialer . I have tried like as follows onDraw(Canvas canvas) canvas.save() do my rotation canvas.rotate(rotation,0,0) canvas.drawBitmap( ((BitmapDrawable)d).getBitmap(),0,0,p ) canvas.restore() Override public boolean onTouchEvent(MotionEvent e) float x e.getX() float y e.getY() updateRotation(x,y) mPreviousX x mPreviousY y invalidate() private void updateRotation(float x, float y) double r Math.atan2(x centerX, centerY y) rotation (int) Math.toDegrees(r)