How to render rounded shape perfectly? I'm having issues rendering rounded shape figures. I have a Texture with different images in it and I get this whale figure from it with TextureRegion but the stroke of it looks pixelated. The original whale image is 357x721 px and the program scalate it up or down depending on the device. And I use TextureFilter to Nearest but it doesn't solve problem as I thought it would. Does someone knows a bit about this issue? texture new Texture(Gdx.files.internal("texturepack nuevo.png")) texture.setFilter(TextureFilter.Nearest, TextureFilter.Nearest) pilar new TextureRegion(texture,591,0,357,721) whale 1 new TextureRegion(texture,0,0,591,323) whale 1.flip(false, true) whale 2 new TextureRegion(texture,0,323,591,323) whale 2.flip(false, true) whale 3 new TextureRegion(texture,0,646,591,323) whale 3.flip(false, true) TextureRegion whales whale 1,whale 2,whale 3 whaleAnimation new Animation(0.15f, whales) whaleAnimation.setPlayMode(Animation.PlayMode.LOOP PINGPONG)


Let a time counter working when an app is closed? Can we let a time counter working even if an app is closed? I would like to add a timer so that we have to wait XX seconds minutes before a building is created in a game. I don't want to use an internet connection, and if the user closes the app and just changes the time on his mobile, I cannot compare the 2 time values before and after. Would you know how to do this? Thanks


Lua or C in Cococ2d x I am going to use Cocos2d x to make a game for Android and ios, but my question is, do I use the Lua integration or only c , I see Lua useful here because the compilation thing. Or do I use only Lua for the configuration, save data and things in runtime? I don t know if using Lua for the whole game is the right thing Can anyone help me with this question and why use it or not? Thanks


How can I handle a touch event in cocos2d for Android? How can I handle a touch event in cocos2d for Android? And how to move a sprite using ccTouchesMoved?


Multiple weapons for android game I am trying to make a 3D game for android using the Rajawali engine to render the 3D graphics and blender for designing my models(exporting as .md2), and I want my character to be able to change weapons, armor, helm, etc. Rendering every possible animation would be too much if I had 10 different weapons, 10 armor and 10 helm, I would have to create 1000 animations with every possible equipment and if I add boots to list it would be even worse. I read somewhere you can use bones for this but in Android, I only get the object itself to work with. Does anyone has an idea how i can solve this? If I make the weapon a different object how do I parent it to my models in my game?


Image drawing then blackscreen on AVD using cordova I have an issue on my android JS based game, the game displays well for 1 second then total blackscreen. window.requestAnimFrame (function() return window.requestAnimationFrame window.webkitRequestAnimationFrame window.mozRequestAnimationFrame window.oRequestAnimationFrame window.msRequestAnimationFrame function( function callback, DOMElement element) window.setTimeout(callback, 1000 60) )() (function() var game canvas document.getElementById('canvas'), frameWidth 1280, frameHeight 720 game.context game.canvas.getContext('2d'), game.canvas.setAttribute('height', game.frameHeight) game.canvas.setAttribute('width', game.frameWidth) game.screens splash new Image() game.screens.splash.src "src img splash.jpg" render(game) ()) function render(game) game.context.drawImage(game.screens.splash, 0, 0, 1260, 720, 0, 0, 1260, 720) requestAnimFrame(function() render(game) ) The game works well on CocoonJS, I don't have any build error with Cordova. I tried to draw a rectangle instead of the image and it works. I'm really sure it's a drawImage() issue.


OpenGL 2.0 Android Scrolling Horizontally and Vertically I am new to OpenGL2.0 in Android. How can I scroll the GLSurfaceView both horizontally and vertically?


What Type of Options should be on the Game Settings Menu? I have seen a post about the main menu options here UI Main Menu options for mobile games. What options should be listed? What do users want to see? But I want to know what kind of options should need to be available on the settings screen. I am making a rather simple 2D game for Android, but really I haven't found many aspects that warrant an options button or a check box besides turning the sound and music on off. I was thinking graphics settings but then again, how many apps really need graphics settings besides immersive 3D ones?


Bloom does not work for Mobile Unity I've added the Mobile Bloom shader to the camera and I have Emissive HDR objects in my scene and I've set the graphics quality to the highest. I do not have anti aliasing enabled but the bloom effect only appears in the editor play mode and not on my android mobile device. If anybody could tell me all the setting I have to check or post screenshots of a working setup it would be very helpful. Thanks.


AndEngine Box2d game I'm developing a 2d survival shooter using Box2d extension and I've got some questions I have two AnalogOnScreenControls. Their listeners modify both sprites and bodies. I receive TouchEventPool was exhausted and as their number grows the game crashes accidently. I've tried to put the modification of the bodies and sprites on the UpdateThread but that does not solve the problem. What could be the cause? I have a class that at the beginnig of the game loads all the textures. After I relaunch the game activity several times I receive Unable to find Phys Addr for and "green color" interface. But that doesn't happen if I clear the memory manually through the Task Manager before relaunch What could be the cause? I unload my atlas at the end of the game. The game sometimes crashes at start with NullPointerException in onResumeGame. The solution suggested is to set android configChanges "orientation screenSize" but my device is API 10 so it doesn't have screenSize property and orientation only does not seem to help, because the game starts in portrait mode at times (though landscape is set in the code)


How should I store a Game Database on Android? I'm looking at creating a game for Android and while I have most of the ins and outs worked out, the one thing I'm struggling with is how to store data for the game. Ultimately, the game will be based off of a lot of pre defined data and statistics so the obvious choice to me would be something like SQLite, but as I'm pretty new to the realm of Android and Game Development, I'm not 100 certain if this is the right route to follow. The data will be general pre defined data as well as player data (along the lines of careers stats what place finished, etc). I was wondering if there was a better best practice solution that wasn't SQLite and that would provide said functionality and if so, could you point me in the right direction?


LibGDX music doesn't play anymore after x times In my App I added two sounds, the first is played when the gamescreen start the second when the game is going to game Over screen. Everything works fine but after about 12 13 games the second sound isn't played and until the player close completly the app and open it again every sound isn't played. How to solve? Errors 05 24 09 04 29.773 5571 5585 E AudioTrack AudioFlinger could not create track, status 12 05 24 09 04 29.773 5571 5585 E SoundPool Error creating AudioTrack 05 24 09 04 32.421 5571 5585 E MediaPlayer error ( 19, 0) 05 24 09 04 32.421 5571 5571 E MediaPlayer Error ( 19,0)


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 to use the actions of the actors in libgdx? I'd like to know if someone has already used Actions in the actors, and how to use them. I don't know how. I want to rotate an Actor.


libgdx setOrigin and setPosition not working as expected? I create a camera camera new OrthographicCamera(5.0f, 5.0f h w) Create a sprite ballTexture new Texture(Gdx.files.internal("data ball.png")) ballTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear) TextureRegion region new TextureRegion(ballTexture, 0, 0, ballTexture.getWidth(), ballTexture.getHeight()) ball new Sprite(region) Set the origin, size, and position ball.setOrigin(ball.getWidth() 2,ball.getHeight() 2) ball.setSize(0.5f, 0.5f ball.getHeight() ball.getWidth()) ball.setPosition(0.0f, 0.0f) Then render it batch.setProjectionMatrix(camera.combined) batch.begin() ball.draw(batch) batch.end() But when I render it, the bottom left of my ball sprite is at (0, 0), not the center of it, as I would expect it to be because I set the origin to the center of the sprite. What am I missing?


Android multiplayer via bluetooth How do I transfer game commands between 2 android devices via bluetooth first of all is possible to do this??If possible then someone please help in doing so.Thank u


ARCore Differentiate between two planes detected in adjacent vertical walls in the room I'm working on Vertical plane detection. When I'm pointing at wall 1 of my room, plane1 here is the vertical plane detected in wall 1... I'm recording the quaternion via this formula val quat Quaternion(plane1.centerPose.qx(), plane1.centerPose.qy(), plane1.centerPose.qz(), plane1.centerPose.qw()) Now, when I point my phone to the other wall (adjacent) of my room and check its rotation, I get the same values, I assumed this is the world rotation. Let me know if I'm wrong. Is there any other way where I could differentiate between vertical planes detected in adjacent walls I'm using this to loop through the detected planes for (plane1 in frame.getUpdatedTrackables(Plane class.java)) if (plane1.trackingState TrackingState.TRACKING) val type Plane.Type plane1.type if (type Plane.Type.VERTICAL)


How can I change width of sprite Dynamically? I want to change width of sprite dynamically but i can't perform it.!! Here i want to change only my white sprite i want to use these type of facility in my game in using AndEngine I want to display life of player


OBJ Model not being rendered properly in OpenGL ES 2 android app I have an Android OpenGL ES 2 app that loads an .OBJ model using Assimp and renders the same. The vertices data is stored in a object declared like this class CGameObject public struct Mesh std string Name Name of Mesh std vector lt float gt vertices vertices of Mesh GLuint m vbo TODO Add TEXTURE and MATERIAL support ... Set various Matrices cameraX 3.0f cameraY 3.0f cameraZ 5.0f Camera View matrix View glm lookAt( glm vec3(cameraX, cameraY, cameraZ), Camera position glm vec3(0, 0, 0), Pointing at glm vec3(0, 1, 0) Angle ) aspect (float) width height Projection Matrix Projection glm perspective(45.0f, aspect, 0.1f, 10000.0f) glm mat4 Model glm translate(mat4(1.0), glm vec3(0.0f, 0.0f, 0.0f)) MVP Projection View Model Rendering function void GLEngine DrawFrame() glClear(GL DEPTH BUFFER BIT GL COLOR BUFFER BIT) glClearColor(0.0f, 0.0f, 0.0f, 1.0f) glUseProgram(programObject) Draw of VBO BEGIN for (GameObjects iterator i gObjects.begin() i ! gObjects.end() i) CGameObject pObj i for (int x 0 x lt pObj gt Meshes.size() x ) glUniformMatrix4fv(MatrixID, 1, GL FALSE, amp MVP 0 0 ) bind VBO you want to draw glBindBuffer(GL ARRAY BUFFER, pObj gt Meshes x gt m vbo) glEnableVertexAttribArray(gvPositionHandle) glVertexAttribPointer(gvPositionHandle, 3, GL FLOAT, GL FALSE, 0, 0) if (x 0) glVertexAttrib3f(gvColorHandle, 0.0f, 0.0f, 1.0f) UcheckGLError("glVertexAttrib3f") else glVertexAttrib3f(gvColorHandle, 0.0f, 1.0f, 0.0f) UcheckGLError("glVertexAttrib3f") glEnableVertexAttribArray(gvColorHandle) My app crashes if I uncomment this line . .. any reasons why ? UcheckGLError("glEnableVertexAttribArray") glDrawArrays(GL TRIANGLES, 0, pObj gt Meshes x gt vertices.size()) unbind VBO glBindBuffer(GL ARRAY BUFFER, 0) Draw of VBO END unbind program glUseProgram(0) source for shaders vertex shader attribute vec3 in Position uniform mat4 MVP attribute vec3 in Color varying vec4 fColor void main(void) vec4 v vec4(in Position, 1.0) gl Position MVP v fColor vec4(in Color, 1.0) Fragment shader varying vec4 fColor void main() gl FragColor vec4(1.0, 0.0, 0.0, 1.0) gl FragColor fColor But the results is not what I expect. Expected What I get Loading of the Assimp model is provided in this question https gamedev.stackexchange.com questions 85808 problem rendering simple obj model using assimp in android app


Android AndEngine creating a body behind the sprite exactly I am using AndEngine for Android. I created a body, but it is not behind the sprite as I wanted. Body.setTransform(Sprite.getX() 32, Sprite.getY() 32, 0) This is what I am currently using and this is how it appears. My body is the white circular borders, and my sprite is the red circle. and When I remove 32 from the code the body doesn't even appear. Extra code FIXTURE DEF PhysicsFactory.createFixtureDef( 1, density 0.75f, elasticity 0.5f, friction false) isSensor the Body Body PhysicsFactory.createCircleBody(this.physicsWorld, Sprite, BodyType.KinematicBody, this.FIXTURE DEF) Body.setUserData("eSprite") this.physicsWorld.registerPhysicsConnector(new PhysicsConnector(Sprite, Body, true, true) my sprite is 65px ..


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


Creating offline multiplayer Android games with Unity Is it possible to create offline multiplayer Android games with Unity (played over bluetooth wi fi)? If so, then I would like to create a 2 player game prototype, containing a single room (empty cube) with 2 cubes (3rd person controllers) each controlled by one player. The cubes can be moved about as their owners (players) wish. Any movement made by any of the 2 players can be seen in realtime in the other player's display. How do I achieve this? P.S. I know some basics of Unity. I have already created a small hack amp slash game in Unity (PC standalone). I am new to Unity Android, though.


Is it possible to use SFML with the Android NDK? I've started using SFML recently and I absolutely love it. I'd like to make games that could be ported to android, linux, mac and windows, but it seems that SFML lacks portability. I've searched for a while and I've only found unrelated or unanswered questions on forums. Does anyone know of any way to use SFML with the android NDK or any plans to support it in the future?


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


How to take advantage of multiple core GPUs I'm interested in developing for the new Nexus 7 tablet when it finally arrives. I've done a little OpenGL development for Android but I'm not sure what I have to do to take advantage of the 12 core GPU on the Nexus 7. Does OpenGL take advantage of the cores for you (in some all cases) if not, how do I specify which core does what, synchronize between them etc?


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.


AndEngine drawing 2D tiled game field I'm in process of developing simple android puzzle game. I decided to choose andEngine as an engine for my game. In my game I have a gameField array, which represents a game field, where each element is a cell of game level and consists of a type of the cell (for ex. FLOOR of WALL). During the game, state of cell can be changed (for ex. DOOR CLOSED changed to DOOR OPENED), but it happens rarely, almost all the elements of gameField don't change. I tried to implement that by adding repaint method to updateHandler, which would paint sprites for each cell every tick. But I wonder wouldn't be that approach a wasting of memory and processor time? What is the best practise for doing that?


How do I "reset" the color in OpenGl ES 1.0 1.1? In my 2D game I use glColor4f() to set the color and draw my screen border rectangles but when I try to start drawing my game objects, made up of a texture on a rectangular "quad", using GL10.GL TEXTURE 2D, GL10.GL VERTEX ARRAY and GL10.GL TEXTURE COORD ARRAY no GL10.GL COLOR ARRAY, it uses the "current color" from glColor4f(). My question is what do I need to set reset in OpenGl ES to re enable it to use the colors from the texture when I try to draw them? If I comment out the border drawing, so glColor4f() never gets called, the colors are fine. I'm not using double buffering. I read that once you set the color with glColor4f() it stays set, unless you possibly use glPushAttrib(GL CURRENT BIT), but I heard that that's expensive, time wise.


How can I refer to Android assets in other directories? My project was initially not meant for Android, and its assets are organised along the following directory structure (I hope the ASCII art renders reasonably well) engine src enginefile1.cpp ... textures texture1.tex ... game src gamefile1.cpp ... textures gametexture1.tex ... ios various iOS specific files android build.xml AndroidManifest.xml jni Android.mk assets other Android specific files othergame My game android jni directory is almost empty because Android.mk points to the relative paths of the source files in engine src and game src. Actually, it even includes the proper Makefiles so that I never have to modify Android.mk when I add or remove a source file to the project. Both engine and game provide assets that need to be shipped with the Android build. I would like build.xml to refer to these assets without having to manually copy them. A rule that copies the assets at build time then deletes them would be acceptable, but of course I would prefer a zero copy solution. Does this make sense? How did others solve this cross platform build problem?


How do I create an in app update for a mobile game? I'm researching how to make an in app update on mobile game. When there is a hotfix, or an update, I don't want users to have to go to Play store, or App Store to update, but rather for them to update inside the game (like in Clash of Clans). I want to do this because Apple takes too much time for reviewing. I found https ionic.io, they use Cordova to embebed HTML inside. We can do live update, rollback to old version with a click. This is pretty suitable for normal app, but for game, the performance is not great. How can I create an in app update like this?


Having trouble going from the menu I created w Android normally to my LibGDX game file So I wanted to use Android Studio to create the menu for my game so I created a button with an onClick method that included the Intent i and startActivity(i) but when I clicked the button the app would just crash on me


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


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


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 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)


How should I control leveling up in a knowledge skill testing game? I have developed a game that tests the knowledge and skills in a series of short quiz like games. Players have to move from Level 1 to Level 16 (with Level 4, 8 and 12 as major milestones BANDS). The Difficulty level of game questions increases at each level. The level progression is currently based on 'POINTS'. Points in turn are based on Correct responses, faster responses, Wins, Completion etc. Points continue to increase for a user irrespective of Win Loss (the duration of completing the levels varies) The challenge I foresee is 'every user can progress to Level 16' if he keeps on playing the game long enough (irrespective of whether he has acquired the skill knowledge for the next level). I am looking for a simple to understand progression rule(s) that would make lower skilled players remain longer in that BAND before progressing to the next level and BAND. What are some best practices in Level progression that I can refer to for overcoming this issue. Thanks,


Application stops working when I add two fonts I created a game that has two fonts. Being precise, the two fonts are PRESS START 2P with the difference only in size. One of the fonts serves to write the title and the other for all other things. The problem occurs after building the application (apk). As it is a special font I click on the option quot copy to project quot for it to be exported to the cell phone. Image of the two fonts A detail is that the program does not recognize the original source directory, so I need to copy the source to the desktop to be able to copy it to the project. Image demonstrating the problem Adding any of the fonts (alone), the game works. The problem happens when I add the second font. Before posting here, I posted on the official engine forum, but I still haven't gotten any response. LINK https forum.yoyogames.com index.php?threads application does not work when i export 2nd font.83968


Edge Detection on Screen I have a edge collision problem with a simple game that i am developing. Its about throwing a coin across the screen. I am using the code below to detect edge collisions so i can make the coin bounce from the edges of the screen. Everything works as i want except one case. When the coin hits left edge and goes to right edge the system doesnt detect the collision. The rest cases are working perfectly, like hitting the right edge first and then the left edge. Can someone suggest a solution for it? public void onMove(float dx, float dy) coinX dx coinY dy if (coinX gt rightBorder) coinX ((rightBorder coinX) 3) rightBorder if (coinX lt leftBorder) coinX (coinX) 3 if (coinY gt bottomBorder) coinY ((bottomBorder coinY) 3) bottomBorder invalidate()


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


Word game board implementation? I'm working on a boggle type game for android, using libgdx. The user is presented with a 4x4 grid of letters and must find words by dragging their finger over the letters. Unlike boggle I want used letters to disappear. Remaining letters will fall down (to the bottom of the board, screen orientation is fixed) and the board is refilled from the top. Users can rotate the board to try and put hard to use letters in a better place by strategic word selection. An example d g a o u o r T h v R I d G n a If i selected the word GRIT, those letters would disappear and the remaining fall down d u g a h o r o d v n a and then get replaced by new letters d w x y u g a z h o r o d v n a I'm stuck figuring out how to represent the board and tiles. I tried representing the board as a matrix to keep track of tiles selected and valid moves and the tiles stored in a matrix as well so that there was an easy mapping. This works, but I had to write some convoluted code to rotate the board. How do other games handle this problem? EDIT So thinking about it, I should really just process my touch point according to the board rotation so cells stay constant. Attached an image of what I'm thinking.


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


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


2D collision detection Let's assume I'm using this character. (source iconbug.com) How would you implement collision detection for it? Using a bounding box doesn't seem to be a good approximation, because the bird's shape is nowhere near a square. I was thinking of having a sort of quad tree data structure inside the object that represents portions of the image. Each leaf could be either false (in case it covers the white transparent space outside the bird) or true (in case it represents an area of the bird i.e. beak, eye etc). Then somehow test the only obstacle in the scene for collision with the bird. But my problems in my approach are I don't know how to initialize the quad tree. Once the quad tree is initialized, I'm not sure how to traverse amp use it once the obstacle is within the coordinates of the image. How would you do collision detection with non squarish characters? LE The other approach I've seen was to use multiple bounding boxes. For example I'd have one or a few bounding boxes for the beak, then a few of them for the hair or the tail. But it can get tedious. If this is a valid approach in my case, how would I generate those bounding boxes? I doubt I'd have to have them hardcoded in my program. LE2 I care about fairly precise collisions. I can't imagine how a single bounding box or circle can at least approximate decently that shape, so this approach won't work.


On Android, why would you handle expansion files yourself instead of using Google Play? Why aren't all Android games using Google Play's ability to serve their expansion files? Why some are handling it themselves inside their apps?


How can I develop my Android game for different phone resolutions? For instance, the Motorola Droid is as wide as the G1, but has more height. Should I try to spread the UI out across the extra height found on the Motorola Droid? How do others handle this problem? I'm not using OpenGL, but a SurfaceView for a 2D game.


How to clip or mask entity in android andengine? I want to implement masking with sprite in Andengine. I want same functionality as in ios class called SKCropNode which works like an masking node! Is there any workaround like this in andengine opengl ? Thanks. Edit This is something I was trying to mask an entity, got no effect, any suggestion? public class ClippingEntity extends Entity BaseSprite protected int mWidth protected int mHeight public ClippingEntity(float pX, float pY, int pWidth, int pHeight, TextureRegion t) super(pX, pY) , pWidth, pHeight, t) mWidth pWidth mHeight pHeight Override protected void onManagedDraw(GL10 pGL, Camera pCamera) pGL.glPushMatrix() pGL.glEnable(GL10.GL SCISSOR TEST) pGL.glScissor(0 (int) mX, 800 mHeight (int) mY, mWidth, mHeight) super.onManagedDraw(pGL, pCamera) pGL.glDisable(GL10.GL SCISSOR TEST) pGL.glPopMatrix() I have also tried Stencil Test but it just clears the color of rectangle. ref opengl mask tests Ultimate goal is to disable drawing changes in specific entity where it may aslo have transparent background.


TMX crashes in Tablet 10 Android 7.0 with Andengine I've developed a video game that has worked fine so far. When testing it in a Samsung Galxy A6 tablet (10" resolution with Android 7.0), I get the following error and the map won't load Blockquote 12 09 12 49 20.940 E AndroidRuntime(9369) Process cam.main, PID 9369 12 09 12 49 20.940 E AndroidRuntime(9369) java.lang.NullPointerException Attempt to read from field 'org.anddev.andengine.opengl.texture.region.TextureRegion org.anddev.andengine.entity.layer.tiled.tmx.TMXTile.mTextureRegion' on a null object reference 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.layer.tiled.tmx.TMXLayer.drawVertices(TMXLayer.java 220) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.shape.Shape.doDraw(Shape.java 102) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.Entity.onManagedDraw(Entity.java 991) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.shape.Shape.onManagedDraw(Shape.java 120) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.Entity.onDraw(Entity.java 875) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.Entity.onManagedDrawChildren(Entity.java 1008) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.Entity.onDrawChildren(Entity.java 1000) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.Entity.onManagedDraw(Entity.java 993) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.scene.Scene.onManagedDraw(Scene.java 233) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.entity.Entity.onDraw(Entity.java 875) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.engine.Engine.onDrawScene(Engine.java 517) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.engine.Engine.onDrawFrame(Engine.java 509) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.opengl.view.RenderSurfaceView Renderer.onDrawFrame(RenderSurfaceView.java 154) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.opengl.view.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 617) 12 09 12 49 20.940 E AndroidRuntime(9369) at org.anddev.andengine.opengl.view.GLSurfaceView GLThread.run(GLSurfaceView.java 549) 12 09 12 49 21.531 E ApplicationPackageManager(4011) checkSettingsForIconTray value 0 Rest of screens that are Android native work well. Please help!


Selling Android apps from Android Market unsupported countries I am in Latvia (which the Android market doesn't support as a country for selling apps from), and I am thinking about the best way of monetizing my app. So far I've come up with these options Pretend I am from a supported country. Get a bank account there, etc. Use PayPal for in app purchases. The player gets, say, the first 10 levels for free, but is then asked to pay 0.99 for the rest of the game. Downside Players might not feel comfortable entering PayPal details into an app. Android market might not like it either. Making the app free and earning money through advertising. Let's do some calculation here Say I get 1M free downloads, each user during his playtime would see 10 banners, so 10m 1000 0.3 is about 33k if we use AdMob with their 0.3 per 1000 impressions. On the other hand, if we use PayPal and in app purchases, we need a 3 conversion rate to beat this.. What should I do? Edit From what I just read all over the net, it looks like advertisers will change their eCPM price a lot without telling you. Using in app PayPal purchases at least allow you to monitor the cash flow.


How to use the box2d contact listener in android (java port)? I don't have any idea about the box2d collision detection in android. I googled and got results that suggest to use the contact listener but I don't know how to use it in android java.


Real cash gambling app I am making a cash game like deal or no deal for use as an android app, using adobe software. The idea is player wagers 50 pence through Paypal plays the game wins, say, 10 pounds and then cash out. How do I create a cash pay and play system probably with Paypal? I have done the art work and the basic flash script, i.e. actions and movie. I will also need some sort of data feedback to prevent hacking of game, I think, and to be able to send updates and be able to remotely alter win percentages according to profits and losses. Will the user need to be connected to a server? Can someone help guide me through what the steps I need to do?


Is it possible now to make something for android in Unity3d without buying any licenses? I was just talking to a game dev who said its possible, that it involves downloading the android sdk and few other things. If this is possible can someone tell me how? Also is it possible to build a .apk file and install on your device? Is it possible to release something developed this way on the play store?


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


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


What would be the simplest way to create a 2D board game for Android? I'd like to create a very simple 2D board game for Android, it would be a concept mockup so I can see how the game works out. Let's for the sake of this question that it's a clone of Othello board game with score display, clickable game pieces spots on a square grid and some animations. I have to choose from these approaches do it all myself, draw the game on Canvas I've done one game this way, and it took some time to code it. Then, that was a casual action game and the animations would be hard to implement. implement it with Android widgets I'd use RelativeLayout TableLayout the pieces will be ImageViews this way I'd get the animations for free with Android tween animations. This would be the quickest of all solutions timewise, but I might run into some problems that may be a deal breaker. use AppInventor it may do the task, but don't know anything about it, this approach would also require some time to go through the tutorials. use a proper game engine. That will take time to learn how to use it, which I view as the biggest disadvantage as I do mostly business apps, not games. And I don't know which one to choose from. I really only want to throw this together in the shortest amount of time to see how it works, so I don't want to invest a lot of time to do it in the most "correct" way that I'll do later if the concept works.


Turn based multiplayer, Google services or Parse or.. I have a turn based game on Google play already (paid with around 2000 users and free with around 50k).i am thinking of adding multiplier option to it. I am unable to progress because I don't know which path to take (given its my first multiplier game). I need your help Like any turn based app, you have the concept of players joining in, rooms, scores and ranking (linking it with fb is preferred) For my backend server, which option should I go with? Google play game services, Parse, AppWrap.. Etc or simply me use my website server and do the server code? I am leaning towards Google Game services just because the infrastructure is there and it's free. But I don't find it to provide flexibility and control (such as using nicknames, listing rooms.. Etc) I just heard about Parse so no experience Any help or recommendations? Plzzzz need your advice


Keeping Android device awake I currently program a game in which the user don't need to interact with the screen. Is there any way to keep the screen awake?


How do I store level data in Android? I'm building a game where enemies come in waves. I want to create a file where I can define data about the waves ( of enemies, spawn times, speeds, etc.). I come from a background in iOS and would normally use something like a plist. What would be the best way to do something like this in Java and Android?


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


Adding Libxml2 to an Android project under Cocos2D X I am having problems porting Libxml2. I like it because it works under windows like a charm with lt libxml parser.h gt . When I reference the libraries I just cannot find the right path to them, their own references are broken and I don't know how to fiddle with Android.mk What is the procedure?


Examples of Android Joystick Controls? I can't seem to find any well executed code examples for Android joystick controls. Whatever it may be, algorithms, pseudo code, actual code examples, strategies, or anything to assist with the design and implementation of Android joystick controls I can't seem to find anything decent on the net. What are some well executed examples? More specifically, Pseudo Code Current Examples Idea Design Functionality Description Controller Hints Related Directly to Android Architecture What kind of classes will I have making this? Will there be only one? How would this be implemented to the game architecture? All things I am thinking about. Cheers! UPDATE I've found this on the subject Joystick Example1, though I am still looking for different examples resources. Answered my own question with a link to the code of the above video. It's a fantastic start to Android Joystick Controls.


libgdx handling battery warning I want to pause my game when the battery warning on Android pops up. How do I do this? I have a method that pauses the game but how do I call it when the battery warning pops up?


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


Sprite sheet or multiple resources When animating for the Android platform is it a better practice to create a sprite sheet with multiple states for each sprite on a single picture or should I instead export individual images for each character state etc.? Which option gives me a smaller file size for resources and which is easier for the programmer to animate?


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


Max texture size Android which settings for 2048x2048? I want to use a texture atlas of 2048 x 2048 in my game, and I would like to warn the users with a "too low" device to not download the game. With a texture atlas of this size, what requirements should I say, on ANDROID ? This image (source https stackoverflow.com questions 10392027 recommended limit for memory management in cocos2d ) shows the requirements for IPHONE, what about for ANDROID 512Mo minimum, with a 1GHz, is a correct requirement ? Thanks for your answer


How do I render Hindi text in Libgdx? How do I render Hindi text in Libgdx using any font? For example, I want to render the word " ". Here is what I have, so far import com.badlogic.gdx.Game import com.badlogic.gdx.Gdx import com.badlogic.gdx.graphics.GL20 import com.badlogic.gdx.graphics.OrthographicCamera import com.badlogic.gdx.graphics.g2d.BitmapFont import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator public class MyGdxGame extends Game SpriteBatch spriteBatch BitmapFont font OrthographicCamera camera String text, text1 private byte myBytes (byte) 0xe0, (byte) 0xa4, (byte) 0xa8, (byte) 0xe0, (byte) 0xa4, (byte) 0xbf, (byte) 0xe0, (byte) 0xa4, (byte) 0xb6, (byte) 0xe0, (byte) 0xa5, (byte) 0x89, (byte) 0xe0, (byte) 0xa4, (byte) 0xa4 private String myName new String(myBytes, Charset.forName("UTF 8")) private String hindiStr " " " INV" Override public void create() camera new OrthographicCamera() camera.setToOrtho(false, 400, 640) spriteBatch new SpriteBatch() FreeTypeFontGenerator generator new FreeTypeFontGenerator(Gdx.files.internal("font mangal.ttf")) FreeTypeFontGenerator.FreeTypeFontParameter parameter new FreeTypeFontGenerator.FreeTypeFontParameter() FreeTypeFontGenerator.DEFAULT CHARS The characters the font should contain parameter.characters hindiStr parameter.size 15 font generator.generateFont(parameter) font.setColor(1.0f, 0.0f, 0.0f, 1.0f) generator.dispose() text " " text1 " " Override public void render() Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) Gdx.gl.glClearColor(1, 1, 0, 1) spriteBatch.setProjectionMatrix(camera.combined) spriteBatch.begin() font.draw(spriteBatch, " ", 10, 30) font.draw(spriteBatch, myName, 10, 100) spriteBatch.end() Override public void resize(int width, int height) camera.setToOrtho(false, width, height) Override public void dispose() font.dispose() spriteBatch.dispose()


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 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?


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


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


Implementing a basic jump in libgdx I have seen the document for libgdx and managed to move the character and also to implement bounds but the document does not show how to implement jumping. I have downloaded the superjumper demo code but it is too confusing for me. Is there anyone here who can guide me? Say for example we have a spritebatch Spritebatch batch How can I implement a jump for this spritebatch when the screen is touched?


Scaling and new coordinates based off screen resolution I'm trying to deal with different resolutions on Android devices. Say I have a sprite at X,Y and dimensions W,H. I understand how to properly scale the width and heigh dimensions depending on the screen size, but I am not sure how to properly reposition this sprite so that it exists in the same area that it should. If I simply resize the width and heigh and keep X,Y at the same coordinates, things don't scale well. How do I properly reposition? Multiply the coordinates by the scale as well?


Viewport and Camera setting For my first game in LibGDX and Android I got a Problem I have a background picture which is 2560px 720px. The screen is 1280 720. How do I have to set the viewport and camera in order to get the following result The picture is fited in height and shows the first 1280px in width. I tried so many things and it really confused me. Gamescreen.java package com.joelbrun.jetskirider.screens import com.badlogic.gdx.Gdx import com.badlogic.gdx.Screen import com.badlogic.gdx.graphics.GL20 import com.badlogic.gdx.graphics.OrthographicCamera import com.badlogic.gdx.graphics.Texture import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.utils.viewport.FitViewport import com.badlogic.gdx.utils.viewport.Viewport public class Gamescreen implements Screen public Texture jetski, wave, background public SpriteBatch batch public OrthographicCamera camera public Label score public static final int GAMESCREEN WIDTH 1920 public static final int GAMESCREEN HEIGHT 720 public static final int OBSTACLE TYPES 5 Viewport viewport private Texture texture Override public void show() texture new Texture OBSTACLE TYPES for (int i 0 i lt OBSTACLE TYPES i ) texture i new Texture(Gdx.files.internal("game obstacles obstacle" Integer.toString(i 1) ".png")) background new Texture("game background.png") jetski new Texture("game jetski.png") batch new SpriteBatch() float aspectRatio (float)Gdx.graphics.getWidth() (float)Gdx.graphics.getHeight() camera new OrthographicCamera() viewport new FitViewport(GAMESCREEN WIDTH, GAMESCREEN HEIGHT) viewport.apply() camera.position.set(GAMESCREEN WIDTH 2, GAMESCREEN HEIGHT 2, 0) camera.position.set(0,0,0) Override public void render(float delta) Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) camera.update() batch.setProjectionMatrix(camera.combined) batch.begin() batch.draw(background, 0, 0, 5119, 720) batch.draw(jetski, background.getWidth() 2, background.getHeight() 2,128,128) batch.end() Override public void resize(int width, int height) viewport.update(width, height) camera.position.set(GAMESCREEN WIDTH 2, GAMESCREEN HEIGHT 2, 0) Override public void pause() Override public void resume() Override public void hide() Override public void dispose() batch.dispose() background.dispose() jetski.dispose() wave.dispose()


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"?


Keeping everything within one Activity Overview My game is currently based on a single activity (rather than multiple activities) and I would like to keep it that way. At the moment, it goes straight into the game at level 1. I will shortly be adding an options menu and another 20 or so levels. (As well as a high score screen, help screen etc). The thing I'm not sure about is, how do I tell the app renderer what screen part of the game to render? It's an openGL ES 2.0 app so at the moment, the method I have in my mind is something like this Code Snippets int level 0 0 means menu, 1 means level 1 etc in onDrawFrame() have something like this Override public void onDrawFrame(GL10 gl) switch (level) case 0 renderMenu() break case 1 renderLevel1() break case 2............ And so on. I would also do the same with the logic updating. Is this the way to go? I'm just not sure it's very efficient but I can't really see what the alternatives are another way I was looking into was having a separate GLRenderer for each 'screen level' but this seems much more over kill. Would appreciate some guidance as to how to display the correct screen level at the right time. Edit This is the current structure of my code Activity class public class MainActivity extends Activity Various pieces of code here class MyGLSurfaceView extends GLSurfaceView Various pieces of code here Override public boolean onTouchEvent(MotionEvent event) Touch events handles here GL Renderer class onDrawFrame() render() update()


Moving texture OpenGL ES 2.0 I am trying to implement a sprite of 8 columns and 8 rows in OpenGL ES 2.0 I made appear the first imagen but I cant figure out how to translate the Texture matrix in OpenGL ES 2.0 , the equivalent of the code in OpenGL 1.0 that I am looking is gl.glMatrixMode(GL10.GL TEXTURE) gl.glLoadIdentity() gl.glPushMatrix() gl.glTranslatef(0.0f, 0.2f, 0f) gl.glPopMatrix() This are the matrix that I am using atm Store the model matrix. This matrix is used to move models from object space (where each model can be thought of being located at the center of the universe) to world space. private float mModelMatrix new float 16 Store the view matrix. This can be thought of as our camera. This matrix transforms world space to eye space it positions things relative to our eye. private float mViewMatrix new float 16 Store the projection matrix. This is used to project the scene onto a 2D viewport. private float mProjectionMatrix new float 16 Allocate storage for the final combined matrix. This will be passed into the shader program. private float mMVPMatrix new float 16 Stores a copy of the model matrix specifically for the light position. private float mLightModelMatrix new float 16


Performance of 8 bit 16 bit games vs Android iOS games! CONTEXT I have always been intrigued by video games NES and SNES in particular. Now I am a 32 years old computer professional who has mostly done his coding in Java and C . I recently found great inclination for Android games and posting this question to much wiser community in the field for knowledge and awareness of everyone. INTRO NES brought an invasion of 8 bit games. Very sleek, very entertaining and surprisingly very compact in size few hundred Kb only. Games like Mario Contra Ninja Zelda and countless more. SNES followed the suite and brought an era of much graphically appealing games in 16 bit still the size of the games were very compact and games were very powerful. For Android, I have been doing some research for some good game engine and found that LibGDX is very powerful, open source and written for Java developers. A plus for any Android game developer. THE QUESTIONS What I am not able to understand is that how those classic game developers managed to put all those endless levels and game characters and features and goodies in just few hundred kbs! I am trying to replicate just 1 level of Mario and the size is already reaching to 300Kb, let alone adding the files code and characters sprite images! Can we implement similar principles of compact and powerful coding using Android and LibGDX? If yes, how If no, why not! Is it possible to create a game in 8bit 16bit code and then migrate it to the Android iOS platform?


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


What organic traffic can I expect from publishing on Google Play, without other marketing? I've just published a new Android game on Google Play. It has been a bit over 48 hours. It's active in the store, and I can search for it by name to get to it. However, I've had 0 organic downloads thus far, only a couple from my friends. As far as I know, it has not been shown in the "new games" list yet, and the only store listing views in the stats are the ones from myself and friends. Is there some time by which I can expect some "organic" exposure, or will I ever? Is promoting my game by other channels the only option? I'm not asking for advice on promoting my game. I'm only asking about what organic exposure I can expect on Google Play.


What needs to be done to port a Windows Flash game to Android? My team has developed a game using Flash (with Lua embeded) that targets Windows. And we want to port that game to Android (also iOS in the future). It's acceptable to rewrite the Flash part of client. And some other team in our company recommended Unity3D to replace the Flash part. Since we have no experience in Android iOS development, we would need to learn some new tool language anyway. So we would like that learning still be useful after the porting and when we starting a new game. Any thoughts? Edits I think it is worth noticing the background of the game the project is started by a tester and developer, both without knowing much about flex and actionscript. They built the game while learning, so most of the code is hard to maintain. I and other two developers joined the project after a year or so when one has leave (and the other be our manager). The other two developers are just graduates with little experience and little knowledge of flex. I am good at the server part and the c language. Based on the fact that the code is hard to maintain (and we do need to change a lot of code to make the game easier to playe in a mobile device), and I am good at c (and learning). I still tend to do the porting with Unity, which could get better performance and possibly save time.


ETC1 Performance Problem Android I wanted to support etc1, because it shoul improve the performance and loading times, but somehow its worse than using normal png files. I'm using Mali compression tool with seperate RBG pkm texture and Alpha pkm texture. I'm using a GLSL shader to deal with the alpha problem ofc ETC1. With the shader the performance is really bad. but even without the shader, just working with the RGB pkm file (where transparency is black) the performance is equal to png. does anyone know what the problem might be?


how to use texture atlas I am trying to implement texture atlas. 1) I am using the texturepackerGUI and the result is taking 2 files , one png (whicj contains all the images and one .atlas (and not .pack). 2) Now , I want to use the above instead of every seperate image. Right now , I use for example private void loadTextures() bobTexture new Texture(Gdx.files.internal("data images bob 01.png")) blockTexture new Texture(Gdx.files.internal("data images block.png")) I want to use texture atlas , so instead of the above TextureAtlas atlas atlas new TextureAtlas(Gdx.files.internal("data images bobs")) bobs.atlas Sprite bobsprite atlas.createSprite("bob 01") Sprite blocksprite atlas.createSprite("block") Now,I must initialize TextureAtlas I think because it gives me error "Syntax error on token " ", , expected".I don't know how. 3) I put TexturePacker2 in the android project (MainActivity) ... AndroidApplicationConfiguration cfg new AndroidApplicationConfiguration() cfg.useGL20 true cfg.useAccelerometer false cfg.useCompass false cfg.useWakelock true TexturePacker2.process("my gdx game android assets images ", " my gdx game android assets data", "bobs.atlas") ... The folders inside TexturePacker are ok syntaxed? Or I must remove the "my gdx game android assets "? Thanks!


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


Libgdx implement 2d drop shadow for transparent sprites I am a libgdx learner. For an learning application that I am developing using libgdx on android, I need to show drop shadow or glow effect when a sprite is touched. The sprites are created from a TextureAtlas and can have any irregular shape as per the transparent image in the texture. There are a ton of images so it is not possible to create a separate shadow image for each one. I have looked at some options but haven't been able to figure out how to do it. What I have tried include OpenGL ES drop shadows for 2D sprites I tried the approach of taking the texture and bluring it using the blurutils class provided by Matt Deslauriers at https github.com mattdesl lwjgl basics wiki OpenGL ES Blurs. The code I have used is below. But the performance was very slow on android devices for the BlurUitls.blur call. private Sprite getShadowSprite(String name,float width,float height) Load the texture Pixmap orig new Pixmap(Gdx.files.internal(name)) blur it Pixmap blurred BlurUtils.blur(orig, 16, 2, true) we then create a GL texture with the blurred pixmap Texture blurTex new Texture(blurred) Sprite shadow new Sprite(blurTex) shadow.setSize(width,height) shadow.flip(false,true) dispose our blurred data now that it resides on the GPU blurred.dispose() return shadow I do not have much of an understanding of shaders. Please advise as to what is the most performant way to be able to generate a drop shadow for a transparent image in libgdx.


What do you use to support multiplayer turn based network game for iOS and Android games? If I'm doing a turn based card game, what kind of technique do you use to support multiplayer gameplay over Internet? Is it socket? If it's socket, which SDK (CoronaSDK etc.) can provide solid socket library? Can Unity3D can be used solely to support what I need without using other socket servers like SmartFox or Electro?


Do Apple and Google ask for a share if custom payment is done in a free app? I have a multiplatform game (web iOS Android) in the making. In the free version the core game is still fully playable but people who choose to pay will get more social features (and no ads, of course). I was thinking that rather than having a free and a paid version for all the platforms I may release the apps just for free and if the users want more, they have to register and pay a one time fee (through a payment gateway or PayPal). The extra content would then be available in all the clients they have access to. Theoretically, this means a better value for the players and less maintenance and headache for me (obviously I have to handle all the payment troubles myself). Does it fit into the business model of Apple Google? Or will they still claim their share of the registration fee?


Double touch joysticks I am developing a mobile game where I need to control main character in any direction using touch analog joystick (https pineight.com mw images 6 6f Ipoc dpad.png). It's ok but I also want my character to fire in any direction. Thus I am looking for best solution of control. There are some variants, but no one is ok Target and fire by pointing finger to exact point of the screen (not comfortable, because player will need to hold device by one hand and use second hand to move over the whole device). Fire to direction where the character moves. This case will limit characters' freedom on move and target. Not good. Use second touch joystick (under opposite hand) to select fire direction this variant looks better than previous two, however I still not sure how comfortable it will be. I've tried by myself and it looks a bit complex for me to follow both controls at the same time. Did you saw any games achieving the same goal? What you can recommend?


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?


error after changing the app name I have made a game in Libgdx(eclipse).I changed the name of the app inside the string.xml file.Now I have an error in AndroidManifest.xml. in this line android label " string app name" (line 12). its written " No resource found that matches the given name (at 'label' with value ' string app name')." what is the solution?


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


Android 2D terrain scrolling I want to make infinite 2D terrain based on my algorithm.Then I want to move it along Y axis (to the left) This is how I did it public class Terrain Queue lt Integer gt bottom Paint paint Bitmap texture Point screen int numberOfColumns 100 int columnWidth 20 public Terrain(int screenWidth, int screenHeight, Bitmap texture) bottom new LinkedList lt Integer gt () screen new Point(screenWidth, screenHeight) numberOfColumns screenWidth 6 columnWidth screenWidth numberOfColumns for(int i 0 i lt numberOfColumns i ) Generate terrain point and put it into bottom queue paint new Paint() paint.setStyle(Paint.Style.FILL) paint.setShader(new BitmapShader(texture, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT)) public void update() bottom.remove() Algorithm calculates next point bottom.add(nextPoint) public void draw(Canvas canvas) Iterator lt Integer gt i bottom.iterator() int counter 0 Path path new Path() path.moveTo(0, screen.y) while (i.hasNext()) path.lineTo(counter, screen.y i.next()) counter columnWidth path.lineTo( screen.x, screen.y) path.lineTo(0, screen.y) canvas.drawPath(path2, paint) The problem is that the game is too 'fast', so I tried with pausing thread with Thread.sleep(50) in run() method of my game thread but then it looks too torn. Well, is there any way to slow down drawing of my terrain ?


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


Has anyone tried using one of those BAAS providers to create mobile games? I'm hearing a lot about different companies offering back end as a service (BAAS) for mobile apps but it seems like none of them are very successful with mobile games. Is there any reason why not outsource the server to a provider. The premise here is that the game does need a back end to implement multiplier ans social functions.


Are frequent game updates a solution for preventing multiplayer cheating? I'm creating a game on Android where the enforcement of rules can only take place on client side (I can't shift it to server side...think aimbotting but in my case I wouldn't even be able to use heuristics to detect it!). As I've read many times, the client side is impossible to 100 protect from modification hacking. I am going to include protections such as ProGuard obfuscation. But also I'm going to use a formula in the code which encrypts data from the client. Hackers cheaters can decompile the code and locate this formula eventually. But how long will it take for them to uncover the encryption formula? A day, a week? Actually, how long in general does it take for a game to be modded for cheating? Can I release updates to my game so that by the time hackers release modded versions of my app to public, they become obsolete? If I did release updates, I wouldn't require updates for single player mode, but only when they tried to do multiplayer would a message display telling them they must update. I just really want to make multiplayer fair and not scare off players because they face opponents with uber awesome hax.


Reducing Memory Use on OpenGL ES I'm using an opengl es based framework to create my game.I have an out of memory problem on some devices.I have 15 textures with a size 1024x1024(totally 10 mb).On memory they covers a lot of space.Some devices are exiting from game on loading time I want to reduce memory use and how can i do that?Maybe a solution when i loading bitmaps into memory will be great.That's my texture class Texture.java


Scene2d Stage Actor setup issues I am creating a game using libgdx. In the same each level has a class. I have stage as a member variable of the class. To this stage, I add actors. Inside the levels class, I have attaced the input processor to the stage like below. stage new Stage() sviewPort new StretchViewport(OSR Constants.VIEWPORT WIDTH, OSR Constants.VIEWPORT HEIGHT) OrthographicCamera camera new OrthographicCamera(OSR Constants.VIEWPORT WIDTH, OSR Constants.VIEWPORT HEIGHT) camera.position.set(0, 0, 0) camera.update() sviewPort.setCamera(camera) stage.setViewport(sviewPort) Gdx.input.setInputProcessor(stage) The level object is instantiated in another class known as GameScreen. GameScreen implements the Screen interface. I am unable to detect touch events on my actors in the stage. Each actor has also been given bounds as per the world coordinates. I have added the following code on each actor to detect touch this.addListener(new InputListener() public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) System.out.println("touchdown at " x " " y) return true )


Native crashes on UE4 android game only in distribution build As I build my game for development mode and install it directly from apk file to my device, it runs without errors and doesn't crash, there are in game ads and it is able to get variables from game saves. But once I build with Shipping and Distribution tags and upload it to Google Play I get errors on all devices that it is tested. (Installing directly through apk also crashes it.) Here are backtraces Build fingerprint 'motorola harpia harpia 6.0.1 MPI24.241 2.35 1 1 user release keys' Revision 'p1b0' ABI 'arm' pid 14791, tid 14855, name Thread 932 gt gt gt com.MadElectron.FarmPlanet lt lt lt signal 11 (SIGSEGV), code 1 (SEGV MAPERR), fault addr 0x0 r0 00000000 r1 00000000 r2 00000001 r3 00000000 r4 000084fa r5 95bd3280 r6 00000000 r7 00002888 r8 9dbb5fd4 r9 980edb20 sl 96d7f100 fp 9dbb5f88 ip a274d504 sp 9dbb5f60 lr 9fd0eed4 pc a162ad24 cpsr 20070010 backtrace 00 pc 0344dd24 data app com.MadElectron.FarmPlanet 1 lib arm libUE4.so ( ZN22FSessionServicesModule13StartupModuleEv 72) 01 pc 01b32058 data app com.MadElectron.FarmPlanet 1 lib arm libUE4.so ( ZN14FModuleManager27LoadModuleWithFailureReasonE5FNameR17EModuleLoadResultb 432) 02 pc 01b31e98 data app com.MadElectron.FarmPlanet 1 lib arm libUE4.so ( ZN14FModuleManager10LoadModuleE5FNameb 76) 03 pc 0196bee8 data app com.MadElectron.FarmPlanet 1 lib arm libUE4.so ( ZN11FEngineLoop4InitEv 1752) 04 pc 0196aa10 data app com.MadElectron.FarmPlanet 1 lib arm libUE4.so ( Z11AndroidMainP11android app 2568) 05 pc 0196e618 data app com.MadElectron.FarmPlanet 1 lib arm libUE4.so (android main 108) 06 pc 01981bc8 data app com.MadElectron.FarmPlanet 1 lib arm libUE4.so 07 pc 00041acb system lib libc.so ( ZL15 pthread startPv 30) 08 pc 00019355 system lib libc.so ( start thread 6)


Detecting Screen Resolution in Android AndEngine to display high or low quality images I am developing a game with 1024x600 resolution. I can't target smaller resolution devices at this resolution, so I intend to use two graphics for the game. How do I detect which graphics to use for which device?


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 ?


Javascript board game looking for optimization I posted this question on stackoverflow before but received no answers so I decided to post it here and see if someone could suggest me something. I'm working on a html javascript game for android. It's a board game which does the following. It has tiles of different colors and user can place one tile (chosen programatically) on the board. If we get 4 or more tiles of the same color shape we score some points and these tiles will disappear. The tiles above the removed tiles will replace them and new tiles will be added to the empty places. The image below shows how it works (this is just an example, the real board can have different dimensions) The Tiles are lt img gt elements with their ids stored in an array which I use to check for matches and replacement. It all works pretty well but once the new tiles are added to board I need to examine the whole board to check if new matches are avalable. And I want some advice here, because examining the whole board can be really slow. Is there a way I can do this efficiently? Here's what I thought about doing Given the previous example, I thought about examining only the elements in the red area, i.e. only the elements that have been moved or added. It can be effective if the tiles move vertically, as I'll only have to check the moved added tiles and it'll give me the new matches. But in case where I remove tiles horizontally it can be problematic, because if these tiles are at the bottom i'll have to examine the whole board and i confront the same problem. Any advice or suggestion will be appreciated. Note I didn't add any code because it simply consists of checking the lines and columns for a given tile and look for matches. But if needed I can provide it. EDIT Adding horizontalMatchCheck function that for a given index checks for matches horizontally. It's the same thing for vertical check. function horizontalMatchCheck(itemId) hArray new Array() if (rightMatch(itemId)) var index itemId 1 hArray.push(itemId 1) while (rightMatch(index)) hArray.push(index 1) index if (leftMatch(itemId)) var index itemId 1 hArray.push(itemId 1) while (leftMatch(index)) hArray.push(index 1) index if gt 4 matches found I replace the indexes with 5 (because no other tile can have this id) which'll then be removed and shifted. if (hArray.length gt 3) hArray.push(itemId) for (var i 0 i lt hArray.length i ) board hArray i items.length else hArray new Array() function rightMatch(pos) return (!isRight(pos) amp amp board (pos 1) current) ? 1 0 function leftMatch(pos) return (!isLeft(pos) amp amp board (pos 1) current) ? 1 0


In Unity, on an Android device, CaptureScreenshot writing to Phone, but persistentdatapath linking to the external card I'm using CaptureScreentshot() to get an image. But when I try to access it on an Android device it's giving me Could not find file " storage emulated 0 Android data appname screenshot.png" When I go the external storage, it's not there, but rather on the phone storage. So why is persistentdatapath accessing something different? My code is the following byte Bytes File System.IO.File.ReadAllBytes(currentScreenshotPathname) with thepathname obtained using currentScreenshotPathname System.IO.Path.Combine(Application.persistentDataPath, currentScreenshotName) Is there anyway to make the persistenDataPath go to the phone storage rather than emulated to read the file? I've tried changing the WriteAccess perimission to Externalas well as Internal in the player settings, but it's still the same. Edit Here's what's happening PersistentDataPath is storage emulated 0 Android data myapp files , but the screenshot is being saved to mnt sdcard Android data myapp files, despite the documentation saying that it should save to the PersistentDataPath.


Cannot draw around the screen after zooming out with LibGDX projection coordinate I've just started developing game in android using LibGDX. I've follow some samples and now my simple game can draw path when user move their finger around the screen. now problems appear when i add another feature to allow user to pinch zoom in and out. after zooming OUT the orthographic camera user can still draw the path BUT the path can no longer follow user finger to the edge of the screen, the user can only draw the path around the center of the screen. looks like the coordinate projection after zoom out not changed and still limited to the projection before zoom out! how can i make my game to keep drawing line around the entire screen even after the user have zooming out the camera? here's my code nbsp nbsp nbsp 1. in my Screen implemented class Override public void render(float arg0) Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) Gdx.gl.glEnable(GL20.GL BLEND) Gdx.gl.glBlendFunc(GL20.GL SRC ALPHA, GL20.GL ONE MINUS SRC ALPHA) renderer.render() Override public boolean touchDragged(int screenX, int screenY, int pointer) TODO Auto generated method stub isDrawing true Vector2 v new Vector2(screenX, Gdx.graphics.getHeight() screenY) add new point for drawing path inputPoints.insert(v) return true nbsp nbsp nbsp 2. in my Renderer class cam new OrthographicCamera() cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) this.cam.update() public void setZoom(float zoom) this.cam.zoom zoom this.cam.update() the triangle strip renderer path new PathClass() public void render() cam.update() batch.setProjectionMatrix(cam.combined) generate the triangle strip from our path Array lt Vector2 gt xox screen.path() path.update(xox) the vertex color for tinting, i.e. for opacity path.color Color.WHITE render the triangles to the screen path.draw(cam) nbsp nbsp nbsp 3. on my PathClass public void draw(Camera cam) if (tristrip.size lt 0) return gl20.begin(cam.combined, GL20.GL TRIANGLE STRIP) for (int i 0 i lt tristrip.size i ) if (i batchSize) gl20.end() gl20.begin(cam.combined, GL20.GL TRIANGLE STRIP) Vector2 point tristrip.get(i) gl20.color(color.r, color.g, color.b, color.a) gl20.vertex(point.x, point.y, 0f) gl20.end()


Making body (box2d) a sprite (andengine) in Android I can't make body (box2d) a sprite (andengine) and at the same time apply MoveModifier to sprite which is body. If i can make just body, it works namely the sprites can collide. If I apply just MoveModifier to sprites, the sprites can move where i want. But I want to make body (they can collide) and apply MoveModifier (they can move where I want) at the same time. How can i do it? This my code just run MoveModifier not as body at the same time. circles i new Sprite(startX, startY, textRegCircle i ) body i PhysicsFactory.createCircleBody(physicsWorld, circles i , BodyType.DynamicBody, FIXTURE DEF) physicsWorld.registerPhysicsConnector(new PhysicsConnector(circles i , body i , true, true)) circles i .registerEntityModifier( (IEntityModifier) new SequenceEntityModifier ( new MoveModifier(10.0f, circles i .getX(), circles i .getX(), circles i .getY(),CAMERA HEIGHT 64.0f))) scene.getLastChild().attachChild(circles i ) scene.registerUpdateHandler(physicsWorld)


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


Faster way to draw dynamic meshes in OpenGL ES I'm writing a 3D game which is going to inlcude some dynamic meshes. For now, my code looks like this private float mVertices private FloatBuffer mVertexBuffer public void onDrawFrame(GL10 gl) first clear the screen of any previous drawing gl.glClear(GL10.GL COLOR BUFFER BIT GL10.GL DEPTH BUFFER BIT) initialize the matrix gl.glMatrixMode(GL10.GL MODELVIEW) gl.glLoadIdentity() update the vertex data for (int vtx 0 vtx lt mVtxCount vtx) fill in the x, y and z components of the vertex position mVertices vtx 3 x mVertices (vtx 3) 1 y mVertices (vtx 3) 2 z update the vertex buffer mVertexBuffer.clear() mVertexBuffer.put(mVertices) mVertexBuffer.position(0) render the vertex buffer gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glVertexPointer(3, GL10.GL FLOAT, 0, mVertexBuffer) gl.glDrawElements(GL10.GL LINES, mIndices.length, GL10.GL UNSIGNED BYTE, mIndexBuffer) Here is an easy sample as the index buffer does not change so I only update the vertex position, normal and texture coordinates. Of course I understand dynamic mesh will always be slower to render than static mesh, but I wonder if the method I use is good or if there is a faster better way to do this .


Open GL ES 2.0 with Android I was wondering if someone could recommended a book that covers both android game developement and OpenGL ES 2.0. I have found some books with OpenGL 1.0, but I have heard that the syntax for OpenGL es 2.0 is totally different.


AndEngine How to add multiple fixtures into body? I want to create a custom body which have very random shape like a table. So how to add combine multiple fixtures into a body?


Is there a way to use the RGB channels of a texture as the alpha channel when applying multitexturing using OpenGL ES 1.1? I have been trying to get texture compression using ETC1 (specifically PKM files) working for some time now. I am trying to do this without having to upgrade to OpenGL ES 2 so I have been using multi texturing. I have the multi texturing working now (finally) but the problem is that it is not behaving as one would expect and I think that I have figured out why. When creating the PKMs you end up with PKM with the color components only and one with the alpha component only. Problem is that the alpha PKM seems to be storing the alpha value in the RGB channels. Black seems to represent full transparency and white seems to represent full opaqueness. My question is Is there a way to combine and convert these RGB values into an alpha value when using multi texturing? If not, then I don't see any options for using ETC1 and supporting alphas under OpenGL ES 1.1 (please correct me if I am wrong).


Human vs human android chess game design First of all I am total amateur in game development and sorry for my poor English. I want to make android human vs human chess game. So I am wondering how to design it? scenario 1 User connect to server, find opponent and send moves to server using socket, so match is running on a server side. I think this is not good idea because move should be validated on client side or do I have to validate moves on client side? I do not think this is good solution because game is seperated. scenario 2 Using hole punching technique so server is needed only for connection between players, so game is running on android devices. which approach do you suggest? Or is there any better solution? Which server is best to use?


Android sprite sizes? When creating an android game for example space invaders. How big would the sprites have to be? The Enemy ships and player ship and boss ships. So they fit on the android phone and is playable. I'm confused between resolution and this. Thanks.


Poor image quality on Android through Unity Remote I have started to work on the company's latest project using Unity3D and the workflow is just awesome. The problem is when running the game on a real Android device (using Unity Remote) the image quality is very poor in comparison to how it looks in the editor (Click for a full view. Look at those sprite edges.) Is this... caused by the phone's limited graphics capabilities or have I configured the project improperly or is it Unity Remote and actually building it for Android will fix the quality? (Based on Unity Answers site, Unity Remote is the cause http answers.unity3d.com questions 408896 android image quality is poor compared to the qual.html comment 408945)


Alternative to Google Play when publishing Android game app (.apk)? In order to register as a game developer and publisher of the Android app for Google Play Developer account, you must pay around 100. But what if there's a tight budget, especially for indie game developers from the start? I want to know where can I find alternatives to publish and promote Android game apps with no registration cost. It is something like a stepping stone.


How to implement a Trail using Cocos2dx I'd like to implement a trail (like the white circles in Angry Birds) that chase my sprite. I already used CCMotionStreak, but the trail texture is "stretched" instead. Anyone has an idea how to make this?


Setting density for Android game I am developing an Android game, in which a ball (bitmap) translates( is in motion). So I have provided motion equations for the ball. I have checked my app on Samsung galaxy S2 whose actual density is roundly 252 dpi, and It works fine on that. So my question is that Does these motions of bitmaps in surfaceView, depends on actual density of phone( i.e 252 dpi for S2) or generalized density(i.e 240 dpi). I am confused whether if I run this app on 235 dpi smartphone, So will it have the same performance of motion as it is on Galaxy S2( with 252 dpi) or it would be little slow ? Any help will be appreciated. Let me elaborate it with coding. For example a linear motion of a ball is defined as with this equation x x 4 Now If I run this app, on Samsung galaxy S2(252dpi, and hdpi), So It will give me a particular speed motion, let say P is the speed of the ball. Now If I run this application on Samsung Galaxy S3(300 dpi, xhdpi), So the ball speed gonna be slow on this density, meaning less than the speed P. So I will need the same speed on xhdpi density phone. So will use these conversion formulas dx (x 160) 240 px (dx 320) 160 Hence the speed will be either exact or little different from P.(This is my confusion). That Whether the speed will be as same as it was on S2. So my Question at this point is that my app worked on Samsung Galaxy S2 with the speed p, that I desired. As S2 is of 252 dpi, So Should I Include 240(Generalized density or 252 (Actual density) in my this line of coding ? dx (x 160) 240 Thanks !


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


How to change the KEYSTORE securely? I'm wanting to release a free version of an app to which I've already made a paid version. I simply copied the project to another folder The project is initially the same as the paid application when finalized. I want to simply delete a few phases and put a link that takes the application paid in the Google Store (this I know how to do) Turns out there is something called a keystore. I would like to know if only thing I have to do is create a file.keystore in the directory with different name, rename the Filename (before Password) and click the generate button (below Country). OBS Obviously I will make a backup copy of the paid version file.keystore.


JBox2D simple example for Android? I'm starting to develop an Android game. I've already installed jBox2D but I can't find complete code to develop a simple application from scratch using this framework. Thanks in advance!