Do I need a company name to publish on Google Play? I'm going to upload my Android mobile game on Google Play. But it seems like all games are developed by companies(such as Zynga, and King) and I don't see individual's names as developers. Do I need to register a company name officially? I think it costs a few hundred dollars... If I have to, how and where do I register? or instead of registering a company for a few hundred dollars, if I make a domain website that is named as my company name, would it provide me some protections? Also, do I need to trademark my game's title as well? Thanks!


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


Run Love2D on iphone and android I have a game developed in lua using love 2d, and now i want to run it in ios android. Is there any porting or way available to do that. Thanks.


How do you increase the spacing on text within LibGDX labels So I'm following along with some tutorials for creating an application with LibGDX, and when I go to print parts of the UI to the screen, the text is all bunched up. How do I increase the spacing, or is it due to something else I've done? .... game gam stage new Stage(new StretchViewport(800, 400)) Gdx.input.setInputProcessor(stage) uiSkin new Skin(Gdx.files.internal("uiskin.json"), new TextureAtlas(Gdx.files.internal("uiskin.atlas"))) Label nameLabel new Label("Name ", uiSkin) TextField nameText new TextField("", uiSkin) Label addressLabel new Label("Address ", uiSkin) TextField addressText new TextField("", uiSkin) table new Table() table.add(nameLabel).expandX() table.add(nameText).width(200) table.row() table.add(addressLabel) table.add(addressText).width(200) table.setFillParent(true) stage.addActor(table) table.setDebug(true)


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.


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


How to make ranked matches in a head to head multiplayer game? I am working on a field hockey like game for Android and iOS. Currently I support being able to play against another player online in a client server fashion where one device host and the other provide an IP address. I would like to be able to have ranked matches that are recorded in something like Amazon's GameCircle or something similar. For recording the win loses I thought having one leaderboard for wins, one leaderboard for loses and perhaps another leaderboard for amount of games in progress... That is assuming I can read the leaderboard result for each player which I think I can. Other than that, there are many issues in how to have ranked matches. I am guessing the biggest difficulty is actually being able to have a client server session since most devices are not set up to have a direction communication with another device? What are your suggestions for having ranked matches given no extra server? And what are your suggestions given my own server?


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.


Java code to get android phone hardware specs Is there code available to view the specs of a phone that is running your application?


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?


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?


No sound in android using Phaser I have developed a simple game using Phaser. It's work perfect on ios webkit, but on android there is no sound. What causes this problem on one platform but not the other? We are using this code to load this.load.audio('game audio', 'audio bgm.mp3') Playing this.music this.add.audio('game audio') this.boom.play()


Changing background images frequently within a specific time range with Cocos2D I am working on a game development project for Android. We use the Cocos2d framework. I have to design a page which contains two background images, I need to switch these images repeatedly within 1sec. How can I do this? How can I use CCTransitionScene in my Java code and change these images repeatedly? Thanks in advance.


Amazon GameCircle Integration I'm trying to integrate Amazon GameCircle and I have been able to successfully initialize GameCircle in my app, but the problem is when I click on the button that displays achievements, the GameCircle achievement list comes up but it says "You have unlocked 0 of 0 achievements". Same happens with leaderboards i.e there are no leaderboards for this app. I have created a Leaderboard and a few achievements on the online developer portal for Amazon but they don't show for some reason. Can someone help me with this. Any links resources that help with integrating GameCircle will be appreciated. Thanks.


How to make Box2D bodies automatically return to a initial rotation I have two long Box2D bodies, that can collide while moving one of them around with MouseJoint. I want them to try to hold their position and rotation. Blue body is moved using MouseJoint (yellow) towards the Red body. Red body has another MouseJoint Blue can push Red, but Red will try to return to the start point thanks to the MouseJoint this works just fine. Both bodies correctly rotate along the middle. This is still as I want. I change the MouseJoint to move the Blue away. What I need is both bodies return to their initial rotation (green arrows) Desired positions and rotations Is there anything in Box2D that could do this automatically? The MouseJoint does that nicely for position. I need it in AndEngine (Java, Android) port, but any Box2D solution is fine. EDIT By automatically I mean having something I can add to the object "Paddle" without the need to change game loop. I want to encapsulate this functionality to the object itself. I already have an object Paddle that has its own UpdateHandler which is being called from the game loop. What would be much nicer is to attach some kind of "spring" joint to both left and right sides of the paddle that would automatically level the paddle. I will be exploring this option soon.


Orthogonal projection matrix affecting z buffer on one device I am experimenting using Matrix.orthoM for a isometric projection, rather than Matrix.frustumM. On one device, the z buffering does not appear to be working correctly and I get a cut away effect seen below on the wheels in particular. Both devices work fine with frustum projection. Sorry not much to go on, just hoping someone will just be able to take one look and recognise the problem. Sony Xperia Z LG P920 Sony Xperia Z LG P920


How to create multiple balloon bodies in Box2D? In Box2D, how would I go about making a body that's being lifted by multiple "balloons"? These balloons would have to be able to be destroyed (for example, by a bow and arrow).


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


Detect if a sprite has left the camera in libgdx? Is there a method to know if a sprite has left the camera of the stage? or I have to do my operations? P


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


OpenGL ES 2.0 Best Practices Architecture Guide I've recently started working with OpenGL (ES 2.0) on the Android. While there is lots of documentation about the basics, I can't seem to find much about the overall architecture of OpenGL. In particular, while I see how a Program works, shaders are linked, and vertices are loaded, I can't find any indication of how this should be used to create entire scenes. That is, does one create multiple programs, reuse the programs, create multiple indexes, try to share textures shaders, etc. What I'm looking for are some solid references that explain the trade offs, and intended use, of these functions in the production of scenes. The various Android docs, and OpenGL docs also hint at several limitations in using the API, but don't give concrete information in many cases. I understand this may be a bit subjective, but I really can't find anything useful on this topic by searching. I'm unsure where else to ask and I believe that concrete useful answers can be given.


Integration of LibRocket and Android I am using OpenGL ES 2.0 to create a 2D game for Android 2.2 and was planning on using LibRocket for the GUI. Does anyone have any links or knowledge they would share on how to integrate LibRocket with the android platform? I know that it is a c library that would need to go through the NDK, however I rather not change my OpenGL rendering code to the NDK unless I have to.


What is wrong with my collision detection code? I want to check collision detection between two bitmaps but I am not getting how to do it. I read several queries and tutorials but didnt get properly. I want to check by their width and height. I have implemented some logic also but not getting where I am doing wrong public boolean collision() for(int i 0 i lt 9 i ) for(int j 0 j lt 14 j ) if(frog.getX() lt x getX() frog.getY() lt y getY() frog.getX() gt x frog.getY() gt y) if(other.getWidth() gt x amp amp other.getWidth() lt x width amp amp gt other.getHeight() gt y amp amp other.getHeight() lt y height) frog.frogShiftDown() return true public void draw(Canvas canvas) canvas.drawBitmap(bmp, x, y,null) carmove() collision()


How can set vibration option with my game in android? I am using AndEngine to develop an Android game and I want vibration to be triggered when an enemy hits a player. How can I implement this into my game?


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


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


How do I change my gravity and jumping logic to put the character at a specific height at a specific point in time? I'm making a 2D platformer on Android using libGDX. One thing I've had a problem with recently is gravity and jumping. I found a few tutorials on the internet and was able to come up with this... public static final int JUMP HEIGHT 64 public static final float JUMP GRAVITY 6.0f public static final float MAX GRAVITY 20.0f public static final float GRAVITY 19.0f private void updateGravity(float delta) if(Gdx.input.isTouched() amp amp !jumping) jumping true gravity Config.JUMP GRAVITY if(jumping) change frame to jump sprite.setRegion(walkFrames 0 ) sprite.translate(0, ( 1 gravity)) runner has landed? if(sprite.getY() lt idleY) jumping false sprite.setPosition(Config.RUNNER X, idleY) slowdown fall if (gravity lt Config.MAX GRAVITY) gravity Config.GRAVITY delta The code works and my character will jump and fall smoothly. Although the time it takes for him to jump and comedown is independent from delta the height he jumps is not. If the device lags while jumping he will jump only a portion of how high he should. For the life of me I cannot get it to make sure it jumps a specific height (JUMP HEIGHT) and in a specific time independent of the delta.


AndEngine Font Issue I am learning AndEngine. I am displaying Hello world using this code public class myactivity extends SimpleBaseGameActivity private final int CAMERA WIDTH 320 private final int CAMERA HEIGHT 480 private Camera m Camera private Scene m Scene private Font font private Text text Override public EngineOptions onCreateEngineOptions() m Camera new Camera(0, 0, CAMERA WIDTH, CAMERA HEIGHT) EngineOptions en new EngineOptions(true, ScreenOrientation.PORTRAIT FIXED, new RatioResolutionPolicy( CAMERA WIDTH, CAMERA HEIGHT), m Camera) return en Override protected void onCreateResources() determine the density WindowManager windowManager (WindowManager) getSystemService(WINDOW SERVICE) Display display windowManager.getDefaultDisplay() DisplayMetrics displayMetrics new DisplayMetrics() display.getMetrics(displayMetrics) int density (int)(displayMetrics.density) scale desired size 25 by density int fontSize (int) (25 density) font FontFactory.createFromAsset(this.getFontManager(), this.getTextureManager(), 1024, 1024, this.getAssets(), "times.ttf", fontSize, true, android.graphics.Color.BLACK) font.load() Texture fontTexture new BitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR PREMULTIPLYALPHA) font new Font(fontTexture, Typeface.create(Typeface.DEFAULT, Typeface.NORMAL), fontSize, true, Color.WHITE) mEngine.getTextureManager().loadTexture(fontTexture) mEngine.getFontManager().loadFont(font) Override protected Scene onCreateScene() m Scene new Scene() m Scene.setBackground(new Background(Color.WHITE)) text new Text(0, 0, font, "Hello Android", this.getVertexBufferObjectManager()) m Scene.attachChild(text) text.setPosition(CAMERA WIDTH 2 (text.getWidth() 2), CAMERA HEIGHT 2 (text.getHeight() 2)) return m Scene It is displaying the font like this As you can see that pixels are stretching and font is looking ugly with too much pixelation. How do I display proper font text with no pixelation or add anti aliasing to the font?


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


LibGdx set TextButton font to a TrueTypeFont I am making my first LibGdx game, and having an hard time understanding font scaling on TextButtons. Here is a comparison between the rendering on my Kindle Fire 7 and an high resolution tablet I tried using the scale() method, but the result is a pixelated mess. I've read about TrueType fonts, and I'd like to set the font size by calculating the screen density. I've tried to create a TextButtonStyle containing a font with the following Generate the font FreeTypeFontGenerator generator new FreeTypeFontGenerator(Gdx.files.internal("fonts Merriweather Regular.ttf")) TextButtonStyle style new TextButtonStyle() FreeTypeFontParameter param new FreeTypeFontParameter() Set the font size (12 as an example) param.size 12 style.font generator.generateFont(param) Set the new style to the button button new TextButton("START GAME", style) The TextButton correctly gets the new font, BUT loses the actual button as only the text gets rendered I guess that's because the new TextButtonStyle only contains information about the font and is otherwise empty. I tried setting the new font to a Skin also, but only ended with further confusion most resources I found online don't mention font rendering on TextButtons, or end up being confusing with convulted methods. Is there a simple way to achieve what I want? Thanks.


box2d rendering performance degrading extremely even with sleeping bodies? I'm working on my first smartphone game, a simple 2D platformer built with libgdx. Game maps use the Tiled level format, so a map is just a bunch of blocks. I recently started using box2d to implement character collision and movement. So this is probably naive, but what I did is for a level consisting of 64x50 ( 3200) blocks, I added a static body for every block to represent the physics for this geometry. I set these blocks to sleep, which I thought would be a hint for box2d to disregard these blocks when stepping the simulation unless they're actually interacting with the player (the only dynamic body), so this shouldn't hinder performance very much? I recall reading in the box2d manual that it employs a spatial algorithm to only even look at the bodies relevant to render the current frame. Yet having these 3500 sleeping static bodies degrades performance to such a degree that even when running the game on my MacBook Pro 2012 in a Genymotion emulator, I get about 5 FPS. I suppose I'm doing something terribly wrong. My questions would be when dealing with bodies in the thousands, am I supposed to remove add box2d bodies for my level geometry dynamically to improve performance, e.g. based on a fixed box around the player? that sounds painful and I'm wondering why the library wouldn't be able to figure out itself maybe I've just made a mistake mapping map tiles to box2d bodies? I've posted my setup code below Any help appreciated. Here's how I attach the static bodies to the level geometry it just walks the map and creates a static body for every block private void addB2Bodies(World b2World) for (int row 0 row lt blocksLayer.getHeight() row ) for (int col 0 col lt blocksLayer.getWidth() col ) BodyDef bodyDef new BodyDef() bodyDef.type BodyDef.BodyType.StaticBody bodyDef.awake false bodyDef.position.set(col 0.5F, row 0.5F) final PolygonShape shape new PolygonShape() shape.setAsBox(0.5F, 0.5F) FixtureDef fixtureDef new FixtureDef() fixtureDef.shape shape fixtureDef.friction 0 final Body body b2World.createBody(bodyDef) body.createFixture(fixtureDef) blocks col row body I only have one dynamic body, the player. As for the simulation, I step it at 1 60, with the default recommended iteration counts of 6 and 2.


cannot implement GLSurfaceView.RENDERMODE WHEN DIRTY I'm trying simply to display an openGL surface when I click the screen using GLSurfaceView.RENDERMODE WHEN DIRTY mode but the surface does not display when I click it , why ? my Activity public class ViewManager extends Activity private GLSurfaceView surfaceView Override protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) surfaceView new GLSurfaceView(this) surfaceView.setEGLContextClientVersion(2) surfaceView.setRenderer(new MyRenderer()) surfaceView.setRenderMode(GLSurfaceView.RENDERMODE WHEN DIRTY) surfaceView.setOnTouchListener(new View.OnTouchListener() Override public boolean onTouch(View v, MotionEvent event) if(event! null) if (event.getAction() MotionEvent.ACTION DOWN) surfaceView.requestRender() return true else return false ) Override protected void onResume() super.onResume() surfaceView.onResume() Override protected void onPause() super.onPause() surfaceView.onPause()


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


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


Android developer publisher royalty sharing I am creating and Android game, and will need to partner with a publisher. I am curious about how this is typically implemented. Probably publishers are going to have a difficult time trusting some developer that they don't know to pay them, assuming the develop puts the game up on Google Play. So will the publisher want the apk file so that they can put it up on Google Play themselves? Or does Google Play have a mechanism where the royalties can be automatically split between two parties from sales IAP? I know that all contracts will be different and it will depend, but I'm just looking to get a general idea of what is usual typical.


Who makes the art assets for mobile games? I know how to develop apps for Android but never tried developing games, and I want to start soon. For developing games we need sounds and high quality images (say a background, characters, logos, etc.), so how to create these? For this should we have a separate team? Or a developer can create these using any tools?


How to debug Android App Eclipse? Ok. So while this isnt a programming question. I wanted to know how do people debug apps? How do you view log cat, and where these exceptions are thrown etc? And do I need to run the app on the emulator to see all the stuff, or is there a way to view this after running the app on my phone(while not being connected to the computer) Links to plugins and tips would be really helpful, as im gonna start work on my next game, and while the first one works fine, had a lot of problems while debugging.


How can i Zoom and Drag The Multiple Image in RelativeLayout i try but it did not see the effect for the zoom and Rotate the image ..Here is my code.... ima1 (ImageView) findViewById(R.id.image) ima1.setOnTouchListener(new View.OnTouchListener() Override public boolean onTouch(View v, MotionEvent event) TODO Auto generated method stub int x cord (int) event.getRawX() int y cord (int) event.getRawY() layoutParams1 (RelativeLayout.LayoutParams) ima1 .getLayoutParams() switch (event.getActionMasked()) case MotionEvent.ACTION DOWN savedMatrix.set(matrix) start.set(event.getX(), event.getY()) mode DRAG lastEvent null break case MotionEvent.ACTION POINTER DOWN oldDist spacing(event) if (oldDist gt 10f) savedMatrix.set(matrix) midPoint(mid, event) mode ZOOM lastEvent new float 4 lastEvent 0 event.getX(0) lastEvent 1 event.getX(1) lastEvent 2 event.getY(0) lastEvent 3 event.getY(1) d rotation(event) break case MotionEvent.ACTION POINTER UP mode NONE lastEvent null break case MotionEvent.ACTION MOVE if (mode ZOOM) float newDist spacing(event) if (newDist gt 10f) matrix.set(savedMatrix) float scale (newDist oldDist) matrix.postScale(scale, scale, mid.x, mid.y) layoutParams1.leftMargin x cord layoutParams1.topMargin y cord ima1.setLayoutParams(layoutParams1) System.out.println(" Mode Zoom " mode " " scale ) else if (mode DRAG) System.out.println(" DRAG " x cord " " y cord) if (x cord gt windowwidth) x cord windowwidth if (y cord gt windowheight) y cord windowheight layoutParams1.leftMargin x cord layoutParams1.topMargin y cord ima1.setLayoutParams(layoutParams1) else if (lastEvent ! null amp amp event.getPointerCount() 2) newRot rotation(event) float r newRot d float values new float 9 matrix.getValues(values) float tx values 2 float ty values 5 float sx values 0 matrix.postRotate(r, mid.x, mid.y) System.out.println(" Mode Rotate " mode) break ima1.setImageMatrix(matrix) return true ) my Layout XML file is ... lt ImageView android id " id image" android layout width "50sp" android layout height "50sp" android clickable "true" android src " drawable ic launcher" gt lt ImageView gt lt ImageView android id " id image1" android layout width "50sp" android layout height "50sp" android layout x "118dip" android layout y "30dip" android src " drawable ic launcher" gt lt ImageView gt


How do I make a Box2D object that makes objects passing through it slower? I wish to have a sort of "slow motion" or "slow down" effect on a players character when they walk in a mud area, usually the character velocity is 3f constant in any one direction. The problem is I tried to declare a rectangle to cover the object mud area but I am only able to get a solid rectangle area and therefore the character cannot walk through or over this area, the desired action would be having the character movement slow down while walking in the mud area. The code below is what I have tried to make this sort of region, but this code only makes a solid object which the character cannot pass through. final Rectangle rect new Rectangle( object.getX(), object.getY(), object.getWidth(), object.getHeight(), vbom ) final FixtureDef fixDef PhysicsFactory.createFixtureDef( 0.0f, 0.0f, 1.0f ) Body body PhysicsFactory.createBoxBody( physicsWorld, rect, BodyDef.BodyType.KinematicBody, fixDef ) body.setUserData( typeOfObject ) physicsWorld.registerPhysicsConnector( new PhysicsConnector( rect, body ) )


Why doesn't RGB565 lead to a smaller memory footprint on Android? I'm using LibGDX for my game. I'm loading 9 bitmaps into memory at once using the AssetManager, about 512x512 pixels each on average. TextureParameter texParam new TextureParameter() texParam.format Format.RGBA8888 assetManager.load("islands island 0.png", Texture.class, texParam) assetManager.load("islands island 1.png", Texture.class, texParam) assetManager.load("islands island 2.png", Texture.class, texParam) assetManager.load("islands island 3.png", Texture.class, texParam) assetManager.load("islands island 4.png", Texture.class, texParam) assetManager.load("islands island 5.png", Texture.class, texParam) assetManager.load("islands island 6.png", Texture.class, texParam) assetManager.load("islands island 7.png", Texture.class, texParam) assetManager.load("islands island 8.png", Texture.class, texParam) However, if I switch the format to Format.RGB565, then run the Heap allocation tracker in the DDMS view of Eclipse, I see absolutely no change in the memory allocated. The bitmaps being drawn on the screen though are being rendered differently (without an alpha channel when I use RGB565). Am I missing something? Why aren't the bitmaps using less memory?


Pop up screen on libgdx Hi I want to make a pause and credits screen for an android game with libgdx the idea I have is creating a new screen like a popup that pauses the background screen and then, I can render the screen I want to show. Please give me some info or ideas for this.


Do Google Apple provide the multiplayer servers for an app themselves? I have an app that I have been working on and I was wondering does Google Apple host the server requirements for the multiplayer aspects of an app?


Is there any "object" in monogame for windows phone 8, that is similar to Toast in Android? The title pretty much sums it all. Is there any "object" in monogame for windows phone 8 (for monogame to be exact), that is similar to Toast in Android? My purpose is to give a notification hint at what user do, until certain period until next user input. For example If the player tapped "attack", then there is text shown "Select your target" in either top or bottom screen. Just like Toast in android. Note 1 I can do it manually, but i'm just curious. If I can use a pre made function (such as Toast) it'll be simpler to implement, rather than making it myself. Note 2 Mine is a turn based tactic game (such as FF Tactic) Thank you.


Poor performance in android when running APK, runs fine in browser I have created a small game project in HTML5 using Phaser engine (tried both 1.1.5 and 1.1.6). Then to port it to mobile platform, used Phonegap Cordova for Windows Phone 8, Android and iOS. In my game, there are around 10 elements, which get animated (moving from point a to point b and some rotation at same time). On iOS and Windows Phone 8, I didn't face any issue. But with Android, performance is unacceptable. On the other hand, if I run my game via device browser, it run smooth without any lag. But compiled APK runs very jerky and elements move very slow amp in flickering manner. I have checked android hardware acceleration flag is set to "true" in manifest file. Tried changing it false too, but that didn't reflected any change in performance. I have checked same on Android 4.2 on Samsung S2 device and on that performance is better. But on Asus Nexus Tab 7 (running Android 4.4) its very jerky, while the OS and Device both are latest. Also checked on another device running Android 4.3 (Samsung Galaxy Grand Duos) and on that too performance is not good at all. In my game tried both WebGL Canvas rendering (Phaser engine uses Pixi.js, which fallback to 2d canvas if WebGL isn't supported), but no change. Similarly with easeljs. If anyone else faced similar issue and can suggest any way to get native like performance. I checked cocoonjs examples and while they seems smooth and acceptable, I can't go for that route.


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


Making color of sprite darker or lighter Is there any way to make a sprite darker or lighter in AndEngine? I dont want to use the alpha thing. Nor I want to loose the texture design of the image.


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


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


android game performance regarding timers Im new to the game dev world and I have a tendancy to over simplify my code, and sometimes this costs me alot fo memory. Im using a custom TimerTask that looks like this public class Task extends TimerTask private MainGamePanel panel public Task(MainGamePanel panel) this.panel panel When the timer executes, this code is run. public void run() panel.createEnemies() this task calls this method from my view public void createEnemies() Bitmap bmp BitmapFactory.decodeResource(getResources(), R.drawable.female) if(enemyCounter lt 24) enemies.add(new Enemy(bmp, this)) enemyCounter Since I call this in the onCreate method instead of in my views contructor (because My enemies need to get width and height of view). Im wondering if this will work when I have multiple levels in game (start a new intent). And if this kind of timer really is the best way to add a delay between the spawning time of my enemies performance wise. adding code for my timer if any1 came here cus they dont understand timers private Timer timer1 new Timer() private long delay1 5 1000 5 sec delay public void surfaceCreated(SurfaceHolder holder) timer1.schedule(new Task(this), 0, delay1) I call my timer and add the delay thread.setRunning(true) thread.start()


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)


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


What debugging info should I put in the "About" box I'm developing an Android game with the idea of publishing it, and I wonder what info should I put in the "About" dialog that many main menus have. The idea is to make bug report and debugging easier. Users can click in the "About" box and read the details of their device, and include them in any bug report they send me I know Google sends relevant device data to the developer when there's a crash, but I'm thinking in bugs that not necessarily end with an abnormal program termination. So far, I've added API number of device, screen size, screen density, and number of processors. My current "About" screen is something like this Game titleGame iconAPI versionScreen sizeScreen densityNumber of processors (just in case, because game uses threading)Game version numberDeveloper e mailCopyright information If anyone has experience publishing and maintaining an app, specially in Android, I want to know what can I add there to make user reporting and debugging easier.


How do games such as aa Game have high levels in the structure of their code How do games such as aa Game have high levels in the structure of their code? I mean if we want create a game with high levels, should we create and use a class for each level? I do not want code from you. only I want know for creating a game with high levels in android, What we should do in coding? Is it good if we create and use a class for each level?


Android notifications with Unity I'm working for the first time on a game for Android using Unity and I need to use Google Cloud Messaging to receive push messages. I've already done the integration of my Unity project with GCM, using this project, and of now I can receive and read messages sent to my phone while the game is running. However, I want to be able to receive them while the app is closed. Currently, if I send a message and the app is not running, I get an error stating that my app stopped working. So, in essence, I want to know what are the steps to handle incoming push messages when my app is closed, display them as a notification in Android and launch my game app when I open such notification? What else should I do outside Unity so my project can handle Android notifications while closed?


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


No sound in android using Phaser I have developed a simple game using Phaser. It's work perfect on ios webkit, but on android there is no sound. What causes this problem on one platform but not the other? We are using this code to load this.load.audio('game audio', 'audio bgm.mp3') Playing this.music this.add.audio('game audio') this.boom.play()


Creating new games on Android and or iPhone I have a succesfull Facebook poker game that is running very nicely. I was asked if I can port my game to other platforms mainly mobile devices (phones as well as tablets, would tablets need a separate version)? I am currently a PHP programmer (and game designer) and I simply don't have the time to learn Android or other languages so I have decided to pay third parties to port the game for me (if possible). Which programming language is needed for the following four devices Android phone, iPhone, iPad and tablets? Can they all run off a central SQL database? If no then I don't think I'm interested. Do any of these run Flash? Have I covered all my main bases here? For example is programming for an Android phone that much different from programming for an Andorid tablet? They will have slightly different graphics (because the tablet has a greater screen area might as well use it) but does either version need to be developed separately, from scratch? Same goes for iPhone iPad, do they really need to be programmed separately if the only difference is the graphics?


Can I publish games with adult content to Android Market? I have a very old adult (e.g. boobs and stuff) arcade game (think Delphi 7 DirectX 8 age), that currently is backported to Droid. Can the game be published to Android Market? Are there any age restrictions?


Move a 2D square on y axis on Android GLES2 I am trying to create a simple game for Android. To start, I am trying to make the square move down the y axis, but the way I am doing it, it doesn't move the square at all and I can't find any tutorials for GLES20. The onDrawFrame function in the render class updates the user's position based on acceleration due to gravity, gets the transform matrix from the user class which is used to move the square down, then the program draws it. All that happens is that the square is drawn no motion happens public void onDrawFrame(GL10 gl) user.update(0.0, phy.AccelerationDewToGravity) GLES20.glClear(GLES20.GL COLOR BUFFER BIT GLES20.GL DEPTH BUFFER BIT) Re draws black background GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL FLOAT, false, 12, user.SquareVB) triangleVB) GLES20.glEnableVertexAttribArray(maPositionHandle) GLES20.glUniformMatrix4fv(maPositionHandle, 1, false, user.getTransformMatrix(), 0) GLES20.glDrawArrays(GLES20.GL TRIANGLE STRIP, 0, 4) The update function in the player class is public void update(double vh, double vv) Vh vh Increase horrzontal Velosity Vv vv Increase vertical velosity Matrix.translateM(mMMatrix, 0, (int)Vh, (int)Vv, 0) Matrix.translateM(mMMatrix, 0, mMMatrix, 0, (float)Vh, (float)Vv, 0)


Do I need to copyright my game before releasing it on the Android Play store? I am developing a game on Android and I was wondering if I have to copyright it before putting it on the store (so no one can steal the idea)?


How can I display an image larger than the screen and allow the user to scroll to see more? I am new to development and trying to understand my options. I have found no info or threads on this idea so I was hoping some of you folks could weigh in. When developing for Android, I know that different images optimized for different screen densities and sizes are typically used. I am wondering if anyone just flicks in the resizing and develops so that the smallest device (i.e. phone) shows enough of say a game world to make it relevant for the user and larger screens (i.e. tablet) just show more of that world but at the same scale. I guess you would have to have a couple versions for different densities or graphics could appear too small, but it could really cut down on the number of asset files the user would have to download. Though the whole background world image would be one big file. I assume when downloading an app graphics files for all screen sizes and resolutions are downloaded and then the app detects the screen size and chooses from among them for display.


How to execute a piece of code for X seconds in Andengine? I need to execute some code in my game for 5 seconds using the Andengine framework. So far, I've tried with the onTimePassed update handler scene.registerUpdateHandler(new TimerHandler(5f, true,new ITimerCallback() public void onTimePassed(final TimerHandler pTimerHandler) code here But that only executes AFTER 5 seconds have passed by. I've also tried with the onUpdate but, keeping apart performance issues, there's no way I can count how many seconds have passed by since the execution entered the loop. If it helps, I only need the code to execute once per second for 5 seconds. Thank you!


How to rotate a sprite on circle in android using Libgdx Dear Fellow Game Developers i am newbie to Android Game Development,i like to know how we can develop a sprite rotate in circle on android,with help of libgdx, i do have a image in assets folder,cant load it in emulator,following code is using to load image in texture texture new Texture(Gdx.files.internal("1325603701 wordpress.png"))


libGDX new TextureAtlas(filename) and new Texture(filename) drawing stale image data I'm trying to draw an image using libgdx but no matter what I do, libgdx seems to insist on drawing a portion of an image I had loaded and used in an earlier game screen. In my current game screen (class implements Screen), I have tried loading the image using both an atlas and loading it via the Texture class. However, when I draw the image in my render method, portions of an image that I had loaded previously are being displayed instead. Not the image that I am passing to the draw method! I have tried both loading the image using a Texture Atlas and directly private TextureAtlas deckAtlas private TextureRegion aceHearts In class constructor deckAtlas new TextureAtlas("deck.atlas") aceHearts deckAtlas.findRegion("ace heart") and Texture texture new Texture("deck.png") sprite new Sprite(texture, 72, 0, 72, 100) Depending on the method used above, I try to display by either game.batch.begin() game.batch.draw(aceHearts, 100, 100) game.batch.end() Or game.batch.begin() sprite.draw(game.batch) game.batch.end() where game is an instance of a class that extends Game and batch was initialized in that class's create method. To start from the beginning, in my class that extends Game I call setScreen(new MainMenu(this)) In Main Menu Screen, I load a skin using skin new Skin(Gdx.files.internal("uiskin.json")) and create a bunch of Scene.2d UI widgets with that skin (the packed image that's loaded by the skin is contributing the image that is being drawn on my next screen when I don't want it to). Finally, I create the Screen in which I am having the above problems using game.setScreen(new TableGame(game)) So to summarize, I am loading an image in a class that implements Screen, but that image never gets drawn to the screen. Instead, an image that I had used in the previous screen is being displayed instead. Any ideas why? Thanks for any help. I am using libGDX 1.3.1 (I think).


Horizontal scroll only part of the view I would like to know the best way on how to implement horizontal scrolling to only part of the view and vertical scrolling to complete view. I was able to achieve horizontal and vertical scrolling to the complete view. If I have to use layers can you explain a bit more on how to achieve layers and draw shapes on those layers separately. I tried using two different SurfaceViews it does not work. Here is my code for scrolling horizontally. Override public void onDrawFrame(GL10 unused) GLES20.glClear(GLES20.GL COLOR BUFFER BIT) Set the camera position (View matrix) Matrix.setLookAtM(mVMatrix, 0, mXOffset, mYOffset, 3, mXOffset, mYOffset, 0f, 0.0f, 1.0f, 0.0f) Calculate the projection and view transformation Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0) mGraph.draw(mMVPMatrix) mLine.draw(mMVPMatrix) msquare.draw(mMVPMatrix)


Desaturate texture using mask in OpenGL 2 I have a very large texture i am using as background and i want to apply a filter to a small part of it, the "small part" is defined by the alpha layer of another texture i have (which is still RGB8888), i am not sure what's the best approach to do this. I'd like to keep the same (very simple) shader i am already using for other sprites, which is similar to the basic one, i.e. precision mediump float uniform sampler2D uTexture varying vec2 vTexPos void main() gl FragColor texture2D(uTexture, vTexPos) So, i have some questions How can i apply my filter only to "masked" region and avoid drawing others? Do i have any performance loss if i draw the big texture again once loaded to just apply it to a small portion of the screen? Can i map a second texture to the shader and use something like "if uTexture2 ! null" apply as mask? Will this give me any performance gain compared to using a second shader? Both textures are premultiplied, how should i handle alpha masking? What id like to do is something like this (original, mask, result) My environment is Android 4.0, im using GLES20.


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


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


How can I use ParallaxBackground in AndEngine? I'm new to game development with AndEngine. I want to add ParallaxBackground but I don't know how to change the background when the player moves. I'm using arrows for moving a player. Now my question is where I write the code parallaxBackground.setParallaxValue(5) ? I have written this line in onAreaTouched method of arrow but it does not work. Code private Camera mCamera private static int CAMERA WIDTH 800 private static int CAMERA HEIGHT 480 private BitmapTextureAtlas bgTexture private ITextureRegion bgTextureRegion Override protected void onCreateResources() BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx ") bgTexture new BitmapTextureAtlas(getTextureManager(),2160,480,TextureOptions.REPEATING BILINEAR) bgTextureRegion BitmapTextureAtlasTextureRegionFactory.createFromAsset(bgTexture, this, "background.png", 0, 0) bgTexture.load() Override protected Scene onCreateScene() this.getEngine().registerUpdateHandler(new FPSLogger()) Scene scene new Scene() scene.setBackground(new Background(Color.BLACK)) final ParallaxBackground parallaxBackground new ParallaxBackground(0, 0, 0) final VertexBufferObjectManager vertexBufferObjectManager this.getVertexBufferObjectManager() parallaxBackground.attachParallaxEntity(new ParallaxEntity(0.0f, new Sprite(0, CAMERA HEIGHT this.bgTextureRegion.getHeight(), this.bgTextureRegion, vertexBufferObjectManager))) scene.setBackground(parallaxBackground) Robot robot new Robot() add Player final AnimatedSprite animatedRobotSprite new AnimatedSprite(robot.centerX, robot.centerY, 122, 126, (ITiledTextureRegion) robotTextureRegion, getVertexBufferObjectManager()) scene.attachChild(animatedRobotSprite) animatedRobotSprite.animate(new long 1250,50,50 ) add right arrow button Sprite rightArrowSprite new Sprite(0, CAMERA HEIGHT 70, rightArrowTextureRegion, getVertexBufferObjectManager()) Override public boolean onAreaTouched(TouchEvent pSceneTouchEvent,float pTouchAreaLocalX, float pTouchAreaLocalY) switch (pSceneTouchEvent.getAction()) case TouchEvent.ACTION DOWN moveRight true parallaxBackground.setParallaxValue(5) break case TouchEvent.ACTION MOVE moveRight true break case TouchEvent.ACTION UP moveRight false break default break return super.onAreaTouched(pSceneTouchEvent, pTouchAreaLocalX, pTouchAreaLocalY) scene.attachChild(rightArrowSprite) scene.registerTouchArea(rightArrowSprite) scene.setTouchAreaBindingOnActionDownEnabled(true) scene.setTouchAreaBindingOnActionMoveEnabled(true) scene.registerUpdateHandler(new IUpdateHandler() Override public void reset() Override public void onUpdate(float pSecondsElapsed) if ( moveRight ) animatedRobotSprite.setPosition(animatedRobotSprite.getX() speedX, animatedRobotSprite.getY()) ) return scene


Is it possible to use 3G internet for a TCP IP game server? I'm working on a turned based multiplayer android game with a friend. I started working on the game server and client using socket programming. I found a few tutorials on how to implement a basic chat on android and I started extending that example to suit my needs. Basically the game is really simple and the communication only include sending a few string from the client to the server every turn and sending the calculated scores back to all the clients after each turn. the idea is that one of the players creates the game and thus initialize the server, and each player connects to this client using ip. I tried this solution and it seems to work great when all the players are using the same wifi connection or by using router port forwarding. The problem is when trying to use 3G internet for the server, I guess the problem is that 3G ip address isn't global and you can't use port forwarding there, correct me if I'm wrong here. Is there a way to overcome this issue? or the only solution is to limit my game to wifi only or think of a different solution than the standard socket programming solution? I.E web server etc. what do you think would be the best approach here? Thanks.


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


Google Play 3rd Party Payment Allowed? Does Google allow 3rd party payment solutions to be enabled in developers' apps (i.e., Paypal, carrier SMS payment), especially in countries where Google Checkout isn't present? Or does this violate any policy of theirs? Please reference the policy in your answer if you can, and thanks in advance to all who answer.


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 to debug shaders running on Android 4.x devices? I have tried some of the existing inspectors such as RenderDoc and gapid, but none of them can be used with Android 4.x. Latest version of gapid requires Android 6.0 and RenderDoc requires Android 5.0. But I need to debug shaders in my app running on a Galaxy Tab 3 8.0 (SM T311, ARM Mali 400), which uses Android 4.2.2. I cannot upgrade its Android version. The app was made with Unity 2018.4 and targets Android 4, ARMv7. How can I inspect amp debug my shaders running on this kind of device?


GLSL Shader not compiling (Android LibGDX) and no log available I'm trying to get a "ripple" shader working for OpenGL ES 2.0 (using LibGDX). However, I can't get it to compile, and for some reason ShaderProgram.getLog() returns an empty string even though the Shader didn't compile. I am 100 confident that the vertex shader is correct.. here's the fragment shader (not written by me, but I modified it a bit long time ago.. when I had a desktop project and it worked back then) version 120 precision mediump float varying vec2 v texCoords uniform float time uniform float alpha uniform float waveLengthMultiplier uniform sampler2D u texture void main() vec2 center vec2(0.5, 0.5) vec2 tc v texCoords.xy vec2 p 1.0 2.0 (tc offset) float len length(p) waveLengthMultiplier vec2 uv tc (p len) cos(len 12.0 time 4.0) 0.03 vec3 col texture2D(u texture, uv).xyz gl FragColor vec4(col, alpha) I'm still not very well versed with shaders, as I've used them only a little.. Like I said, getLog() returns an empty string, so I'm hoping someone spots an error in the code.


Pinch in zoom in android In My layout parent as Relative layout and then am having Scroll view inside Linear layout now am having child views as Image view Text View Web view and Recycle view and 2 buttons is there now i want to pinch in zoom entire layout please help me out Regards Govardhana


Fair sharing income with designer I am developing my android game, 2D Sidescroll arcade game, its almost finished, I found artist who wants to cooperate with me, creating graphics for my game, but we have to discuss how much he will receive if there will be any income from our game. How do you game developers handle this? What is fair share for an artist? Here is little description on my and his work, to estimate work value Done by me game idea, story game code (6 months of development) all game features, everything generally visual level editor levels created by me (more than 120) android license bought be me (I know its cheap but still it is value) sound purchased by me Done by artist game graphics generally, ground tileset, game characters, 5 tiled monsters (animation), around 30 different graphics for different game objects (like environment elements, obstacles etc) I would be grateful for some informations, thank you!


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


Do I need to copyright my game before releasing it on the Android Play store? I am developing a game on Android and I was wondering if I have to copyright it before putting it on the store (so no one can steal the idea)?


I am looking for a simple tutorial for sprite animation in android Possible Duplicate What 39 s the best way to create animations when doing Android development? I saw a couple of them on the internet but they are beyond my level of understanding ...I need to start with basics in a simpler way if possible...can anyone guide me to some good online resources for this


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


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


Gradually reduce speed Basically I am working on following application of android version Party Games Drinking Wheel For this I want to rotate wheel and want to stop wheel at specific point. But I want this with gradually decreasing speed. For example at start I have speed of 10 then at stop time it at 0. So wheel stop smoothly. At presently I have working code but it stop suddenly. registerEntityModifier(new RotationModifier(desireTime, 359f, desireRotation, new IEntityModifierListener() Override public void onModifierStarted(IModifier lt IEntity gt pModifier, IEntity pItem) Override public void onModifierFinished( IModifier lt IEntity gt pModifier, IEntity pItem) mPointer.stopRotation() showWindowAfterSomeTime(randomSegment) , EaseLinear.getInstance())) I want some help in this. Thanks for your time.


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


Performance problems with many entities in AndEngine I'm developing a rolling scene based game. I'm loading all the entities from a XML file and create them in the Loading Scene. I recently increased the game width, and, by doing so, I now have about 300 entities (instead of about 100) in the whole level. This causes a performance problem the game is "Lagging" "jumping" and everything moves slowly. I'm loading the entities with the "LevelLoader". I tried to add levelObject.setCullingEnabled(true) before returning the object in public IEntity onLoadEntity(final String pEntityName, final Attributes pAttributes) ... and also set Dithering in the engineOptions engineOptions.getRenderOptions().setDithering(true) but it didn't help... I'm implementing the sprite created from XML as Matin does in his tutorial http www.matim dev.com full game tutorial part 11.html Is there a better way to handle such a high number of entities? Or is there another way to improve the performance?


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


Android developer publisher royalty sharing I am creating and Android game, and will need to partner with a publisher. I am curious about how this is typically implemented. Probably publishers are going to have a difficult time trusting some developer that they don't know to pay them, assuming the develop puts the game up on Google Play. So will the publisher want the apk file so that they can put it up on Google Play themselves? Or does Google Play have a mechanism where the royalties can be automatically split between two parties from sales IAP? I know that all contracts will be different and it will depend, but I'm just looking to get a general idea of what is usual typical.


Rotation of Rectangle along Y axis transformed to parallelogram After the rotation of a rectangular view along the Y axis, about its center, transformed into parallelogram, how do I get the rotated parallelogram coordinates? By Y axis, I mean perpendicular to the device screen. Rotated rectangle Original rectangle Not using the openGl, ViewProperty animator is used!


Game Development at iOS, Android and PC with OpenGL ES I'm beginning iOS apps development, and my aim is to make games to launch on App Store. But I want to know if it's possible to program a game on Xcode with OpenGL ES (C game logic), integrate it on iOS with ObjC, and with that same game code (OpenGL ES C ), implement it for Android with Java and to PC. I have great interest to publish the same game on App Store, Google Play and specially Steam, and intent to build my personal 2D engine API when I have more experience on graphic programming. Do you know where can I find material to learn this?


How to sell Android game if selling through Market is not available in your country Android Market doesn t allow developers from my country to sell app. From what I understand the only chance to make some profit is to place ads in my application. Does ads make a decent profit or is there some other way to earn money are there any other payments system available for Android to bypass Google s limitations?


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


Android emulator with acceleration and gyroscope simulation Is there an Android emulator that is compatible with eclipse that can simulate acceleration and tilting of a mobile device?


How do I determine a device's default orientation? I am developing a game with accelerometer controls. This works well on all the mobile phones I've tested it on. However, when testing on a tablet, the y and x axes are reversed, presumably because the device's default orientation is landscape. How can I identify the default orientation of the device, to set my axes accordingly? (I'm using Android SDK 1.5 1.7.)


libgdx SpriteBatch and ShapeRenderer projection wrong I'm using LibGDX and the SpriteBatch and ShapeRenderer are having a perspective problem or something... When I draw something with both (code below), the planet texture is smaller than it should be. I can even manually set the size values and it's still wrong. I'm setting Matrix4 matrix cam.combined batch.setProjectionMatrix(matrix) sr.setProjectionMatrix(matrix) and the draw code is... outline sr.begin(ShapeRenderer.ShapeType.Filled) sr.setColor(Color.BLACK) sr.circle(c.getPos().x,c.getPos().y,c.getSize()) sr.end() planet tex batch.begin() batch.draw(c.getTexture(), c.getDrawPosition().x, c.getDrawPosition().y, c.getSize(), c.getSize()) batch.draw(c.getShadow(), c.getDrawPosition().x, c.getDrawPosition().y, c.getSize(), c.getSize()) batch.end() Both the texture and the shape are centered properly and c.getSize() should always be returning the same value, so I'm trying to figure out why this isn't working. I've tried manually setting the value for size and it still does it, so either the texture is being rendered at the wrong size or somehow the ShapeRenderer and SpriteBatch are using a different camera projection.


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


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


Can i use Soccer football team names in my web, iphone and android apps? If i don't use logos, player names, sponsors or any images can i use team names in a for profit app? The reason i mention these is that i have seen countless references to images and badges but not the name in text format only. Eg print the league table or show a fixtures list or show some user stats in relation to a team name in the app. I read that a court has ruled in 2012 that fixture lists are not copyright able as they involve pure scheduling logic and no artistic or innovative value. Also i know that logos, shield, images, player names and images etc are copyright able. Do team names fall under fair use if it is purely the team name in a fixture list or in a list or teams?


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


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


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


Is an in app purchase required to unlock game in order to bypass pirating acceptable? I'm considering writing a mobile game and looking at distribution. The game will have a server requirement, which means I will have to pay for bandwidth, hosting, processor time, etc. Because of that I'll need to make at least a little money off this thing. According to the press piracy is rampant in the android community. To get around this, I'm thinking of implementing a simple model where the game is free, perhaps allowing play for X number of turns or something, and then requiring an in app purchase to continue to play. I would clearly explain this in the app description, and the in app purchase would be managed per account so it would be linked to your google play account so you wouldn't have to re purchase every time you get a new device. Would gamers accept this model or see it as unreasonable?


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


Saving data across same game in multiple devices Is there any library or something that works like iCloud but for different operating systems (Android, IOS, Windows Phone) that allow me to save game data to cloud and open the game data from another device to sync the game progress?


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


libgdx sprite placement Im making a soccer game where you basically have to shoot the ball to the goal and the ball goes to where you touch the screen. Im having an issue with the ball though, when the ball spawns on the player it goes directly to the top left corner of the screen, without even touching the screen. This might be really easy but I cant seem to find the solution Here's the code Ball class public void shootToward(float targetX, float targetY) velocity.set(targetX position.x, targetY position.y) public void update(float deltaTime) position.add(velocity.x deltaTime, velocity.y deltaTime) velocity.scl(1 (1f deltaTime)) Game class public void create () cam new OrthographicCamera() cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) batch new SpriteBatch() batch.setProjectionMatrix(cam.combined) player new Sprite(player1) player.setX(MathUtils.random(Gdx.graphics.getWidth())) player.setY(MathUtils.random(Gdx.graphics.getHeight() 2)) b.position.set(player.getX(), player.getY()) public void render () Gdx.gl.glClearColor(255, 255, 255, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) b.update(Gdx.graphics.getDeltaTime()) batch.begin() batch.draw(bg, 0, 0) batch.draw(goal1, Gdx.graphics.getWidth() 4 20, Gdx.graphics.getHeight() 180, 420, 130) if (!Gdx.input.isTouched()) batch.draw(bs, b.position.x, b.position.y) b.shootToward(Gdx.input.getX(), Gdx.graphics.getHeight() Gdx.input.getY()) player.draw(batch) batch.end() Thanks in advance.


Collision detection problems using AABB's I implemented a simple collision detection routine using AABB's between my main game sprite and various platforms (Please see code below). It works great, but I'm now introducing gravity to make my character fall and it's shown up some problems with my CD routine. I think the crux of the matter is that my CD routine moves the sprite back along the axis in which it has penetrated the least amount into the other sprite. So, if it's more in the Y axis than the X, then it will move it back along the X Axis. However, now my (hero) sprite is now falling at a rate of 30 pixels per frame (It's a 1504 high screen I need it to fall this fast as I want to try to simulate 'normal' gravity, any slower just look weird) I'm getting these issues. I will try to show what is happening (and what I think is causing it although I'm not sure) with a few pictures (Code below pictures). I would appreciate some suggestions on how to get around this issue. For clarification, in the above right picture, when I say the position is corrected 'incorrectly' that's maybe a bit misleading. The code itself is working correctly for how it is written, or put another way, the algorithm itself if behaving how I would expect it to, but I need to change it's behaviour to stop this problem happening, hope that clarifies my comments in the picture. My Code public boolean heroWithPlatforms() Set Hero center for this frame heroCenterX hero.xScreen (hero.quadWidth 2) heroCenterY hero.yScreen (hero.quadHeight 2) Iterate through all platforms to check for collisions for(x 0 x lt platformCoords.length x 2) Set platform Center for this iteration platformCenterX platformCoords x (platforms.quadWidth 2) platformCenterY platformCoords x 1 (platforms.quadHeight 2) the Dif variables are the difference (absolute value) of the center of the two sprites being compared (one for X axis difference and on for the Y axis difference) difX Math.abs(heroCenterX platformCenterX) difY Math.abs(heroCenterY platformCenterY) If 1 Check the difference between the 2 centers and compare it to the vector (the sum of the two sprite's widths 2. If it is smaller, then the sprites are pverlapping along the X axis and we can now proceed to check the Y axis if (difX lt vecXPlatform) If 2 Same as above but for the Y axis, if this is also true, then we have a collision if(difY lt vecYPlatform) we now know sprites are colliding, so we now need to know exactly by how much penX will hold the value equal to the amount one sprite (hero, in this case) has overlapped with the other sprite (the platform) penX vecXPlatform difX penY vecYPlatform difY One sprite has penetrated into the other, mostly in the Y axis, so move sprite back on the X Axis if (penX lt penY) hero.xScreen penX (heroCenterX platformCenterX gt 0 ? 1 1) Sprite has penetrated into the other, mostly in the X asis, so move sprite back on the Y Axis else if (penY lt penX) hero.yScreen penY (heroCenterY platformCenterY gt 0 ? 1 1) return true Close 'If' 2 Close 'If' 1 Otherwise, no collision return false


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


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


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.


Candy crush saga popup like messages I was wondering how could I make in Android something like the popup messages seen in Candy Crush Saga, those messages like "Delicious!", "Tasty!" or similar As well as the score of each movement, they will pop up at first and then vanish How could I implement something like that in Android?


Reloading Resources on Resume I'm having a problem with my game. If I press the "Home button" the game is paused... everythings fine, but if I then go back to the game all the resources are reloaded before I can continue the game. And it takes quite a bit. Is this normal, or is there a way to avoid the reloading? I have write following code in onResume and onPause method. It loads same texture again and again on resume of game. Override protected void onPause() super.onPause() if (Utility.flagSound amp amp mScene ! null) if (mScene.getUserData().equals(Constants.GAME SCENE)) Utility.isPlayLevelMusic false else Utility.isPlayLevelMusic true audioManager.gameBgMusic.pause() audioManager.levelBgMusic.pause() if (this.mEngine ! null amp amp this.mEngine.isRunning()) this.mEngine.stop() Override protected void onResume() super.onResume() if (audioManager ! null amp amp Utility.flagSound amp amp dataManager ! null) if (Utility.flagSound) if (Utility.isPlayLevelMusic) audioManager.levelBgMusic.play() else audioManager.gameBgMusic.play() if (this.mEngine ! null amp amp !this.mEngine.isRunning()) this.mEngine.start() I would be glad if anybody could help...


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


How to use proximity sensor in android with unity3d? I want to create a android game with unity3d using proximity sensor an I don't know how to access that sensor with java script


How many threads should an Android game use? At minimum, an OpenGL Android game has a UI thread and a Renderer thread created by GLSurfaceView. Renderer.onDrawFrame() should be doing a minimum of work to get the higest FPS. The physics, AI, etc. don't need to run every frame, so we can put those in another thread. Now we have Renderer thread Update animations and draw polys Game thread Logic amp periodic physics, AI, etc. updates UI thread Android UI interaction only Since you don't ever want to block the UI thread, I run one more thread for the game logic. Maybe that's not necessary though? Is there ever a reason to run game logic in the renderer thread?


How to debug shaders running on Android 4.x devices? I have tried some of the existing inspectors such as RenderDoc and gapid, but none of them can be used with Android 4.x. Latest version of gapid requires Android 6.0 and RenderDoc requires Android 5.0. But I need to debug shaders in my app running on a Galaxy Tab 3 8.0 (SM T311, ARM Mali 400), which uses Android 4.2.2. I cannot upgrade its Android version. The app was made with Unity 2018.4 and targets Android 4, ARMv7. How can I inspect amp debug my shaders running on this kind of device?