Using buttons on Smartphone shooter games Just a simple and probably stupid question. I noticed that many iOS and Android shooter games tend to avoid using traditional buttons in favour to autofire. The very first reason to do so is to have more space in the screen available for graphics. However this takes away some satisfaction to the user when "pressing the virtual button". I understand that the fact that smartphone buttons would be only "virtual" is a good design reason to remove them and add autofire, but I was wondering which sort of comments your users (if u are one of those developers) have given you about this choice. In short Does autofire add to the gameplay? Does a game without autofire (and hence buttons) result inadequate for a smartphone and or become less fun to play?


Saving an interface instance into a Bundle All I've have an interface that allows me to switch between different scenes in my Android game. When the home key is pressed, I am saving all of my states (score, sprite positions etc) into a Bundle. When re launching, I am restoring all my states and all is OK however, I can't figure out how to save my 'Scene', thus when I return, it always starts at the default screen which is the 'Main Menu'. How would I go about saving my 'Scene' (into a Bundle)? Code import android.view.MotionEvent public interface Scene void render() void updateLogic() boolean onTouchEvent(MotionEvent event) I assume the interface is the relevant piece of code which is why I've posted that snippet. I set my scene like so ('options' is an object of my Options class which extends MainMenu (Another custom class) which, in turn implements the interface 'Scene') SceneManager.getInstance().setCurrentScene(options) Current scene is optionscreen


How to rotate a sprite using multi touch with AndEngine? I am new to Android game development. I am using AndEngine GLES 2. I have created a box with a sprite. This box is now draggable by using the code below. It works fine. But I want multi touch on this I want to rotate the sprite with two fingers on that box, and to keep it draggable. I've no idea how do do that, which way should I go? final float centerX (CAMERA WIDTH this.mBox.getWidth()) 2 final float centerY (CAMERA HEIGHT this.mBox.getHeight()) 2 Box new Sprite(centerX, centerY, this.mBox, this.getVertexBufferObjectManager()) public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) this.setPosition(pSceneTouchEvent.getX() this.getWidth() 2, pSceneTouchEvent.getY() this.getHeight() 2) float pValueX pSceneTouchEvent.getX() float pValueY CAMERA HEIGHT pSceneTouchEvent.getY() float dx pValueX gun.getX() float dy pValueY gun.getY() double Radius Math.atan2(dy,dx) double Angle Radius 360 Box.setRotation((float)Math.toDegrees(Angle)) return true


Mobile game without game engine I am planning on making a 2D mobile game for iOS and Android. It will have animations (including some simple flash light and particle effects, like in Candy Crush), but the only physics the game will need is hit detection between 2 circles, and dragging a sprite across the screen. And the game isn't very complicated. Since these would be easy to implement on my own, I'm considering using the native iOS Android SDKs for this (on Xamarin), with no game engine. Is this a good or bad idea? Would avoiding using game engines, and using the native SDKs (on Xamarin) improve the performance of my game? Wouldn't fixing bugs become easier (in some odd cases) since both platforms are separated into different builds code? Looking at games like Candy Crush, I don't see any physics involved and so believe that a game engine isn't even needed for a game like that. Any advice suggestions would be appreciated.


TiledMap taking a lot of time to load in libgdx I am developing a game using libGdx in which a level has 2400 450 tiles Map and each tile is of 4 pixels. I am also using box2d in my game. My problem is that when I run the game on my phone it takes a lot of time to load the screen (more than a minute). How can I reduce this loading time? I created tilemap using Tiled and I am using Android Studio. Below is my code (SCALE is 2.0f and PPM is 4) Override public void show() w Gdx.graphics.getWidth() h Gdx.graphics.getHeight() camera new OrthographicCamera() camera.setToOrtho(false, w SCALE, h SCALE) camera.update() viewport new FitViewport(w SCALE, h SCALE ,camera) viewport.apply() . . . map new TmxMapLoader().load("maps lvl3.tmx") tmr new OrthogonalTiledMapRenderer(map, 1 SCALE) Override public void render(float delta) update(Gdx.graphics.getDeltaTime()) Render Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) tmr.render() . . . b2dr.render(world, camera.combined.scl(PPM)) public void update(float delta) world.step(1 60f, 6, 2) cameraUpdate(delta) tmr.setView(camera) batch.setProjectionMatrix(camera.combined) Override public void resize(int width, int height) camera.setToOrtho(false, width SCALE, height SCALE) viewport.update( width , height ) Please help and thanks in advance


Using the AssetManager in LibGDX I am trying to use the AssetManager class in LibGDX and I understand how it works but I am trying to implement a loading screen. I have followed the AssetManagerTest.java file here, but I am having a hard time trying to figure out how to get it to work correctly. Can someone point me in the right direction? My goal is to load the assets (textures, sounds, fonts, ... etc) and update a bar with the percentage complete on the screen. I don't understand the ResolutionFileResolver and the Resolution in the link I provided. What are they for? My goal is to support a static class that can give me access to all of the assets I need in my game from any screen. Is there a preferred method to do this? Thanks.


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)


libGDX AppWarp integration problem I have tried to use up AppWarp's old SuperJumper as a sample to create an up to date project from it with Gradle. Maybe it is good for learning. So, I have downloaded project from GitHub(https github.com SauravGShephertz libgdxMultiplayerSuperJumper) as zip and started to build a new Gradle based libGDX project from it. Here you can see actual state https github.com kovacsa91 superjumper I have some errors with following lines. com.shephertz.app42.gaming.multiplayer.client.command. Maybe it cannot found needed JAR file(s)? How should be it placed? Can you please check it out? Code was separated between project folders inside the main libGDX project.


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


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


Memory leak while loading libgdx game screen So, I have a lot of texture atlases in my code for a talking tom type libgdx, and I use around 6 of them per screen. The app crashes abruptly without any errors on devices with 1gb ram or less. I started profiling my code and found that I have 3500 texture bindings, how should i minimize these?


Real time multiplayer game server development I'm an Android developer, and I want to start developing a real time multiplayer game, like Pocket Legends. Would this type of server be good for a real time multiplayer action game http systembash.com content a simple java udp server and udp client ? I'm absolutly new to server development, so it would be great if you explaind even more about this stuff ...


Mobile Game Google Play no supported dev country and capitalization alternatives (no policies violation or suspicious behavior)? If my country is listed as not supported as a developer country (for payments), this mean developer can upload app but no make any money with it. If I understood correctly, not even in app ads are allowed (I have my doubts about ads because It has no sense they aren't allowed). Is there any mean, friendly with Google policies, to monetize the app? For example Desktop version is free to play. Optional content requires a payment. Mobile version is free to play. Optional content requires you to log in with same account you used to purchase it on desktop. No ads and no in app purchase in mobile version. Is the above scenario OK? Which are the alternatives? Notes To me, no ads has no sense. After reading Developer Console documentation I assumed that ads are OK but after doing some research It turns on that many people thinks that ads are not OK.


How can I hand out free copies of my otherwise paid Play Store game? With Google Play Services, is it possible to give people redeemable codes for an Android game I made, or give them special access or something like that? How do I do it?


Android how do I switch between game scenes in a game? Any tutorials? I am trying to create a simple game using the Android SDK without using AndEngine (or any other game engine). I have plenty of experience designing games from the past, but I'm having lots of trouble trying to use the Android SDK to make my game. By far my biggest hurdle right now is switching between views. That is, for example, going from the menu to the first level, etc. I am using a traditional model I learned (I think it's called a scene stack or something?) in which you push the current scene onto a stack and the game's main loop runs the top item of the stack. This model seems non trivial to implement in the Android SDK, mostly because Android seems to be picky about which thread instantiates which view. My issue is that I want the first level to show up when you press a button on the main menu, but when I instantiate the first level (the level class extends SurfaceView and implements SurfaceHolder.Callback) I get a runtime error complaining that the thread that runs the main menu can't instantiate this class. Something about calling Looper.prepare(). I figured at this point I was probably doing things wrong. I'm not sure how to specifically phrase my issue into a question, so maybe I should leave it as either 1) Does anybody know a good way (or the 'proper' way) to switch between scenes in an Android game? or 2) Are there any tutorials out there which show how to create a game that doesn't take place entirely in one scene? (I have googled for a while to no avail... maybe someone else knows of one?) Thanks!


How to increase the acceleration of an object on the Y axis? So far I am able to make the character fall at a constant rate but I am unsure how to make the character accelerate while falling. When the character is falling I have a line of code as such position.y 7f How can I change my implementation such that the character falls faster over time?


Memory issues with new game on s3 I am building a new game with AndEngine and for some reason i keep getting this debug statement in the Logcat 01 31 21 29 50.503 I Choreographer(697) Skipped 152 frames! The application may be doing too much work on its main thread. Im not really sure what is causing this error exactly during my game. I am checking a lot of collisions, but they arent initiated until after the game play scene has started. I also noticed on my Galaxy S3 the game causes my phone to "flicker" when swiping changing home screens and pulling down the task bar at the top. I think this error has something to do with it, but I am not sure. What do you guys think? Also each time the user goes to another level I initialized the collision detectors all over again. But I don't unregister or stop the last collisions that were started. I thought they would be automatically cleaned up when the new one is initialized. What do you guys think?


Can you embed a Unity3d mobile project into an existing native mobile app? I am creating an application for both Android and iPhone that will have a few mini games in it. I would like to create the non game section in native Android and iPhone. My question is, is it possible to have a native app that will incorporate the Unity mini game I am creating all inside one apk and ios project?


Android TV game development Anybody develop games for Android TV? Especially with libGDX? I would like to know what game controllers Android TV uses? And whether we can use libGDX to control the game controllers?


LibGDx android Show animation on button click I am trying to create an application using libgdx where i need an animation to be played on pressing an image button, i've been able to achieve it using this code if(slapBossFlag true) currentFrame animation.getKeyFrame(timePassed, true) batch.begin() timePassed Gdx.graphics.getDeltaTime() Gdx.app.log("time","time is" timePassed) batch.draw(currentFrame, screenWidth 2 ((currentFrame.getRegionWidth()) 2), screenHeight 2 ((currentFrame.getRegionHeight()) 2)) batch.end() slapBossFlag false the problem is the animation goes by too quickly. i've tried setting timePassed to zero when slapBossFlag is false, and that didnt work. Can anyone help?


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!


Saving an interface instance into a Bundle All I've have an interface that allows me to switch between different scenes in my Android game. When the home key is pressed, I am saving all of my states (score, sprite positions etc) into a Bundle. When re launching, I am restoring all my states and all is OK however, I can't figure out how to save my 'Scene', thus when I return, it always starts at the default screen which is the 'Main Menu'. How would I go about saving my 'Scene' (into a Bundle)? Code import android.view.MotionEvent public interface Scene void render() void updateLogic() boolean onTouchEvent(MotionEvent event) I assume the interface is the relevant piece of code which is why I've posted that snippet. I set my scene like so ('options' is an object of my Options class which extends MainMenu (Another custom class) which, in turn implements the interface 'Scene') SceneManager.getInstance().setCurrentScene(options) Current scene is optionscreen


Concerns about APK version compatibility I'm making a game in Unity, and i want to know if I generate the apk in version 4.1 Jelly Bean he will run in newest versions of android? Can anyone explain me better how the version works?


Bitmap to a custom coordinate pair when touched I am completely lost and needed some help. I have a ontouchListener for a bitmap and know how to check if the touch was within the boundaries of the bitmap. But say I want the center of the image to be at a custom coordinate like 0,0 and the entire image to be in the range of 319...319 and 239...239 . Does any one have any thoughts on how to best implement an eventX and eventY to a custom coordinate pair?


Ball Physics for Android Game I am starting work on a new Android game and I haven't had any experience implementing physics before. I am trying to steer clear of external libraries such as box2d, not just because I think it is overkill for my project, but I also want to code it myself for the experience. I am more just interested in getting 1 ball to bounce around the screen and bounce off of objects in my world. The game is in 2D and I was just looking for some advice on where to start with ball physics? I know I will need gravity, x y velocities... etc. I know I need to calculate how high the ball needs to bounce based on how fast it hit the object, I also know I will need to calculate the correct angle that the ball needs to bounce at. Just hoping to get some ideas on a good place to start and things I will need to take into account.


Disable autorotation if Android has it disabled I'm making a game for Android in Unity. I wanted the game to handle screen rotations, so I set "Default Orientation" to "Auto Rotation. This works well, except for one issue If you disable auto rotation in the device's settings, the game ignores this and keeps autorotation. How would I go about making it disable autorotate when the Android device is set to disable autorotate?


How to remove a box2d body when collision happens? I m still new to java and android programming and I am having so much trouble Removing an object when collision happens. I looked around the web and found that I should never handle removing BOX2D bodies during collision detection (a contact listener) and I should add my objects to an arraylist and set a variable in the User Data section of the body to delete or not and handle the removing action in an update handler. So I did this First I define two ArrayLists one for the faces and one for the bodies ArrayList lt Sprite gt myFaces new ArrayList lt Sprite gt () ArrayList lt Body gt myBodies new ArrayList lt Body gt () Then when I create a face and connect that face to its body I add them to their ArrayLists like this face new AnimatedSprite(pX, pY, pWidth, pHeight, this.mBoxFaceTextureRegion) Body BoxBody PhysicsFactory.createBoxBody(mPhysicsWorld, face, BodyType.DynamicBody, objectFixtureDef) mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(face, BoxBody, true, true)) myFaces.add(face) myBodies.add(BoxBody) now I add a contact listener and an update handler in the onloadscene like this this.mPhysicsWorld.setContactListener(new ContactListener() private AnimatedSprite face2 Override public void beginContact(final Contact pContact) Override public void endContact(final Contact pContact) Override public void preSolve(Contact contact,Manifold oldManifold) Override public void postSolve(Contact contact,ContactImpulse impulse) ) scene.registerUpdateHandler(new IUpdateHandler() Override public void reset() Override public void onUpdate(final float pSecondsElapsed) ) My plan is to detect which two bodies collided in the contact listener by checking a variable from the user data section of the body, get their numbers in the array list and finally use the update handler to remove these bodies. The questions are Am I using the arraylist correctly? How to add a variable to the User Data (the code please). I tried removing a body in this update handler but it still throws me NullPointerException , so what is the right way to add an update handler and where should I add it. Any other advices to do this would be great. Thanks in advance.


Streamline Facebook and Google Play Game Services integration in Android Game This has been confusing me a lot . I am creating a simple 2D platformer which I wish to make social. So I thought of letting users do the following Share their in game objective completion their high score etc with their friends. Challenge their friends to have a better score better multiplier etc from their's View leaderboards of high score , most distance traveled etc both social and global. So My First preference was Facebook , simply because people have better social connections there. But then Google Play game services integration has another advantage, It makes you game available in their game services app and may be boost your game ranking in play store if you have game services integrated. But then I'' need to have leaderboards(same ones) for google plus as well. That 'll be too confusing for people. I do not want people to sign in twice in my app. That'll simple cut down and disperse the number of people getting social with the game. I personally want to use facebook alone but then google game services may be boosts my app in store. Can someone tell me a solution to use them both frictionlessly and get the most out of them in my game


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


Actor not taking touch libGDX I am trying to handle the touch of one of the Actors in the stage. The following is the code I have written public class MyGame extends ApplicationAdapter private GameStage gameStage Game stage is custom stage class. Override public void create () gameStage new GameStage() Gdx.input.setInputProcessor(gameStage) Set the input processor Override public void dispose() super.dispose() gameStage.dispose() Override public void render () Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) gameStage.act(Gdx.graphics.getDeltaTime()) gameStage.draw() Now in the GameStage class public class GameStage extends Stage implements ContactListener MyActor myActor Custom actor object. public GameStage() super(new ScalingViewport(Scaling.fill, Constants.APP WIDTH, Constants.APP HEIGHT, new OrthographicCamera(Constants.APP WIDTH, Constants.APP HEIGHT))) setUpWorld() Code to setup the world. added background and other actors. none of them are touchable. addActor() private void addActor() myActor new MyActor(100, 100, 100, 100, 1000, 0) myActor.setTouchable(Touchable.enabled) myActor.addListener(new InputListener() Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) actorTouched() This method is not getting triggered becaused the call never comes in this function. return true ) addActor(myActor) The custom actor class initializes the actor with a sprite image. public class MyActor extends Actor public MyActor(int startX, int startY, int startWidth, int startHeight, int endX, int speed) TextureAtlas textureAtlas new TextureAtlas(Gdx.files.internal(Constants.ATLAS PATH)) TextureRegion runningFrames new TextureRegion Constants.MOVING REGION NAMES.length for (int i 0 i lt Constants.MOVING REGION NAMES.length i ) String path Constants.MOVING REGION NAMES i runningFrames i textureAtlas.findRegion(path) if (horizontalMovingDirection MovementDirection.Right) runningFrames i .flip(true, false) code to draw and animate in a straight line by overriding the draw and act methods. Am I doing something wrong here? Why am I not getting the touch in the actor?


LibGDX with SoundPool I'm developing a game for Android using LibGDX in Android Studio. I recently found out that some sounds in my game fail to play. I noticed that every time a sound fails to play, these are the logs 04 12 10 49 51.784 24234 24283 com.gadarts.parashoot.android E AudioTrack AudioFlinger could not create track, status 12 04 12 10 49 51.785 24234 24283 com.gadarts.parashoot.android E SoundPool Error creating AudioTrack 04 12 10 49 52.503 24234 24283 com.gadarts.parashoot.android W AudioTrack AUDIO OUTPUT FLAG FAST denied by client transfer 4, track 44100 Hz, output 48000 Hz This is the code I use to play the sounds public long playSound(SFX fileName, boolean loop, float volume, boolean randomPitch) if (GameSettings.SOUND TOGGLE) try Sound sound prepareSound(fileName) if (randomPitch amp amp GameSettings.SOUND RANDOM PITCH) return setRandomPitch(loop, sound, volume) if (loop) return sound.loop(volume) else return sound.play(volume) catch (GdxRuntimeException e) e.printStackTrace() return 1 private Sound prepareSound(SFX soundFile) throws GdxRuntimeException try String soundPath SFX.fileAttribute.SFX FOLDER NAME.getValue() " " SFX.fileAttribute.SOUNDS FOLDER NAME.getValue() " " soundFile.getParentDir().getValue() " " soundFile.getValue() "." soundFile.getFormat().getValue() Sound sound if (!sounds.containsKey(soundFile.getValue())) sound Main.getAssetsManager().get(soundPath, Sound.class) sounds.put(soundFile.getValue(), sound) else sound sounds.get(soundFile.getValue()) if (sound null) throw new GdxRuntimeException("preparing sound failed sound not found.") return sound catch (GdxRuntimeException e) throw e The sound files are in WAV format. Any ideas how to fix it? Thanks in advance! Update I've found out that this problem appears only on my Nexus 5X. I tried it on Xiaomi Redmi Note 4X and it didn't happen.


Marketing games for the android what are the best sites to contact for reviews advertising? WE are in final dev stages of our latest game and want to release it for the android market. What are the best sites to contact for reviews advertising that specifically target the android users???


Where do I find the code for the open source game Warmux? I found an open source game called Warmux but I don't know how to get the code. I downloaded the file from here, but I don't know where to go from there. I didn't find any instructions on how to use the source. While I was looking for it, I came across something called git and repo. Do I use that?


Android animating spritesheets I'm creating a basic endless runner game on Android using SurfaceView. I have background that recreates itself constantly, which was simple enough. One problem I've always had is getting my head around animating sprite sheets, not just in Android but other platforms as well. Based on the problem I'm stuck on right now.. I have a sprite sheet thats 9 images 2 rows, 5 columns, with an empty space at the end of the second row. All of which is one single running animation. I've made a Sprite Class. public class Sprite GameView gameView Bitmap bmp private int x, y, width, height private int spriteColumns 5, spriteRows 2 private int currentAnim 1 public Sprite(GameView gameView, Bitmap bmp) this.gameView gameView this.bmp bmp this.width bmp.getWidth() spriteColumns this.height bmp.getHeight() spriteRows public void update() do something here with currentAnim, x and y public void onDraw(Canvas c) update() canvas.drawBitmap(bmp, x, y, null) How do I go about doing this? Am I on the right track so far?


How can I "publish" an Android game without Google Play? I'm new to development and trying to get a sense for the obstacles to publication If I need to circumvent the Google Play app store, can I publish a game to a website that people can visit in a mobile browser and download and install like any other app? How does publishing "around" Google Play work? Are there any particular success stories, best practices or problems I should be aware of? Apologies if there is an obvious answer. I believe I found the answer at one point, but I don't remember and can't find the link. edit Thanks everyone! I really appreciate the help. Definitely answers my questions. Looks like I have some options!


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


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


OpenGL ES 2.0 basic camera issues I am having issues with the camera, I cant find how to invert the AXIS Now A point is 0,0,0 B point is 1,0,0 C point is 0,0,1 What I want is A point 0,0,0 B point 0,0,1 C point 1,0,0 I cant find the way to do this, so if you can explain also why is this happening it will be great! (if you need more code ask for it) Code final float eyeX 2.0f final float eyeY 10f final float eyeZ 6.0f final float lookX 1.0f final float lookY 0.0f final float lookZ 6.0f final float upX 1.0f final float upY 0.0f final float upZ 0.0f Matrix.setLookAtM(mViewMatrix, 0, eyeX, eyeY, eyeZ, lookX, lookY, lookZ, upX, upY, upZ) ViewPort GLES20.glViewport(0, 0, width, height) final float ratio (float) width height final float left ratio final float right ratio final float bottom 1.0f final float top 1.0f final float near 1.0f final float far 25.0f Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far)


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


Structure GameObject States Visual representation Question What is the best data structure for GameObjects that have different states and thus different visuals? The situation is I'm creating a game for mobiles (written in Kotlin, no Engine used). My simplified object structure looks like this I have 2 GameObjects (e.g. Person and Obstacle) Each GameObject might have two different states (IDLE and MOVE) But each state might also have different graphics. For instance depending on the movement direction, the MOVE state might show Bitmap Left or Bitmap Right. Person WALK State Visualisation (WALK, PERSON) draw(bitmap walk left person) My problem is, that I'm really not sure about that structure. Should I make subclasses for each State or a composition? One Visual object for each State (e.g. MOVE, IDLE, TALK) containing all Bitmaps for Person and Obstacle and always showing the right one depending on the parent? Currently it looks like this I have the GameObject. The object has a state that is called in the update() method (e.g. moving a bit to the left). Every State has a "Visual" object that knows its parent State (State WALK). It draws itself related to its states type (e.g. WALK) and considers (if needed) the orientation (left or right). This felt like it keeps structures as abstract as possible but I'm not sure sure thats a good solution because all objects have to keep references to their "parents". So the visuals need a reference to the state (WALK) and to the GameObject (Person) in order to draw the visual for a walking person. Would it be better to create subclases for each State? So I have a class "VISUAL MOVE PERSON", "VISUAL IDLE PERSON", "VISUAL IDLE TREE" ... That seems a lot of redundant code and classes. Is there a common structure for Actions States and their Visual Representation? Especially since I will have many more objects with at least a few different states (IDLE, MOVE, TALK, ...) Should the visuals be part of each state? Or are they independent to each other (e.g. GameObjects have a State and a Visuals object) instead of the "chain of references" shown above?


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


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


Error compiling irrlicht android using ndk in Mac I'm new to irrlicht and I have started with irrlicht android port. I have made the following changes to android.mk file LOCAL CFLAGS O3 DANDROID NDK DDISABLE IMPORTGL I. .. include I. include I documents karthik android android ndk r9 platforms android 18 arch arm usr include LOCAL LDLIBS L documents karthik android android ndk r9 platforms android 14 arch arm usr lib libGLESv1 CM.so ldl llog L documents karthik android android ndk r9 platforms android 14 arch arm usr lib libGLESv1 CM.so I have tried compiling irrlicht android using ndk build in terminal.It showed the following errors at first In static member function 'static void irr os Printer log(const c8 , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security In static member function 'static void irr os Printer log(wchar t const , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security In static member function 'static void irr os Printer log(const c8 , const c8 , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security In static member function 'static void irr os Printer log(const c8 , const path amp , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security make obj local armeabi objs irrlicht os.o Error 1 and then I googled that and made changes in os.cpp file as follows Changed the code, android log print(ANDROID LOG INFO, "log", message) to android log print(ANDROID LOG INFO, "log"," s", message) This change solved that issue, and then I got another error In file included from jni importgl.cpp 55 0 jni importgl.h 37 22 fatal error GLES egl.h No such file or directory Again I changed GLES egl.h to EGL egl.h and solved that issue, got fatal error irrlicht.h No such file or directory I even solved this , atlast I'm here with this error error 'EglDisplay' was not declared in this scope error 'EglSurface' was not declared in this scope error 'EglWindow' was not declared in this scope error 'EglContext' was not declared in this scope


How do I add leaderboard feature of OpenFeint in android? I am developing a game in android, by extending a class with view. I have integrated OpenFeint in it by studying the tutorial provided on the OpenFeint site, but I am not able to add the leaderboard feature in my app. How can I achieve it? My game class is like this public class GameActivity extends Activity Intent i Grapic g public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) requestWindowFeature(Window.FEATURE NO TITLE) getWindow().setFlags(WindowManager.LayoutParams.FLAG FULLSCREEN, WindowManager.LayoutParams.FLAG FULLSCREEN) setContentView(new Grapic(this)) and Grapic is a class which extends view and where scoring is done with touch events.


Convert triangle mesh to group of line segments I have a 3D .OBJ model file that is loaded in my OpenGL ES 2 Android application using ASSIMP library. All the faces are triangulated. I want to draw the wireframe for my mesh. In OpenGL we have something called glPolygonMode that enables wireframe drawing just in one line. Is there a function I can use to convert those triangulated faces into a pair of Line segments and then draw these line segments using GL LINES? Any better approach to draw wireframe for 3D mesh in OpenGL ES 2 would be appreciated. Maybe something based on GLSL shader.


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?


Optimizing Draw calls in MonoGame Android platformer I am working on a 2D platformer that is in the final stages of optimization. I have a few different devices for testing, and I am trying to get the best possible framerate on the weaker ones. On a Nexus 5 I get a constant 60fps, with an occasional hiccup. On a Galaxy S4 I also get a good 55 60fps On an original Galaxy S (Vibrant) The frames drop to about 20 25 My question is, given the tile system described below, what can I do to increase the FPS on low end devices? And granted the Galaxy S came out years ago, should I even worry about it? My background consists of 3 scrolling parallax layers. The world I am drawing in a viewport of 25x15 tiles, at a size of 32x32px per tile, with 3 layers each (32x32x3px). The camera already culls tiles that are out of view. All tiles are found in one texture, and this is done in a single SpriteBatch call that locates the correct texture location for the tile layer. Code is below public void Draw(SpriteBatch spriteBatch, bool upsideDown) int startX GetCellAtPixelX( (int)Camera.Position.X ) int startY GetCellAtPixelY( (int)Camera.Position.Y ) int endX GetCellAtPixelX( (int)Camera.Position.X Camera.ViewportWidth ) int endY GetCellAtPixelY( (int)Camera.Position.Y Camera.ViewportHeight ) for (int x startX x lt endX x ) for (int y startY y lt endY y ) for (int z 0 z lt MapLayers z ) if ((x gt 0) amp amp (y gt 0) amp amp (x lt MapWidth) amp amp (y lt MapHeight)) ... The very last parameter in this draw call is the draw depth. This draw format will arrange layers from front to back (0 front, 1 back) so we subtract 1 from the z index as a decimal to get the appropriate location Background gt 0.7 Middleground gt 0.6 Foreground gt 0.5 spriteBatch.Draw( tileSheet, CellScreenRectangle(x, y), TileSourceRectangle(mapCells x,y . GetLayerIndex((TileLayers)z)), Color.White, 0.0f, Vector2.Zero, effect, 0.7f ((float)z 0.1f) ) End y loop End x loop As you can see, it's not very complex code. I have checked if my Update calls are slowing the game down, but it's very clearly in the Draw function. When I leave out my call to world.Draw(), fps shoot up to about 50 on the Galaxy S. Also, if I draw only a single layer, I get better performance around 42 45 fps. I can discard one layer if necessary, but I need at least 2 tile layers. How else can I speed up the draw calls? I am using MonoGame for Android (XNA)


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


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


How to Integrate Unity with Google Play Game Services for iPhone and Android games I want to integrate Google Play Game Services for Apple's iOS and for Android. How can I do this efficiently?


Workaround to losing the OpenGL context when Android pauses? The Android documentation says There are situations where the EGL rendering context will be lost. This typically happens when device wakes up after going to sleep. When the EGL context is lost, all OpenGL resources (such as textures) that are associated with that context will be automatically deleted. In order to keep rendering correctly, a renderer must recreate any lost resources that it still needs. The onSurfaceCreated(GL10, EGLConfig) method is a convenient place to do this. But having to reload all the textures in the OpenGL context is both a pain and hurts the game experience for the user when reentering the app after a pause. I know that "Angry Birds" somehow avoids this, I'm looking for suggestions on how to accomplish the same? I'm working with the Android NDK r5 (CrystaX version.) I did find this possible hack to the problem but I'm trying to avoid building an entire custom SDK version.


OpenGL ES GL FIXED versus GL FLOAT I am writing an app for Android, using OpenGL ES 1.x I am confused as to whether I should use GL FLOAT or GL FIXED, the priority being performance regarding GPU operations(does GL FIXED need to be converted etc. ex GL FIXED fits EXACTLY with the precision I need but if it is converted to a float then using it is pointless). This book seems to say that it is ALWAYS preferable to use GL FIXED for vertices "The major exception is with vertex data, which should never be given in floating point..." Here (paragraph right above the subtitle "Vertex data") But I have seen others saying floating point is better..


The best option to multi platform 2d mobile development we are in the process of porting a game from iphone(made with cocos2s) to android(using the andEngine), and it has been a pain to do. So for our next project (a 2d game) we are thinking about using some multiplatform engine framework. For now we are thinking about testing both unity, marmaled(former airplay sdk) and cocos2d x. Do you have any opinion about this? Does someon have experience developing 2d games using Unity?


Moving sprites based on Delta time consistent movement across all devices with different resolutions This is the formula I am currently using to move my sprites across the screen Examples below only deal with X coordinates to keeps things as short as possible. Initial variable declarations float frames per second 30 Set this to target frames per second, 30 for this example. float dt 1 frames per second Delta float spriteXGrid Sprite's position on a grid (grid can be any explicit value, I use something simple like 800 x 600) float spriteXScreen Sprite's actual final position in screen coordinates float spriteXTime 5 Time variable. This is in seconds and is the amount of time the sprite should take to traverse the screen float spriteXVel 1 spriteXTime Velocity value used in conjunction with time value to calculate new position To set my sprite's initial position I simply do this spriteXGrid (pos 800) Where pos is the position on the grid (0 800) and 800 is the grid size that I chose to work with. spriteXScreen spriteXGrid width To convert to actual screen coordinates where width is the actual width of the device currently running on. Then to move my sprite, I do this spriteXGrid spriteXGrid (spriteXVel dt) Update sprite's position on the grid spriteXScreen spriteXGrid width And convert to screen coordinates (again, width is the screen width of the current device) Then I just use the spriteXScreen variable to plot the sprite, something like sprite.drawSprite(spriteXScreen,0) this is from a custom class I wrote that takes in sprite's x and y coordinate and draws it there. My question is, is there an easier way I can do this?! It's a nightmare to manage when it comes to collision detection etc.... because, you have 2 different coordinates, the 'screen' one (which I would describe as 'superficial'), and the 'grid' one which is needed for all the good stuff, and is a nightmare to actually work out and work with. is there anyway I can just do something like spriteXScreen 'some value' Which would allow my sprite to move across the screen in the same amount of time on all devices? (I mean I can't just say move it by 1 pixel, because if I move 400 pixels in say 5 seconds on a 400 pixel wide screen, the sprite will have passed the whole screen in those 5 seconds, but on an 800 pixel wide screen it would have only passed halfway in the same amount of time). The whole business of have a 'grid' coordinate and having to convert it to a 'screen' coordinate is extremely irritating and I'm wondering if I'm doing this all wrong....? Suggestions and solutions would be very welcome


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


sharing preferences between two apps on android with libgdx I am making an android game with both a demo version and a paid version. I want users who decide to buy the paid version to continue from where they left off, with all their old data and settings. I've set a shared user id between both applications, and now I'm wondering if it's possible to use libgdx preferences across both versions. I am also open to other ideas on how to implement this.


'No Platforms Found' error in Unity Android I am having a problem with Unity Android every time I try to "build", a 'No Platforms Found' error pops up. Thing is that I already have Android SDK in my computer (copied it into my G drive from the official .zip download). JDK is installed too. I use Unity 4.0.0f7 Pro version, and have SDK Platforms 2.1 (API 7), 2.2 (API 8), 2.3.3 (API 10), 3.0 (API 11), 3.1 (API 12), 3.2 (API 13), 4.0 (API 14), 4.0.3 (API 15) and 4.2.2 (API 17). How can I remove this error and build successfully? P.S. I have already had a look at some of the threads in Unity website regarding this matter. None of the suggested answers has worked for me.


Using orientation sensor data for Android game I'm building a game where a green box floats to different parts of the screen. The user must rotate their phone such that the blue dot intersects the green square. This is different from a standard "roll a ball" type game because instead of tilting a 3D surface the ball sits on, the ball always returns to the center point when the phone is held straight. Tilting the phone forward naturally moves the ball up to catch squares that are above its center position, tilting the phone backward moves the ball down to catch squares below it, and same for tilting the phone left and right. The phone has freedom to pitch, roll, and yaw (XYZ). I'm using the Android SensorEvent and the Sensor.TYPE ROTATION VECTOR to try and accomplish this. So far, this is our approach. On game start, measure the quaternion returned from the sensor, call it Q1 On all timesteps after game start, compute the transform between Q1 and Qi, Qi being any other quaternion. Apply the resulting transformation matrix to the 2D dot on the screen such that it translates appropriately. I'm stuck on computing a transform between Q1 and an arbitrary Qi. I'm asking here to see how similar games solve this problem, and if our approach is even correct given the types of sensor data coming from Android. Figure1 The bottom two pictures of the phone are side views. The top two pictures are a representation of what's on the screen


How can I access bitmaps created in another activity? I am currently loading my game bitmaps when the user presses 'start' in my animated splash screen activity (the first launch activity) and the app progresses from my this activity to the main game activity, This is causing choppy animation in the splashscreen while it loads creates the bitmaps for the new activity. I've been told that I should load all my bitmaps in one go at the very beginning. However, I can't work out how to do this could anyone please point me in the right direction? I have 2 activities, a splash screen and the main game. Each consist of a class that extends activity and a class that extends SurfaceView (with an inner class for the rendering logic updating). So, for example at the moment I am creating my bitmaps in the constructor of my SurfaceView class like so public class OptionsScreen extends SurfaceView implements SurfaceHolder.Callback Create variables here public OptionsScreen(Context context) Create bitmaps here public void intialise() This method is called from onCreate() of corresponding application context Create scaled bitmaps here (from bitmaps previously created)


Google Leaderboards, Reducing the Score of a Player I am making a strategy game similar to chess for Android. I'll be using the Google Leaderboards for rankings. I want to implement a sort of ranking system, that the player can actually lose score, similar to the one in www.chess.com. But, from the docs of submitScore() "The score is ignored if it is worse than a previously submitted score for the same player." I don't understand how can I implement such a system with Google Leaderboards.. sorry if I'm missing something obvious here.


Relative and absolute position with sprites in libgdx In libgdx, can i add a sprite as children of another an set it with the relative coordinates of the father and not the stage? Like in HTML when you add controls they are relative to its parent, but here i want it with sprites, i add the children in a Group class but the coordinates are absolute (relative to the stage)


Betatesting an android game. Best practices? Our game is in our final stage prior to be released. I would like at this stage to add some beta testers to let them hunt bugs, etc... Is there any good platform site to achieve this? I have noticed there's a site called betalizer but they still are in beta. Could anyone suggest how to find beta testers for a little medium size android game without spending a lot of bucks or any platform that could help on it? Thanks in advance.


My game is mostly complete, how do I find a publisher? I've been working for quite a while on a game. I'm mostly done with it. Simply finishing the project, adding banners and just publishing it on google play appstore probably won't bring in any money, at least without firstly investing some in promotion... How do I go about finding companies that might be interested in either promoting or maybe even fully buying out such a product?


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.


Tips on how to notify a user of new features in your game I have noticed a problem when releasing new features for a game that I wrote for Android and published on Google Play Store. Because my game is "stage based" and not a game like Hay Day, for example, where users will just go into the game every day since it can't really be finished my users are not aware of new features that I release for the game. For example, if I publish a new version of my game and it contains a couple new stages, most of their devices will just auto update the game and they don't even notice this and think to check out what's new. So this is why an approach like popping open a dialog that showcases the new feature(s) when they open the game for the first time after the update was done is not really sufficient. I am looking for some tips on an approach that will draw my users back into the game and then they could read more detail about new features on such a dialog. I was thinking of something like a notification that tells them to check out the new features after an update is done but I am not sure if this is a good idea. Any suggestions to help me solve this problem would be awesome.


TurnBasedGame with libGDX Google Play Services I'm trying to write a small card game for Android using libgdx framework. My game is turn based. I wrote to interface with the necessary methods to access the API interface from Google. I faced the problem after I called Games.TurnBasedMultiplayer.createMatch(gameHelper.getApiClient(), tbmc) I got the result of the callback. If initiateMatchResult.getMatch().getData() is null I am initiating games data, and here's the PROBLEM I don't know how to go back in GameScreen??? This is piece of code in AndroidLauncher Games.TurnBasedMultiplayer .createMatch(gameHelper.getApiClient(), tbmc) .setResultCallback(new ResultCallback lt TurnBasedMultiplayer.InitiateMatchResult gt () Override public void onResult( NonNull TurnBasedMultiplayer.InitiateMatchResult initiateMatchResult) if (!initiateMatchResult.getStatus().isSuccess()) gameHelper.showFailureDialog() return TurnBasedMatch match initiateMatchResult.getMatch() if (match.getData() ! null) Log.d("MyLogs", "match not null") initGame() myGame.setScreen(myGame) ) If just call myGame.setScreen(new GameScreen(myGame)) is the GameScreen displaying is not correct. In GameScreen I have table and images in this table and the images displaying is not correct!!! This code of my GameScreen public class GameScreen implements Screen final MyGame myGame private Stage stage private Table table private Image card1, card2, card3, card4, card5, card6 public GameScreen(MyGame myGame) this.myGame myGame stage new Stage() Gdx.input.setInputProcessor(stage) card1 new Image(new Texture(Gdx.files.internal("1.png"))) card2 new Image(new Texture(Gdx.files.internal("2.png"))) card3 new Image(new Texture(Gdx.files.internal("3.png"))) card4 new Image(new Texture(Gdx.files.internal("4.png"))) card5 new Image(new Texture(Gdx.files.internal("5.png"))) card6 new Image(new Texture(Gdx.files.internal("6.png"))) table new Table() table.setFillParent(true) table.setDebug(true) table.add(card1).width(140).height(202).padLeft(15).padRight(15).padBottom(10) table.add(card2).width(140).height(202).padBottom(10) table.add(card3).width(140).height(202).padLeft(15).padRight(15).padBottom(10).row() table.add(card4).width(140).height(202).padLeft(15).padRight(15) table.add(card5).width(140).height(202) table.add(card6).width(140).height(202).padLeft(15).padRight(15).row() stage.addActor(table) Override public void show() Override public void render(float delta) Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) stage.act(delta) stage.draw() Override public void resize(int width, int height) Override public void pause() Override public void resume() Override public void hide() Override public void dispose() stage.dispose() mySkin.dispose() dixit.getScreen().dispose() SCREENSHOT BELOW this screenshot shows how to display images in my table Tell me what my mistake and what am I doing wrong? Can anyone advise how best to do otherwise??


Is libgdx fit for 2D game development on Android or are there simpler alternatives? I'm looking for a Java framework to develop 2D games on desktop and Android. I've looked at Slick and I really like the API, however the developer himself says if you want a framework for Android and desktop best go with libgdx atm. Now I'm reading up on libgdx, but I'm wondering if there are simpler alternatives for just doing 2D sprite stuff on Android and desktop. I'm only interested in creating NES like graphics, nothing too fancy. Something like this. Because on the wiki of libgdx it says you can't use the OrtographicCamera with OpenGL ES 2.0 (http code.google.com p libgdx wiki OrthographicCamera), but I read (http www.badlogicgames.com wordpress ?p 504) when your device supports OpenGL ES 2.0 it doesn't support 1.0, so you can't effectively use OrtographicCamera on OpenGL ES 2.0 devices? I'm confused, should I go with libgdx? Are there simpler alternatives?


How to increase the acceleration of an object on the Y axis? So far I am able to make the character fall at a constant rate but I am unsure how to make the character accelerate while falling. When the character is falling I have a line of code as such position.y 7f How can I change my implementation such that the character falls faster over time?


Continous horizontal animation of objects We have to continously animate objects from right to left in a panel. The player has to pop the first object. If the first object could not be destroyed by the player and it reaches the left border of the panel, the game is over We have experimented by implementing this using Android widgets. The panel is a HorizontalScrollView and the objects are ImageViews placed in a LinearLayout. The HSV is continously scrolled using ObjectAnimators and when the first object is popped by the player, a new object is added to the LinerLayout. This solution has some problems the LinearLayout gets infinitely big, adding new objects to our model and layouting them causes small hiccups and the animator speed is changable through the Android developer options which makes implementing high score pointless. What would be a "standard" solution for games with an infinite animation where constant animation speed and good performance are critical? Is using native widgets possible with these requirements or should we throw everything away and use a Canvas?


Need a good quality bitmap rotation algorithm for Android I am creating a kaleidoscopic effect on an android tablet. I am using the code below to rotate a slice of an image, but as you can see in the image when rotating a bitmap 60 degrees it distorts it quite a lot (red rectangles) it is smudging the image! I have set dither and anti alias flags but it does not help much. I think it is just not a very sophisticated bitmap rotation algorithm. canvas.save() canvas.rotate(angle, screenW 2, screenH 2) canvas.drawBitmap(picSlice, screenW 2, screenH 2, pOutput) canvas.restore() So I wonder if you can help me find a better way to rotate a bitmap. It does not have to be fast, because I intend to use a high quality rotation only when I want to save the screen to the SD card I would redraw the screen in memory before saving. Do you know any comprehensible or replicable algorithm for bitmap rotation that I could programme or use as a library? Or any other suggestion? EDIT The answers below made me think if Android OS had bilinear or bicubic interpolation option and after some search I found that it does have its own version of it called FilterBitmap. After applying it to my paint pOutput.setFilterBitmap(true) I get much better result


Should I render all of my HUD views to a single SurfaceView? I'm using a SurfaceView and canvas to implement a game HUD, title screens etc., by overlaying standard Android view widgets over my SurfaceView. This works reasonably well and maintains an acceptable frame rate, but it is a simple game with little happening on or off screen. I have handlers flinging messages around and runOnUiThreads everywhere. Quite cumbersome. Can I draw all my views to the one SurfaceView, controlled by the main game thread? Is there an advantage to this?


How does an Input Pipeline work? I found this article on implementing an input pipeline for Android, but I don't really understand how it works. I also don't completely understand the programming concept of a pipeline or a pool either. Could someone explain these concepts and how they work as this input pipeline?


Multiple inputs for Google Cardboard on iOS and Android? So far I am having a problem with having only a singular input mechanism (the magnetic trigger) for Google Cardboard games. Are there any other options to augment this in order to have at least two or three input "buttons" or triggers for a Cardboard app or are we stuck with one?


Fixed background on a SurfaceView I'm currently working on a top down twin stick shooter for Android. I've got my player moving around and shooting, but I'm looking to add a large Bitmap background which is larger than the device screen. I'm looking for a way to position the background at 0,0 in 'world' co ordinates, and have the view able to pan across the background with the player. I've tried using SurfaceHolder.Callbacks, but these do not seem to play nicely with my SurfaceView class. The view currently follows the player while keeping it centred, until it reaches an edge, where it will stop and the player will continue until he hits a wall. My current thoughts are to store an offset from view co ordinates to world co ordinates in the update loop, and draw the bitmap using these offsets in the draw loop. Is there a more efficient way to do this, or a different way to think about it?


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


What game engines can publish to Android and iOS? I am about to start on a project which, at a minimum, will release to Android and iOS. Are there any game engines, other than Unity, which can publish to both? I fear that Unity might contain more overhead then we need, for what is essentially a 2D game.


Rotation of bitmap using a frame by frame animation I have one large bitmap that has four frames drawn on it and I only draw one at a time by looping through the bitmap by increments to animate walking. I can get the bitmap to rotate correctly when it is not moving but once the animation starts it starts to cut off alot of the image and sometimes becomes very fuzzy. I have tried public void draw(Canvas canvas,int pointerX, int pointerY) Matrix m if (setRotation) canvas.save() m new Matrix() m.reset() spriteWidth and spriteHeight are for just the current frame showed m.setTranslate(spriteWidth 2, spriteHeight 2) get and set rotation for ninja based off of joystick m.preRotate((float) GameControls.getRotation()) create the rotated bitmap flipedSprite Bitmap.createBitmap(bitmap , 0, 0,bitmap.getWidth(),bitmap.getHeight() , m, true) set new bitmap to rotated ninja setBitmap(flipedSprite) canvas.restore() Log.d("Ninja View", "angle of rotation " (float) GameControls.getRotation()) setRotation false And then the Draw Method here create the destination rectangle for the ninjas current animation frame pointerX and pointerY are from the joystick moving the ninja around destRect new Rect(pointerX, pointerY, pointerX spriteWidth, pointerY spriteHeight) canvas.drawBitmap(bitmap, getSourceRect(), destRect, null) The animation is four frames long and gets incremented by 66 (the size of one of the frames on the bitmap) for every frame and then back to 0 at the end of the loop.


Animate Using setScale() I want to animate my player from bigger size to smaller size and then smaller size to bigger size continuously. We can use setScale() method to re size any sprite but is there any way to animate with it? And one more thing, if I scale any sprite after creating it's physics body, the sprite is visually scaled but the physics body does not scaled. So is there any optimum solution to animate the physics body from bigger to smaller and then smaller to bigger?


Problem with drawing textures in OpenGL ES I'm developing a 2D game for Android and i'm using the framework which has been told in the book which named Beginning Android Games by Mario Zechner.So my framework is well designed and using OpenGL 1.1.It's similar to libgdx. When i put my textures adjacent each other in my 2d surface,there are some spaces size as 1 px.But this problem only occur on my tablet.There aren't a problem like this on my phone.It's like in this picture What can be the problem?I can't fix it from one week.


2D physics performance on iPhone Android using Unity 3D? I've been looking into making 2D games with Unity. One thing which concerns me is the performance of the physics engine. Since Unity is a 3D game engine I'm going to have to assume it uses a 3D physics engine. Obviously I can turn this 3D engine into a 2D one by locking off various axis such that objects only move physically in 2D space. However this worries me, for example Box2D being a specialized 2D physics engine is optimized for 2D. Would the physics in Unity3D be fast enough to say, duplicate the sorts of physics we see in games like Angry Birds on a handheld device?


How to know if an actor is touched in libgdx? I am using "Gdx.input.isTouched()" in the render method of my Screen method, to know where is touched, but when the touch is dragged in the screen, it also activates the events i want only when an actor is touched. Is there any listener to know when an Actor is touched, but the event is not the dragged one, im doing it with sprites.


Resolution Independence in libGDX How do I make my libGDX game resolution density independent? Is there a way to specify image sizes as "absolute" regardless of the underlying density? I'm making a very simple kids game just a bunch of sprites displayed on screen, and some text for menus (options menu primarily). What I want to know is how do I make my sprites fonts resolution independent? (I have wrapped them in my own classes to make things easier.) Since it's a simple kids game, I don't need to worry about the "playable area" of the game I want to use as much of the screen space as possible. What I'm doing right now, which seems super incorrect, is to simply create images suitable for large resolutions, and then scale down (or rarely, up) to fit the screen size. This seems to work okay (in the desktop version), even with linear mapping on my textures, but the smaller resolutions look ugly. Also, this seems to fly in the face of Android's "device independent pixels" (DPs). Or maybe I'm missing something and libGDX already takes care of this somehow? What's the best way to tackle this? I found this link is this a good way of solving the problem? http www.dandeliongamestudio.com 2011 09 12 android fragmentation density independent pixel dip It mentions how to control the images, but it doesn't mention how to specify font image sizes regardless of density.


What causes "ETC1 cannot be resolved" errors when building AndEngine? I just got the latest AndEngine code from Mercurial, added Android 1.6 to my Order Export tab, and cleaned everything (including a "Fix" command as instructed by the console). Regardless of which version of Android I specify in my project settings (1.5, 1.6, 2.2, 3.2), I get around 523 compilation errors. The most unique I can see is ETC1 cannot be resolved, accounting for 5 out of 105 errors I can see. The other 100 are all some variation of The method ... must override a superclass method. What am I missing? I installed the JDK, Eclipse classic, SDK manager, and everything in the SDK.


Flick Gesture in Unity3D Android I'm trying to create a football game where the user will make a flick gesture in order to kick the ball. I'm quite new to developing games in unity3d, I have successfully made a moving ball, added some rotation, gravity and some basic input (the ball follows the touch coordinates). How can I achieve the flick gesture?


How do I check for collision between an ellipse and a rectangle? I am working on LibGdx framework for developing a 2D isometric tower defense game.All my sprites are drawn in 2D isometric view. I have used an array list to store 8 points at boundary in the rectangle.LibGdx has an inbuilt function (returns Boolean) ellipse.contains(x,y),by iterating through array list I can check whether any points are inside ellipse But the problem is as shown in below picture,it wont detect the enemies in some particular cases So my question is 1)Is this a correct approach for solving these kinds of problems 2)If not can you suggest better approach for solving this problem Thank you.


Game Loop, Deltas. What is wrong? For my Android app this is the gameloop public void run() while(true) if(frames 0) cTime System.currentTimeMillis() if(System.currentTimeMillis() gt lastUpdate 5) if(gameState PLAYING) updatePhisic() updateSprites() this.postInvalidate() lastUpdate System.currentTimeMillis() try Thread.sleep(sleeptime) catch(InterruptedException e) if(System.currentTimeMillis() gt cTime 1000) frameRate frames frames 0 else frames Please consider this should work for multiple devices. Testing in some devices My phone 180 FPS A Smaller phone 200 FPS A Tablet 120 FPS I'm trying to put it at 60 FPS but the player moves so slow, I don't know how to calculate the Delta for player. I mean that at 180 FPS in my phone works fine, that is the speed that I want. But at 120 FPS in a tablet freezes a bit. I think that painting the screen 60 times in a second would be enough. And this freezes sometimes if(System.currentTimeMillis() gt lastUpdate 5) This does not try Thread.sleep(sleeptime) catch(InterruptedException e) Why?


How to change from 60FPS to 30FPS while keeping things smooth? Here is my current game loop final int ticksPerSecond 60 final int skipTicks (1000 ticksPerSecond) float dt 1f ticksPerSecond while(System.currentTimeMillis() gt nextGameTick amp amp loops lt maxFrameskip) updateLogic() nextGameTick skipTicks timeCorrection (1000d ticksPerSecond) 1 nextGameTick timeCorrection timeCorrection 1 loops On most devices I've tested my game on (this is an Android game BTW) it runs quite nice. As you can see, I'm using a fixed time step (defined as my ticks per second). If I reduce my Ticks Per Second to 30, everything runs at the same speed but is nowhere near as smooth. I keep hearing people say that 30fps should be OK for mobile games and everything should run great at 30 fps, but that's just not my experience. Would be grateful if someone could give me some pointers on how to achieve this.


Sounds and buttons show up in simulator, not in an Android device I'm a noob in android game development, started with corona sdk and outlaw. My project runs just fine with the corona simulator on my win8, however, when building it to my android device (galaxy s3) and running it it behaves differently than in the simulator First thing in my project I have wav sound files that work just fine in the corona simulator, but on my android device the sound files do not play (I use the audio.play api). Second thing I have 2 buttons created with the widget.newButton api, which are displayed on a lua screen. The buttons do show in the simulator, but are not shown on the android app. Any help will be appreciated!


SAT collision detection and stacking objects I'm working on a small game for Android which deals with some simple physics, including the need to stack objects on top of one another without jitter. This infamous "stacking collisions" issue with custom collision physics engines really has me on the ropes with this project. To highlight the issue I'm gonna go through a basic rundown of my gameloop and the order in which this engine computes the various steps. For example, lets say we have 3 objects in this scene. 2 boxes and a ground floor. The update loop is as follows Apply external and internal forces to each object (including gravity, any movement from input, etc.). Use a collision tree to separate the various game objects into potential collision pairs (this is working just fine). Run a collision detection algorithm on each pair to get a contact manifold for each collision that occurs this frame. My project is using SAT and its been working very well. Sort the list of contact manifolds to order collisions by time of occurance. Loop through the ordered manifolds and solve each collision as necessary. Update each object's position in the world with the results of the collision correction and render. When dealing with one pair of objects in isolation, this works great. But when you add a 3rd object to the simulation and stack them on top of each other the resulting simultaneous collisions result in visible jitter as the objects are pushed in and out of each other due to the many manifolds they have to deal with. In my example the static ground remains stationary but the bottom box jitters in and out of the ground slightly as the top box pushes down on it due to gravity. Adding an iteration loop around steps 3, 4 and 5 helps stabilize the objects since they rerun the collision checks and get more accurate values, but to make the collisions perfectly stable I need a very high number of iterations (exponential amounts the larger the stack of objects), which kills the framerate of the game. I'm not looking for any complete code, but some theories on how this stacking issue should be avoided would be fantastic. I'm just unsure where to take this logic wise anymore, but I feel like anyone taking the custom physics engine route has probably seen similar issues.


Android OpenGL detect slow GPU I have app for Android with OpenGL. It uses GPU heavy effects and on "slow" GPUs this leads to low FPS. Is there a way, how to detect "slow" GPU during app start and disable those effects and generate low poly geometry? By "slow" I mean GPUs based on their frequncy, VRAM and info like this. Lower values mean slower GPU. It is quite "easy" way, but it should be enough. I cannot do it in runtime based on frame time, because it would require reload of geometry, shaders etc. and it would be inconvinient for user.


Yet another libGDX resolution independance question I am developping a Android smartphone game in LibGDX, and I am encountering issues about resolution managing. Most notably, I have no clue how to handle that in LibGDX. For now, I am developping based on my Nexus 5 screen, but it will certainly not (down)scale well to devices with lower density screens. On the web, most data are about LibGDX lt 1.0.0 and is totally irrelevant. The few things I have found talks about the Viewport classes, but it is poorly explained the game is either horribly stretch or way too small on high definition devices. At this point, I have understood that I need to define a "virtual screen" of some unit (lets say meters) and then place my elements based on this unit. But there is no fragment of clue on how to do that the right way in LibGDX when using Scene2D, for example, buttons are totally misshaped, with letters out of the box, buttons clearly overstretched and such, or ultra small based on the Viewport class used. In the same way, using multiple asset size is not clear how to load them based on pixel density, how to force them to be there at the good size ? Etc... This stuff can make anyone crazy at start. What I want to know is is there somewhere some good, updated to recent libGDX, demos, examples or tutorial to the proper way to handle resolution, screen ratio and such in recent libGDX ? The libGDX viewport example, while a good start, are still unclear to me, and don't show the multiple asset size thing. Thanks for any help, it is highly needed.


Populating NPC's Outside Of Loop This was my original question Populating Sprites I used the following code to spawn Enemy Sprites in my game. I have 2 types that I was using and it would display one then remove it and display the other. It did this repeatedly(Imagine someone playing with a light switch and you have what is happening with the NPCs. EnemyType1 is Off and EnemyType2 is On.).Also It does not apply the current level number meaning, it does not spawn the number of enemies for the level. The number of enemies I want to spawn is the exact number of the level. I used other types of random methods( nextBoolean(), nextInt(), nextFloat() ). I showed the code to my friend and he told me that I would need to spawn them outside of my loop, but he did not know how to. So now I am trying to see if anyone on stack could help me. What I am trying to do is this NPC's Enemies I have 2 types of NPC's that I want to use. The number of Enemies that are spawned are equal to the the current level number. I want to be able to spawn how ever many is needed for that level and have it to where which Enemy that will spawn is random, so you don't know if you will get EnemyType1 or EnemyType2 or a Mix. Ex Level 1, only 1 Enemy spawns, the type is random. Level 2, only 2 Enemies spawn, the type is random. Level 3, only 3 enemies spawn, the type is random. etc. Thanks In Advance.


What affects the size of APK files? The size of the .apk file built by Unity is larger than I expected. Is it image resolution, number of scenes, or something else?


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


Android development in Unreal with an existing project I am currently using an Unreal 3 project that has been targeted for multiple devices. Originally, it was targeted for iOS and now I want to try and build it for Android. The project is capable of doing it and I am in the process of testing it. I think I have everything I need in order to build it and launch it for an android device that I have set up and connected to my PC and is recognized by the Android SDK ABD. I am currently trying to build and launch the game through the Unreal Frontend but when I try, I am getting stuck at getting the Unreal Frontend to find my Android device as a platform to debug, like it would with a PC, Xbox360, or PS3. Right now, I am just trying to launch the game to see if I can get it to simply run on an Android device, I'm going to worry about the packaging later. So I have two questions Am I on the right track in looking at the Unreal Frontend to cook and launch the project on Android or should I look somewhere else? How do I get Unreal to recognize my Android device as a platform to launch on? I would even settle for recognizing an emulator, but that seems even harder.


How could I access game data from a dev machine at runtime from a mobile platform? When working on a game on a mobile platform, having read write access to game data (assets, configuration files) stored on the dev machine at runtime would enable building of tools to quickly iterate, debug, and analyze the game at runtime. For iOS amp Android, is there any way to have access to these data files from the dev machine while the game is running on the mobile device? Please do not recommend a tool, or a 3rd party engine that does this.


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


Displaying and updating score in Android (OpenGL ES 2) I'm using a FrameLayout where I have a GLSurfaceView at the bottom and a few Views on top of it. One of those Views is a TextView that displays the current score. Here's how I'm updating the score TextView based on what happens in my game loop whenever an event happens that increases the score, I call activity.runOnUiThread(updater), where activity is the activity that has the above FrameLayout (my main game activity) and updater is just a Runnable that increments the score. From my understanding, using runOnUiThread() from the OpenGL thread is standard practice otherwise you'll get an exception, I can't remember its name. The problem is that there's a very noticeable lag between the event and the score update. For example the character gets a coin, but the coin count is not updated quickly. I tried summing all the score events from my game loop and calling runOnUiThread() only once per loop, but it doesn't seem to make much of a difference the lag is still noticeable. How can I improve my design to avoid this lag?


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


How would I generate random falling objects I'm creating a game using libgdx on Eclipse that is similar to Ragdoll Avalanche. I'm looking for a way to generate falling objects like the triangles of Ragdoll Avalanche. All I know that i have to use an array but i dont know how to do it.


How do I make a background fill the whole screen in Libgdx? I'm using this code to set a 800x420 image to be full screen public void show() float w Gdx.graphics.getWidth() float h Gdx.graphics.getHeight() camera new OrthographicCamera(1, h w) batch new SpriteBatch() texture new Texture(Gdx.files.internal("images splashatlas splashatlas1.png")) texture.setFilter(TextureFilter.Linear, TextureFilter.Linear) TextureRegion region new TextureRegion(texture, 0, 0, 800, 420) sprite new Sprite(region) sprite.setSize(0.9f, 0.9f sprite.getHeight() sprite.getWidth() ) sprite.setOrigin(sprite.getWidth() 2, sprite.getHeight() 2) sprite.setPosition( sprite.getWidth() 2, sprite.getHeight() 2) public void render(float delta) Gdx.gl.glClearColor( 1f, 1f, 1f, 1f ) Gdx.gl.glClear( GL20.GL COLOR BUFFER BIT ) batch.setProjectionMatrix(camera.combined) batch.begin() sprite.draw(batch) batch.end() But on real device it looks like this I tried to setSize with different parameters sprite.setSize(1.0f, 1.0f ) Now it's fullscreen, but it's really stretched What is the way to set a background to be full screen? I want it to look like this


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


What are the specifications for 3D animated game assets on the Android platform? (apologies if this is phrased vaguely due to my lack of knowledge I'm happy to change the question entirely if someone can suggest a more realistic query) I'm getting a grip on creating 3D characters in Lightwave, Maya, Blender, etc. My goal is to focus on creating creature amp character animations specifically for games. I thought it would be a good exercise to make a few critters with a specific scope. As a non programmer (I've written a few scripts, but I really don't have a passion to code) can you point me in the right direction to find some guidelines? (I have a programmer handy who will write the code, but I want to be able to give him assets that are as usable as possible) I assume that Android games are intended to run on limited hardware maybe there's a polycount I should shoot for, or a particular memory limit? The resources I've found so far all seem to be helpful to developers haven't found much oriented in my direction


2D Rendering with OpenGL ES 2.0 on Android (matrices not working) So I'm trying to render two moving quads, each at different locations. My shaders are as simple as possible (vertices are only transformed by the modelview projection matrix, there's only one color). Whenever I try and render something, I only end up with slivers of color! I've only done work with 3D rendering in OpenGL before so I'm having issues with 2D stuff. Here's my basic rendering loop, simplified a bit (I'm using the Matrix manipulation methods provided by android.opengl.Matrix and program is a custom class I created that just calls GLES20.glUniformMatrix4fv()) Matrix.orthoM(projection, 0, 0, windowWidth, 0, windowHeight, 1, 1) program.setUniformMatrix4f("Projection", projection) At this point, I render the quads (this is repeated for each quad) Matrix.setIdentityM(modelview, 0) Matrix.translateM(modelview, 0, quadX, quadY, 0) program.setUniformMatrix4f("ModelView", modelview) quad.render() calls glDrawArrays and all I see is a sliver of the color each quad is! I'm at my wits end here, I've tried everything I can think of and I'm at the point where I'm screaming at my computer and tossing phones across the room. Anybody got any pointers? Am I using ortho wrong? I'm 100 sure I'm rendering everything at a Z value of 0. I tried using frustumM instead of orthoM, which made it so that I could see the quads but they would get totally skewed whenever they got moved, which makes sense if I correctly understand the way frustum works (it's more for 3D rendering, anyway). If it makes any difference, I defined my viewport with GLES20.glViewport(0, 0, windowWidth, windowHeight) Where windowWidth and windowHeight are the same values that are pased to orthoM It might be worth noting that the android.opengl.Matrix methods take in an offset as the second parameter so that multiple matrices can be shoved into one array, so that'w what the first 0 is for For reference, here's my vertex shader code uniform mat4 ModelView uniform mat4 Projection attribute vec4 vPosition void main() mat4 mvp Projection ModelView gl Position vPosition mvp I tried swapping Projection ModelView with ModelView Projection but now I just get some really funky looking shapes...


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?


ADMOB Why my match rate never increase? I have a game deployed in the store, here are some app and admob metrics It makes 120k requests per day It have 800 active devices in the last 30 days It have less than 1 match rate( 0.3 ) Some math 120k 0.8k(800) gt 150 requests per user(really high I think) I have read some articles and questions about this, what I did was Make sure to only request an ad when it needs to be displayed, I can't always ensure this, but I tried my best. Make sure my app are not enrolled in the 'Designed for Families' program. Make sure my ad content rating is for mature audiences(M). All this was done last week, since then I have seen not a single change in the admob reports, everything stills the same, after changing the request rate I should have seen a decrease in the ad requests, it didn't happened, of course I'll wait more since only 400 active devices were updated with this new version(although I think it should have been reflected in the statistics already). It is really frustrating, feels like I have no control over this, is there other reasons for admob to have low match rate? can someone help me here? Thanks all in advance.