_id
int64 0
49
| text
stringlengths 71
4.19k
|
---|---|
7 | Project updates don't show up on mobile device I've made a small application with libgdx framework, which works perfectly on desktop. It runs on Android too, however once I change something in my main project and try to recompile it on my phone, it seems like the Android still runs the old version. I've tried to re install the app, but it does not help. The only way I can see the changes on my phone is to recreate a different Android project. Any ideas what might be causing this kind of behavior? My projects are created the way it is shown here http code.google.com p libgdx wiki ProjectSetup EDIT Not sure why, but everything seems to work fine after "re installing" Eclipse |
7 | Acceptable sound quality stereo needed for an Android game? I have various simple short sound effects (damage sound, dying sound, thunderbolt, fanfare, breaking) for a game that is developed for Android currently. I use OGG files 96kbps VBR, 44.1KHz, 2 channels (that means stereo, right?). I read the other stackexchange topics about "acceptable sound quality", but they're too general, address too many things. My experience is that even with 80kbps, my effects sound OK. But I tested it on a limited number of Android devices (including a Sony Ericsson Xperia Neo and a HTC Desire HD). My questions For mobile phones and tablets, generally, what parameters are recommended? Won't my 80kbps sounds be bad on a newer device (such as a modern tablet)? I don't hear any difference between stereo and mono (2 channels vs. 1 channel, right?), is there any noticeable difference at all for mobile phones tablets? (in terms of the player experience) May it worth it at all? I assume that stereo sounds take much more in memory (when they're decoded to PCM), despite of the fact that the compressed OGG size is practically the same. Reacting to Roy T.'s great comment Actually, I couldn't measure the PCM size (Android decodes OGG internally), but I thought that stereo will take more space than mono when uncompressed After throwing out one of the WAV channels in Audacity, and re exporting it The new WAV file size is half than before The OGG file size is practically the same as before The sound effects and game music was recorded by my friend who is an experienced hobby musician composer, but he knows little about computers amp software so he just gave me some high quality WAV files generated via his hardware.These were stereo, but if I check them in Audacity, both channels appear to be exactly the same.Can I consider them the same ( moving to mono), or might there be some unnoticeable differences to the human eye? |
7 | Using AdMob with Games that use Open GLES Can anyone help me integrating Admob to my game. I've used the badlogic framework by MarioZencher ... and My game is like the SuperJumper. I am unable to use AdMob after a lot of my attempts. I am new to android dev...please help me..I went thru a number of tutorials but not getting adds displayed ... I did the following... get the libraries and placed them properly My main.xml looks like this android layout width "fill parent" android layout height "wrap content" android text " string hello" My Activity class onCreate method public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) RelativeLayout layout new RelativeLayout(this) adView new AdView(this, AdSize.BANNER, "a1518637fe542a2") AdRequest request new AdRequest() request.addTestDevice(AdRequest.TEST EMULATOR) request.addTestDevice("D77E32324019F80A2CECEAAAAAAAAA") adView.loadAd(request) layout.addView(glView) RelativeLayout.LayoutParams adParams new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP CONTENT, RelativeLayout.LayoutParams.WRAP CONTENT) adParams.addRule(RelativeLayout.ALIGN PARENT BOTTOM) adParams.addRule(RelativeLayout.CENTER IN PARENT) layout.addView(adView, adParams) setContentView(layout) requestWindowFeature(Window.FEATURE NO TITLE) getWindow().setFlags(WindowManager.LayoutParams.FLAG FULLSCREEN, WindowManager.LayoutParams.FLAG FULLSCREEN) glView new GLSurfaceView(this) glView.setRenderer(this) setContentView(glView) glGraphics new GLGraphics(glView) fileIO new AndroidFileIO(getAssets()) audio new AndroidAudio(this) input new AndroidInput(this, glView, 1, 1) PowerManager powerManager (PowerManager) getSystemService(Context.POWER SERVICE) wakeLock powerManager.newWakeLock(PowerManager.FULL WAKE LOCK, "GLGame") My Manifest file looks like this .... lt activity android name "com.google.ads.AdActivity" android configChanges "keyboard keyboardHidden orientation smallestScreenSize" gt lt application gt lt uses permission android name "android.permission.WAKE LOCK" gt lt uses permission android name "android.permission.WRITE EXTERNAL STORAGE" gt lt uses sdk android minSdkVersion "7" gt When I first decided to use the XML for admob purpose ..it showed no changes..it even didn't log the device id in Logcat... Later when I wrote code in the Main Activity class.. and run ... Application crashed ... with 7 errors evry time ... The android configChanges value of the com.google.ads.AdActivity must include screenLayout. The android configChanges value of the com.google.ads.AdActivity must include uiMode. The android configChanges value of the com.google.ads.AdActivity must include screenSize. The android configChanges value of the com.google.ads.AdActivity must include smallestScreenSize. You must have AdActivity declared in AndroidManifest.xml with configChanges. You must have INTERNET and ACCESS NETWORK STATE permissions in AndroidManifest.xml. Please help me by telling what wrong is there with the code? Can I write code only in xml files without changing the Activity class ... I will be very grateful to anyone providing support. |
7 | Libgdx Android app Avoid fullscreen and show titlebar I am developing an app using Libgdx and I don't want the app to go fullscreen and want to show the title bar but the app goes to fullscreen and hides title bar despite all efforts. Here is my style.xml file lt style name "MyStyle" parent "android Theme.Light" gt lt style gt Here is AndroidManifest.xml lt application android allowBackup "true" android icon " drawable ic launcher" android label " string app name" android theme " style MyStyle" gt lt activity android name "com.mygdx.game.android.AndroidLauncher1" android label " string app name" android configChanges "keyboard keyboardHidden orientation" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.LAUNCHER" gt lt intent filter gt lt activity gt Here is AndroidLauncher class protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) AndroidApplicationConfiguration config new AndroidApplicationConfiguration() config.hideStatusBar false initialize(new MyGdxGame(), config) setContentView(R.layout.main activity) tv (TextView)findViewById(R.id.tv) tv1 (TextView)findViewById(R.id.tv1) button (Button)findViewById(R.id.button) button.setOnClickListener(new View.OnClickListener() Override public void onClick(View v) if (Build.VERSION.SDK INT lt 19) Intent intent new Intent() intent.setType("image ") intent.setAction(Intent.ACTION GET CONTENT) startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) else Intent intent new Intent(Intent.ACTION OPEN DOCUMENT) intent.addCategory(Intent.CATEGORY OPENABLE) intent.setType("image ") startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) ) public void onActivityResult(int requestCode, int resultCode, Intent data) if (resultCode RESULT OK) if (requestCode SELECT PICTURE) Uri selectedImageUri data.getData() selectedImagePath getPath(selectedImageUri) Intent act2 new Intent(this ,AndriodLauncher2.class) act2.setData(selectedImageUri) startActivity(act2) public String getPath(Uri uri) String projection MediaStore.Images.Media.DATA Cursor cursor managedQuery(uri, projection, null, null, null) int column index cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA) cursor.moveToFirst() return cursor.getString(column index) |
7 | Should Starting a Quick Game via Google Game Services be Iterated? I have been following this tutorial for Google Play Game Services. I am a little unclear as to if the room matching algorithm should be looped or not. Can I just initialize this process once and let it time out? Or by iterating through it is it somehow rechecking it? If anyone had the approximate timeout that would be great as well. The problem stems from the fact that even when both phones are signing into the Game Services (at virtually the same time, my friend and I logged in), the room is not registering multiple people. One time my friend's phone even entered the game map, showing that he somehow was able to progress from the room initialization process. Relevant screen update methods which I am starting this matchmaking process Override public void update(float deltaTime) game.options.updateTiles() if(!isInitiated) startQuickGame() private void startQuickGame() auto match criteria to invite one random automatch opponent. You can also specify more opponents (up to 3). if(game.mGoogleClient.isConnected() amp amp !isInitiated) Bundle am RoomConfig.createAutoMatchCriteria(1, 3, 0) build the room config RoomConfig.Builder roomConfigBuilder RoomConfig.builder(Network.getInstance()) roomConfigBuilder.setMessageReceivedListener(Network.getInstance()) roomConfigBuilder.setRoomStatusUpdateListener(Network.getInstance()) roomConfigBuilder.setAutoMatchCriteria(am) RoomConfig roomConfig roomConfigBuilder.build() create room Games.RealTimeMultiplayer.create(game.mGoogleClient, roomConfig) go to game screen this.mRoom Network.getInstance().getRoom() if(this.mRoom ! null amp amp this.mRoom.getParticipants().size() gt 2) game.setScreen(new MultiGameScreen(game, this.mRoom)) isInitiated true else game.mGoogleClient.connect() |
7 | Sprite drag drop andengine How to drag an andEngine sprite anywhere on the phone screen? I have written this code in onAreaTouched function of IOnAreaTouchListener interface which is implemented in my activity, but its not working public boolean onAreaTouched(TouchEvent pSceneTouchEvent, ITouchArea pTouchArea, float pTouchAreaLocalX, float pTouchAreaLocalY) TODO Auto generated method stub Log.v(TAG,"Sprite Touched ") secondSprite new Sprite( CAMERA WIDTH 2, CAMERA HEIGHT 2, playerTextureRegion, this.getVertexBufferObjectManager()) Override public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) secondSprite.setPosition(pSceneTouchEvent.getX(), pSceneTouchEvent.getY()) System.out.println(String.format("spriteB fx f", pSceneTouchEvent.getX(), pSceneTouchEvent.getY())) return true scene.registerTouchArea(secondSprite) return true |
7 | irrlicht for android I was just wondering after noticing that moblox was.built with irrlicht if there is an android port of it? Or did the dev make his own port from scratch? From my research I noticed a port project on github but it seems far from ready. |
7 | Marketing PC Android 2d Physics Game I've been working on a game for couple years now, its fairly original, has definite potential within an indie market, and appeal for the masses also. I want to deploy on Android and PC, green light it on steam and looking into Kickstarter. I'm also going to set up a website where it can be played, have a dedicated server to link 'matches' and post demos on sites like mofunzone and armorgames. I've used Jbox2d, and am also curious about the licencing with this engine and can't seem to find documentation on that. I'm almost done the 'demo' and my question is, how should I market it? I was thinking I'd make the game free on android, charge something like 10 on steam, and charge say 1 month to play online (for the pc version) If anyone has any good links, research or advice from personal experience, it would be greatly appreciated. |
7 | Opengl ES 2.0 Is there a way to use less resources to draw in game background texture 1.Should my in game background be drawn with my game loop renderer, or if 2.I don't want to draw my background image every frame in my main renderer since it could possibly be a heavy job while the game loop is running. Do I need to use a separate thread or some other method to achieve this? FYI, the background should be able to scale and translate with zooming function, it should be flexible. |
7 | How can I get pre release reviews of my mobile game? My iOS and Android game is at its last stage of development. Is there a way for me to get pre release reviews from people? Or maybe from the press? How should I proceed? |
7 | Rotate canvas along its center based on user touch Android I want to rotate the canvas circularly on its center axis based on user touch. i want to rotate based on center but its rotating based on top left corner . so i am able to see only 1 4 for rotation of image. any idea.. Like a old phone dialer . I have tried like as follows onDraw(Canvas canvas) canvas.save() do my rotation canvas.rotate(rotation,0,0) canvas.drawBitmap( ((BitmapDrawable)d).getBitmap(),0,0,p ) canvas.restore() Override public boolean onTouchEvent(MotionEvent e) float x e.getX() float y e.getY() updateRotation(x,y) mPreviousX x mPreviousY y invalidate() private void updateRotation(float x, float y) double r Math.atan2(x centerX, centerY y) rotation (int) Math.toDegrees(r) |
7 | Keeping track of onscreen objects in opengl es on Android In a small game Im working on I was able to implement ray picking with an opensource 3d engine called min3d but I cant figure how to keep track of what object is onscreen. I will some times have upwards of 120 objects to render within my scene and the raypicking is off occasionally. What id like to do is keep track of how many screen objects are within the camera and being rendered onscreen and set a boolean value based on that to add or remove objects from my arraylist I iterate through when the screen touch is registered and the ray picking method goes off. So how can I check for which objects are onscreen and offscreen in opengl es on android. |
7 | Odd Android touch event problem (Nexus 10) Overview When testing my game I came across a bizarre problem with my touch controls. Note this isn't related to multi touch as I completely removed my ACTION POINTER UP and ACTION POINTER DOWN along with my ACTION MOVE code. So I'm simply working with ACTION UP and ACTION DOWN now and still get the problem. The problem I have a left and right button on the left of the screen and a jump button on the right. Everything works as it should but if I touch a large area of my hand (the fleshy part at the base of the thumb for instance) onto the screen, then release it and then press one of my arrows, the sprite moves in that direction for a few seconds, and then ACTION UP is mysteriously triggered. The sprite stops and then if I release my finger and re apply it to an arrow, the same thing happens. This goes on and on and eventually (randomly??) stops and everything work OK again. Test device amp OS Google Nexus 10 Tablet running Jellybean 4.2.2 Code Action upon which to switch actionMask event.getActionMasked() Pointer Index of the currently touching pointer pointerIndex event.getActionIndex() Number of pointers (for multi touch) pointerCount event.getPointerCount() ID of the pointer currently being processed (Multitouch) pointerID event.getPointerId(pointerIndex) switch (actionMask) Primary pointer down case MotionEvent.ACTION DOWN if pressing left button then set moving left if (isLeftPressed(event.getX(), event.getY())) renderer.setSpriteLeft() if pressing right button then set moving right else if (isRightPressed(event.getX(), event.getY())) renderer.setSpriteRight() if pressing jump button then set sprite jumping else if (isJumpPressed(event.getX(),event.getY())) renderer.setSpriteState('j', true) break End of case Primary pointer up case MotionEvent.ACTION UP When finger leaves the screen, stop sprite's horizontal movement renderer.setSpriteStopped() break |
7 | Streamline Facebook and Google Play Game Services integration in Android Game This has been confusing me a lot . I am creating a simple 2D platformer which I wish to make social. So I thought of letting users do the following Share their in game objective completion their high score etc with their friends. Challenge their friends to have a better score better multiplier etc from their's View leaderboards of high score , most distance traveled etc both social and global. So My First preference was Facebook , simply because people have better social connections there. But then Google Play game services integration has another advantage, It makes you game available in their game services app and may be boost your game ranking in play store if you have game services integrated. But then I'' need to have leaderboards(same ones) for google plus as well. That 'll be too confusing for people. I do not want people to sign in twice in my app. That'll simple cut down and disperse the number of people getting social with the game. I personally want to use facebook alone but then google game services may be boosts my app in store. Can someone tell me a solution to use them both frictionlessly and get the most out of them in my game |
7 | Application stops working when I add two fonts I created a game that has two fonts. Being precise, the two fonts are PRESS START 2P with the difference only in size. One of the fonts serves to write the title and the other for all other things. The problem occurs after building the application (apk). As it is a special font I click on the option quot copy to project quot for it to be exported to the cell phone. Image of the two fonts A detail is that the program does not recognize the original source directory, so I need to copy the source to the desktop to be able to copy it to the project. Image demonstrating the problem Adding any of the fonts (alone), the game works. The problem happens when I add the second font. Before posting here, I posted on the official engine forum, but I still haven't gotten any response. LINK https forum.yoyogames.com index.php?threads application does not work when i export 2nd font.83968 |
7 | Code structure in Android 2D game Well I've finnaly decided to start Android game dev, and my first project will be simple 2d canvas based game. I have some experience in game developing with C and XNA, and I'm a bit confused now. Back in XNA we have Game class with Initialize, Update and Draw methods. In Android I have to extend SurfaceView class, run draw and update in their own thread, and receive touch input from user. I'm looking for a proper way to structure my code. Some of my questions are How to deal with Activities (Should I run everything in one activity, or split whole game in 2 or more) ? Where should I run game loop ? Where to put Draw and Update methods ? How to respond to touch events ? Hope I came to the right place for answers... |
7 | If I want to create game for mobile and tablet on android and ios, which aspect ratio or screen resolution should I use? Now my game is currently use 3 4 aspect ratio ,which is 480 640 , so my game has the letterbox (I don't like stretch) on my android mobile and my friend mobile. I don't like letterbox, so I have just change color of my letter box to the color that blend with my game background, but I don't like it either. So now I think about change aspect ratio and screen resolution of my game. how about 480x800 ? |
7 | ARMv7 vs FAT in Unity Android Build Settings (release multiple valid APKs) If I select ARMv7 instead of FAT (ARMv7 x86) in the Android Build Settings of Unity5 Free, the APK binary drops to half size. FAT gt 20MB ARM gt 10MB (Tested with an empty scene, no assets, nothing, just the core libraries). I've seen the "official stats" of the CPU usage are here http hwstats.unity3d.com mobile cpu.html So not a lot of business to loose as for the date of publishing this question. But x86 seems to be an increasing trend. Questions Is there any way to publish a binary to the ARM users and another version to the x86 users but with the same product id so if they change the mobile phone, the software gets properly downloaded (but still each one gets a small footprint)? Does this CPU correlate with WinPhone? Or is an othogonal measure? In other words Are all Androids ARM? Or there are ARM and x86 Androids? Thanks! |
7 | Rendering artifacts on edges in Cardboard VR OpenGL ES 2 Unity beginner here. I've encountered this weird rendering artifacts in my Cardboard VR app on Android OpenGL ES 2 https youtu.be uJm4d3MwbRo It doesn't occur in WebGL build http senovsky.wz.cz virtualab index.html Does someone at least know how to call this artifact? Already tried searching for a solution, but I don't even know what keywords to use. The app was build using the HelloVR scene from GVR SDK for Unity v1.130.1 https github.com googlevr gvr unity sdk releases and no default settings were changed. I tried changing the default overall quality settings to Ultra and Very High, didn't help. |
7 | How to test Google Play Multiplayer locally I'm building a simple HTML5 game and I need to implement multiplayer without sharing the game on Google Play. I'm using CocoonJS's multiplayer api. How can I test Google Play Multiplayer locally? Do I really have to use websockets instead? |
7 | Efficient Collision detection for polygons (fleet) in an RTS I'm trying to make an RTS for android using libgdx. I would like to have collision detection to be able to detect ships inside the range of weapons and collision between my bullets and the ships. So far my strategy has been to use a PM QuadTree that I coded myself to store every segment of every polygons. A polygon being the hitbox of a ship. Every frame I clear and add all the segments back in the quadtree. Every segment has a reference to the ship it belongs to. When I add a ship, I add it recursively to the nodes of the quadtree based on the intersection with the bounds of a node. Detection collision is done by polling every polygon inside a rectangle that look into every node that fit entirely or partially inside the rectangle. My problem is that adding every ship every frame gives bad result on Android. On Desktop it is fast enough but on Android it can takes up to 100 ms just to add around 200 segments. Is there something wrong with my implementation (it shouldn't be this slow ?) or should I use another strategy for collision detection ? I thought about clearing the quadtree only every 5 frames but it would make the detection unprecise. I have measured that some simple math operation to calculate intersection takes up to 50 more times on my android and I'm not sure why. Surely my phone cpu is not 50 times slower than my laptop, is it ? It's a sufficiently fast moving RTS. Often the whole fleet is moving, thus every segment. I heard about RDC in that article. Would that be a better algorithm ? My issue is that some ships are hard to be bounded by a sphere if they're very long but not wide. |
7 | How do I pause Andengine, but still get input? In my game when I pause the game, I'd like to display three options (Resume, Restart and Menu) so I did this after calling mEngine.stop() Sprite resume new Sprite(CAMERA WIDTH 2, CAMERA HEIGHT 2, RM.resume, vertex) Override public boolean onAreaTouched(TouchEvent event, float pTouchAreaLocalX, float pTouchAreaLocalY) if(event.isActionDown()) this.setScale(1.1f) Log.i("Click","Click") return super.onAreaTouched(event, pTouchAreaLocalX, pTouchAreaLocalY) But the Log "Click" never display. So I tried to do this with the Engine active and the Log displays correctly. How can I stop my game (Modifier, Physics, Score) without using the mEngine.stop() method ? |
7 | 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. |
7 | How to draw an OpenGL object in another on Android? Eyes and Eyeballs As i allready wrote in another question I'm working on OpenGL since a Week, so i'm new to the most stuff. (also my englisch isn't the best. Hop you can understand the most anyway) So i'm working on an Tamagotchi App for a school project and want to make it with OpenGL. How to change modify or animate an existing OpenGL object on Android? So this is a further question. My Tamagotchi is haveing to eyes. Like this To make it look real i want the eyes to blink and the eyeballs to move arround. But the question here is what happens with the eyeball when the eyes are closed. In my Situation you woud not see the eyeballs because they are the same color then the body of the Tamagotchi. But i want the eyeballs to be a part of the eye. So if the Eye is closing the eyeballs shoud disapear where the eyes are closed whereever the eyeball is at the moment. Here you can see the eye closed (down scaled y) but the eyeball is still visible.... I want the eyeball to be cut of or not shown where the eye is closed like this But i have no idear how to solve this. Edit Here is my Code for someone who want to look at it. But i think it is not necessary. public class GLEyes private int points 1000 private float vertices 0.0f,0.0f,0.0f private FloatBuffer vertBuff Der Kreis wird von der Mitte der Fl che gezeichnet public GLEyes() vertices new float points 2 for(int i 0 i lt (points 3) i 3) double rad 2 (Math.PI i) points Berechnung des radius vertices i (float)Math.cos(rad) X Achsen Abschnitt vertices i 1 (float)Math.sin(rad) Y Achsen Abschnitt vertices i 2 0 Z Achsen Abschnitt wird nur f r 3D gebraucht ByteBuffer bBuff ByteBuffer.allocateDirect(vertices.length 4) bBuff.order(ByteOrder.nativeOrder()) vertBuff bBuff.asFloatBuffer() vertBuff.put(vertices) vertBuff.position(0) public void draw(GL10 gl) lefteye(gl) righteye(gl) private void lefteye (GL10 gl) gl.glPushMatrix() gl.glTranslatef(1, 1, 0) gl.glScalef(0.5f, 0.45f, 1.0f) Skalierung einstellen gl.glColor4f(0.0f,0.0f,0.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() gl.glPushMatrix() gl.glTranslatef(1, 1, 0) gl.glScalef(0.1f, 0.1f, 1.0f) Skalierung einstellen gl.glColor4f(1.0f,1.0f,1.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() private void righteye (GL10 gl) gl.glPushMatrix() gl.glTranslatef( 1, 1, 0) gl.glScalef(0.5f, 0.45f, 1.0f) Skalierung einstellen gl.glColor4f(0.0f,0.0f,0.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() gl.glPushMatrix() gl.glTranslatef( 1, 1, 0) gl.glScalef(0.1f, 0.1f, 1.0f) Skalierung einstellen gl.glColor4f(1.0f,1.0f,1.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() |
7 | Should Starting a Quick Game via Google Game Services be Iterated? I have been following this tutorial for Google Play Game Services. I am a little unclear as to if the room matching algorithm should be looped or not. Can I just initialize this process once and let it time out? Or by iterating through it is it somehow rechecking it? If anyone had the approximate timeout that would be great as well. The problem stems from the fact that even when both phones are signing into the Game Services (at virtually the same time, my friend and I logged in), the room is not registering multiple people. One time my friend's phone even entered the game map, showing that he somehow was able to progress from the room initialization process. Relevant screen update methods which I am starting this matchmaking process Override public void update(float deltaTime) game.options.updateTiles() if(!isInitiated) startQuickGame() private void startQuickGame() auto match criteria to invite one random automatch opponent. You can also specify more opponents (up to 3). if(game.mGoogleClient.isConnected() amp amp !isInitiated) Bundle am RoomConfig.createAutoMatchCriteria(1, 3, 0) build the room config RoomConfig.Builder roomConfigBuilder RoomConfig.builder(Network.getInstance()) roomConfigBuilder.setMessageReceivedListener(Network.getInstance()) roomConfigBuilder.setRoomStatusUpdateListener(Network.getInstance()) roomConfigBuilder.setAutoMatchCriteria(am) RoomConfig roomConfig roomConfigBuilder.build() create room Games.RealTimeMultiplayer.create(game.mGoogleClient, roomConfig) go to game screen this.mRoom Network.getInstance().getRoom() if(this.mRoom ! null amp amp this.mRoom.getParticipants().size() gt 2) game.setScreen(new MultiGameScreen(game, this.mRoom)) isInitiated true else game.mGoogleClient.connect() |
7 | FBO rendering different result between Galaxy S2 and S3 I'm working on a pong game and have recently set up FBO rendering so that I can apply some post processing shaders. This proceeds as so Bind texture A to framebuffer Draw balls Bind texture B to framebuffer Draw texture A using fade shader on fullscreen quad Bind screen to framebuffer Draw texture B using normal textured quad shader Neither texture A or B are cleared at any point, this way the balls leave trails on screen, see below for the fade shader. Fade Shader private final String fragmentShaderCode "precision highp float " "uniform sampler2D u Texture " "varying vec2 v TexCoordinate " "vec4 color " "void main(void)" " " " color texture2D(u Texture, v TexCoordinate) " " color.a 0.8 " " gl FragColor color " " " This works fine with the Samsung Galaxy S3 Note2, but cause a strange effect doesnt work on Galaxy S2 or Note1. See pictures Galaxy S3 Note2 Galaxy S2 Note Can anyone explain the difference? edit Folowing VinceFR's comment, we've tried adding the following. When the renderbuffers are initialised they are briefly bound to the framebuffer and set the background to a uniform buffer with GLES20.glClearColor(backgroundColor 0 ,backgroundColor 1 ,backgroundColor 2 ,backgroundColor 3 ) GLES20.glClear( GLES20.GL DEPTH BUFFER BIT GLES20.GL COLOR BUFFER BIT) The result is unchanged on the S3, on the S2 it has improved a certain amount, but problems still exist note the 20 in the bottom right corner is supposed to be there. |
7 | How to emulate knob turning, based on x y movement? I'm doing a game where one component is that you turn a knob. I'm having trouble getting good "knob behavior". I know the current touch mouse X,Y location, and I keep track of the previous X,Y location, so I can determine if I'm going left or right and or up or down. It works, but it's crude. I suspect I have to take an average of any given direction over a period of time (say, last quarter second) to eliminate jitter because people don't move uniformly in the same movement every moment. I can't really use touchdown release because you should be able to put the touch down, then move left right up down continuously without release, and the knob would turn, just as if you had a free spinning audio control or video shuttle (say). Any thoughts in this direction on how to even it out? |
7 | 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 |
7 | Which app markets should I deploy my Android game to? I just launched my Android game today. I'm curious to know where I can deploy it. Of course, Google Play is the veritable king of markets, and my own game site will be next. After that, which marketplaces are mature and are worth deploying to? I looked at SlideMe GetJar Soc.io And some other ones that I didn't use YAAM (kept crashing and erroring out) 1Mobile (couldn't figure out how to upload my app) Insyde Market My question is really, which ones are out there and are worth uploading too? (And 1Mobile seems good, but just can't figure out how to upload.) Each site requires their own size screenshots and logo, so it's a bunch of extra work. I'd rather stick to the 80 20 rule and apply 20 effort to hit 80 of the markets. |
7 | Playing with hashmap in drawing I'm developing a game in Java for Android, using LibGDX. In my render(), between the batch.begin() and batch.end() I'm running through all the game objects and draw them. Every game object is stored in a list, which that list is stored inside a hash map. I iterate through this hash map, getting every list and going through that list, like this batch.begin() Iterator it objectsMap.entrySet().iterator() while (it.hasNext()) Map.Entry pair (Map.Entry) it.next() Array list (Array) pair.getValue() for (int i 0 i lt list.size i ) GameObject object (GameObject) list.get(i) drawObject(object) batch.end() My drawObject() code private void drawObject(GameObject object, float x, float y) if (object null) return if (object.getVisibility()) TextureAtlas.AtlasRegion currentFrame object.getCurrentFrame() if (currentFrame ! null) float objectAlpha object.getAlpha() Color color batch.getColor() if (objectAlpha ! 1) color.a object.getAlpha() batch.setColor(color) batch.draw(currentFrame, x object.getOriginX(), y object.getOriginY(), object.getOriginX(), object.getOriginY(), currentFrame.getRegionWidth(), currentFrame.getRegionHeight(), object.scaleX, object.scaleY, object.getSpriteDirection()) color.a 1 batch.setColor(color) A method called setRegion() sets the current animation frames of the object protected void setRegion(String name, float frameDuration) currentFrame atlas.findRegion(name, 0) if (currentFrame null) currentFrame atlas.findRegion(name, 1) width currentFrame.getRegionWidth() height currentFrame.getRegionHeight() animationStateTime 0 animation new Animation(frameDuration, atlas.findRegions(name), Animation.PlayMode.LOOP) And in the update() of the objects this is called currentFrame (TextureAtlas.AtlasRegion) animation.getKeyFrame(animationStateTime, isLooping) The getCurrentFrame() method only returns currentFrame variable. The alpha is a field with a value between 0 and 1. (getAlpha() returns only the field) My question is that considered a "heavy" activity? Can this be a significant impact on the FPS values? Because I'm running my game on old devices (like Galaxy S2) and the FPS can get pretty low values. I'm trying to find the cause to it. I used to have a reference to every list but with the time I realized I'm going to have too much lists, so I decided to do it like this. Maybe you know a better way of holding references to all game objects? Thanks! |
7 | How to implement jump in a 2d game? I am trying to implement jump in a game I have written for android using canvas. I have referred this tutorial for implementing jump. My code is like if(jumpKeyPressed) jumpVel initialMomentum state quot jumping quot if(state quot jumping quot ) jumpVel gravity deltaTime 2 loc.y jumpVel deltaTime jumpVel gravity deltaTime 2 Even after tweaking gravity and initialMomentum, character is jumping too slow (seems like stuck at ground). I have read many posts but I am not able to figure out what am I doing wrong here? Edit Video |
7 | 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! |
7 | What organic traffic can I expect from publishing on Google Play, without other marketing? I've just published a new Android game on Google Play. It has been a bit over 48 hours. It's active in the store, and I can search for it by name to get to it. However, I've had 0 organic downloads thus far, only a couple from my friends. As far as I know, it has not been shown in the "new games" list yet, and the only store listing views in the stats are the ones from myself and friends. Is there some time by which I can expect some "organic" exposure, or will I ever? Is promoting my game by other channels the only option? I'm not asking for advice on promoting my game. I'm only asking about what organic exposure I can expect on Google Play. |
7 | Randomly spawning bitmaps on cnvas I need some ideas in order to finish algorithm. I'm randomly placing objects (bitmaps) on canvas without overlapping. Time needed to finish it is my problem. When I need to spawn for example 80 of canvas it takes to long. So i was thinking I should make some change when the bitmaps take off 50 of canvas. I want to tell algorithm that it should generate new locations (x,y) where it is free space. My question is How to render new location (x,y) in place where is free space. In summary Things I know object location (x,y) 4 corners (x,y) of object object width, height canvas width, height Any suggestions? Thanks for ideas. Now I've got problem. OK, thanks for ideas. I've got a problem. Link to picture Picture with grid I'm incrementing number of objects in cell after each adding object to grid. In the picture there are 9 possible locations for object. Should I check 9 conditions which tells where I should increment number of objects in cell? I assume that if object is on both cells than I increment number of objects in both cells. |
7 | How do I add leaderboard feature of OpenFeint in android? I am developing a game in android, by extending a class with view. I have integrated OpenFeint in it by studying the tutorial provided on the OpenFeint site, but I am not able to add the leaderboard feature in my app. How can I achieve it? My game class is like this public class GameActivity extends Activity Intent i Grapic g public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) requestWindowFeature(Window.FEATURE NO TITLE) getWindow().setFlags(WindowManager.LayoutParams.FLAG FULLSCREEN, WindowManager.LayoutParams.FLAG FULLSCREEN) setContentView(new Grapic(this)) and Grapic is a class which extends view and where scoring is done with touch events. |
7 | How do I correctly destroy a MobFox ad? Is anyone here using MobFox to display their Android app's ads? I was previously using the AdMob SDK but recently switched to MobFox and while it only took a short time to integrate it, there are a few outstanding issues which I can't work out. With the AdMob SDK, in my onDestroy method, I would have this line adView.destroy() However, I've looked through MobFox but I can't see an equivalent, am I missing something?! (there is all the usual pause() , resume methods etc..... just can't find a destroy() method) |
7 | In Android, neat way to send input info from GLSurfaceView to onDrawFrame in GLSurfaceView.Renderer ? The input is pinch drag for camera movement, which modifies a matrix to scale translate, and sent to a vertex shader. It's working, but ugly. What's the proper way to do it? I've noticed GLSurfaceView gets onTouch callbacks but Renderer has access to GL. Shaders and textures can only be loaded after the onSurfaceCreated() callback, so should be loaded there? Touch and graphics are on different threads, so should use queueEvent() or similar. Is there a game app on github that's a good example to follow? Thanks for any help! |
7 | libgdx(android) touchup triggers more than once? I have a function I run inside the touchUp method but when I click with the mouse during emulation, it triggers my function multiple times. I don't think its an error with the called method itself because if I put the call in KeyUp then it triggers once as expected. If it matters I am working in android studio. |
7 | 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. |
7 | How do I debug two android devices simultaneously in Eclipse? I have a multiplayer game which should be tested on two devices at the same time, if possible, with debugging. Can eclipse do this? If so, how? |
7 | 2015 android multiplayer server based Implementation There are a lot of old posts about multiplayer implementations on SE, so i'm looking for an up to date answer. What is the best server client implementation of real time multiplayer now? I have an Amazon MYSQL Server hosted by digitalOcean, I've made a REST web service that communicates with the Server and Android app, and I have my Android app running receiving and sending data. I want to add a multiplayer minigame to what I have right now where 2 players would see the same screen and one user would receive location data (which i'm already storing in the server and sending to all devices with the app) from the other and would have an interface to interact with the data they're receiving (like building towers around the location and deploying units). The computer AI would need to be synced between both devices. The matches would last maybe 3 minutes tops and the location data would have to be streamed constantly as well as the interaction from the other user. The computer AI would be streamed to both. I've done a lot of research on the topic, and most of my experience was from a bluetooth P2P game I created in 2011 using sockets. So what are the most common implementations today? What are the most common libraries? I'm currently using Android Studio for the app and Notepad for the PHP webservice. EDIT I'm fine with answers promoting their own products, but explain how your product is better than Google's Game Services (which appears to be the best choice right now). I'm really looking for a way to implement the multiplayer with the server I'm already using. |
7 | Physics for Android Game I'm making a 2D game for the Android phone, one that involves falling balls. I want to use a physics engine to properly simulate the balls falling and hitting other objects. I'm currently using Phys2D, but when the game runs in the emulator it doesn't look natural slow and rough. Course, I don't know if this is because of the emulator or Phys2D seeing as how I don't own an Android phone (A real drawback not being able to test on the actual phone, I know, but I can't afford a smartphone). Anyways, do you think the game would run faster and smoother on an actual android phone, or is it the engine I'm using, or how I'm using it. If it's the engine, any recommendations on Java physics engines? UPDATE If you want to test the game yourself, you can find the rough prototype here http bpcp.angelfire.com BallDrop.apk |
7 | Accessing libgdx classes within Android classes Currently what I'm able to do is to access android APIs within libgdx with an interface in core and defining all the methods and then implementing it in every project (desktop, android, etc). What I want to do is I want to create a way so that I can call a method from some android class (say AndroidLauncher) and it calls a method of a libgdx core project class (like modifying some stage element). How do go about that? Any help would be really appreciated. Note As a 'hack' right now, I'm just waiting for any update from android class in the render method using those same interface methods, but I don't think that's the best possible way. |
7 | First Mobile Indie Game Monetization Model. Ad based or in app purchases? We are a team of 3 (1 graphics designer, 2 developers). We're almost done with our first Android based indie game. Which monetization model will be suitable for us? We don't want to disturb users with a lot of ads (at this point we're thinking to put only banner ads) also, if we go with in app purchases, can we also keep ads as well? or is it a better practice to follow one model at a time? How much will it affect the user experience? |
7 | Rotate a bitmap and bitmap is getting blur in android I am developing an android game. and in this I want to move an object along a Bezier path. my object is rotating with some angle on this curve. I used this piece of code public void update() check collision with bottom wall if heading down if (droid.getSpeed().getyDirection() Speed.DIRECTION DOWN amp amp droid.getY() droid.getBitmap().getHeight() 2 gt getHeight() 2 amp amp droid.getY() droid.getBitmap().getHeight() 2 lt getHeight() 2 100 ) int pointX , pointY pointX new int 4 pointY new int 4 int X , Y pointX 0 getWidth() 2 pointX 1 getWidth() 2 50 pointX 2 getWidth() 2 25 pointX 3 getWidth() 2 pointY 0 getHeight() 2 pointY 1 getHeight() 2 25 pointY 2 getHeight() 2 50 pointY 3 getHeight() 2 100 Log.i(TAG, "In the While Zone of Last Half Zone") X (int) ((pointX 3 u u u) (3 pointX 2 u u (1 u)) (3 pointX 1 u (1 u) (1 u)) (pointX 0 (1 u) (1 u) (1 u))) Y (int) ((pointY 3 u u u) (3 pointY 2 u u (1 u)) (3 pointY 1 u (1 u) (1 u)) (pointY 0 (1 u) (1 u) (1 u))) Log.i(TAG " Value of X ", Double.toString(X)) Log.i(TAG " Value of Y ", Double.toString(Y)) double deltaX X droid.getX() double deltaY Y droid.getY() Log.i("deltaX ", Double.toString(deltaX)) Log.i("deltaY ", Double.toString(deltaY)) double angle Math.atan2(deltaY, deltaX) Log.i(TAG " Angle ", Double.toString(angle)) Matrix mtx new Matrix() mtx.preRotate((float) angle) mtx.postScale(1, 1) Bitmap rotatedBMP Bitmap.createBitmap(droid.getBitmap(), droid.getX(), droid.getY(), X droid.getX(), Y droid.getY(), mtx, true) droid.setBitmap(rotatedBMP) droid.curveUpdate(X, Y) u u 0.001 Log.i(TAG " Value of U ", Double.toString(u)) check collision with top wall if heading up Update the lone droid else droid.update() my object is moving and rotating as i supposed but image is getting blur. am not getting why is so. Please suggest what can be the problem. Thanks. |
7 | Help Needed with Shaders Ok, bear with me, I am a beginner with Google Cardboard programming. What I have been doing is looking at the TreasureHunter sample app from Google's page and (with the help of documentation and other sources) have been trying to create a simple cube floating in space. I have also been trying to avoid making everything as bare bones as the sample, so I have been trying to object orient things such as lights and the meshes. I am pretty sure that my matrices and methods are correct, but I think there could be something wrong with my shaders. When I compile the app and install it, no errors are thrown, but I am given just my white screen (set with glClearColor) with the Cardboard binocular UI view no cube is rendered, tilting looking around has no effect. I am using the colors, verticies, and normals from the Treasure Hunter sample, so those should be correct. Full source code (Java) is here. uniform mat4 u Model model position in world space uniform mat4 u MVP model in projection space uniform mat4 u MVMatrix model in view space uniform vec3 u LightPos Light position in eye camera space (projection space) attribute vec4 a Position vertex in local space attribute vec4 a Color Vertex colors attribute vec3 a Normal vertex normal varying vec4 v Color color varying vec3 v Grid varying vec3 v Normal varying vec3 v Position void main() v Grid vec3(u Model a Position) v Normal vec3(u MVMatrix vec4(a Normal, 0.0)) v Position vec3(u MVMatrix a Position) vec3 modelViewVertex vec3(u MVMatrix a Position) Vertex position in view space vec3 modelViewNormal vec3(u MVMatrix vec4(a Normal, 0.0)) Normal in view space float distance distance(u LightPos, modelViewVertex) vec3 lightVector normalize(u LightPos modelViewVertex) float diffuse max(dot(modelViewNormal, lightVector), 0.5) diffuse diffuse 1.0 (distance distance) v Color a Color diffuse gl Position u MVP a Position My vertex shader My fragment shader precision mediump float varying vec4 v Color void main() gl FragColor v Color |
7 | Is it possible to use SFML with the Android NDK? I've started using SFML recently and I absolutely love it. I'd like to make games that could be ported to android, linux, mac and windows, but it seems that SFML lacks portability. I've searched for a while and I've only found unrelated or unanswered questions on forums. Does anyone know of any way to use SFML with the android NDK or any plans to support it in the future? |
7 | 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 |
7 | Initializing OpenFeint for Android outside the main Application I am trying to create a generic C bridge to use OpenFeint with Cocos2d x, which is supposed to be just "add and run" but I am finding problems. OpenFeint is very exquisite when initializing, it requires a Context parameter that MUST be the main Application, in the onCreate method, never the constructor. Also, the main Apps name must be edited into the manifest. I am trying to fix this. So far I have tried to create a new Application that calls my Application to test if just the type is needed, but you do really need the main Android application. I also tried using a handler for a static initialization but I found pretty much the same problem. Has anybody been able to do it? This is my working but not as intended code snippet public class DerpHurr extends Application Override public void onCreate() super.onCreate() initializeOpenFeint("TestApp", "edthedthedthedth", "aeyaetyet", "65462") public void initializeOpenFeint(String appname, String key, String secret, String id) Map lt String, Object gt options new HashMap lt String, Object gt () options.put(OpenFeintSettings.SettingCloudStorageCompressionStrategy, OpenFeintSettings.CloudStorageCompressionStrategyDefault) OpenFeintSettings settings new OpenFeintSettings(appname, key, secret, id, options) RIGHT HERE OpenFeint.initialize( this , settings, new OpenFeintDelegate() ) System.out.println("OpenFeint Started") Manifest lt application android debuggable "true" android label " string app name" android name ".DerpHurr" gt |
7 | Error rendering map android I'm trying to read this text file and render the corresponding tiles on the screen. The code for reading the map is as follows private void loadMap(InputStream is) throws IOException ArrayList lt String gt lines new ArrayList lt String gt () int width 0 int height 0 BufferedReader reader new BufferedReader(new InputStreamReader(is)) while (true) String line reader.readLine() if (line null) reader.close() break if (!line.startsWith("!")) lines.add(line) width Math.max(width, line.length()) height lines.size() for (int j 0 j lt 18 j ) String line (String) lines.get(j) for (int i 0 i lt width i ) if (i lt line.length()) char ch line.charAt(i) Tile t new Tile(i, j, Character.getNumericValue(ch)) tiles.add(t) The first problem I have is with Character.getNumericValue(ch) as this does not seem to be doing anything, resulting in a NullPointerException. When I remove it and replace it with either a 1 or a 2 I'm able to render the tiles onto the screen but somehow the spaces in between the digits are interpreted as tiles, resulting in a continuous block of tiles eg in the second line with 1s results in tiles beginning from the left margin up until the last 1. How can I fix this? |
7 | Timer in turn based game I'm writing a small turn based game using libgdx. How to make a timer on the player turn to make it work even when the game loses focus?? Or maybe there are some other ways to do it??? |
7 | Why is this animation jerky? I am trying to create a simple game on android but I am unsure the best way to do the game loop. Looking at the LunarLander sample the game loop just loops like a variable time step loop (elapsed now lastupdate). I tried using this method to draw a circle that grows in size to a max radius then shrinks to a min radius and repeats. However, when I run the program the growing stage is very choppy and slow (it takes longer than it should to get to max radius). My Code public void updateSize(double elapsed) if (mGrowing true amp amp mRadius gt mMaxRadius) mGrowing false if (mGrowing false amp amp mRadius lt mMinRadius) mGrowing true if (mGrowing true) mRadius mDRadius elapsed else mRadius mDRadius elapsed mDRadius is the number of pixel the radius should change per second and elapsed is the number of seconds that has passed. I tried putting in a sleep of 2ms and 5ms in my game loop and I get the same result. I converted my loop to a fixed time step (only run physics update if now lastupdate TIME STEP) and the animation was a lot smoother. UPDATE I change the sleep to 15ms and it's a lot smoother. Every other example I've seen of an android game does not have a sleep in the main loop. Is this because my sample is just so simple that it takes virtually no time to update and all other examples just have a longer update time or am I missing something? |
7 | How could an offline app store images so that they aren't trivially discoverable? There is an app I play which has lots of images. I have reverse engineered the app but couldn't find the images in the APK. The app is an offline app so it doesnt retrieve images from a server. My question is, then, where did this app store its images? I'd like to achieve the same level of protection (to deter casual observation of the images). |
7 | Move Particle to touch position on android I am attempting to make a Particle start moving to the position of my finger on the touch of the screen. I have been using this as the basis so far public void update() deltaX .9 deltaY .9 this.x this.deltaX this.y this.deltaY public void moveTo(int newX, int newY) float dx newX this.x float dy newY this.y float length (float) Math.sqrt(dx dx dy dy) dx length dy length dx 10 dy 10 deltaX dx deltaY dy now while it does move the Particle, it is rarely in the direction of my finger. How can I make the particle have the correct amount of velocity to get to the position of my finger, but no farther? Thanks in advance! |
7 | How do I handle game lag due to background apps I'm developing a game using libgdx and have noticed on several occasions that other background apps running can cause lag in my game especially when those apps are being updated in the background. I'm talking serious lag like from 50 60 fps down to under 10 fps while the other app installs. How should I handle this very noticeable lag? Thanks! |
7 | Libgdx Android app Avoid fullscreen and show titlebar I am developing an app using Libgdx and I don't want the app to go fullscreen and want to show the title bar but the app goes to fullscreen and hides title bar despite all efforts. Here is my style.xml file lt style name "MyStyle" parent "android Theme.Light" gt lt style gt Here is AndroidManifest.xml lt application android allowBackup "true" android icon " drawable ic launcher" android label " string app name" android theme " style MyStyle" gt lt activity android name "com.mygdx.game.android.AndroidLauncher1" android label " string app name" android configChanges "keyboard keyboardHidden orientation" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.LAUNCHER" gt lt intent filter gt lt activity gt Here is AndroidLauncher class protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) AndroidApplicationConfiguration config new AndroidApplicationConfiguration() config.hideStatusBar false initialize(new MyGdxGame(), config) setContentView(R.layout.main activity) tv (TextView)findViewById(R.id.tv) tv1 (TextView)findViewById(R.id.tv1) button (Button)findViewById(R.id.button) button.setOnClickListener(new View.OnClickListener() Override public void onClick(View v) if (Build.VERSION.SDK INT lt 19) Intent intent new Intent() intent.setType("image ") intent.setAction(Intent.ACTION GET CONTENT) startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) else Intent intent new Intent(Intent.ACTION OPEN DOCUMENT) intent.addCategory(Intent.CATEGORY OPENABLE) intent.setType("image ") startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) ) public void onActivityResult(int requestCode, int resultCode, Intent data) if (resultCode RESULT OK) if (requestCode SELECT PICTURE) Uri selectedImageUri data.getData() selectedImagePath getPath(selectedImageUri) Intent act2 new Intent(this ,AndriodLauncher2.class) act2.setData(selectedImageUri) startActivity(act2) public String getPath(Uri uri) String projection MediaStore.Images.Media.DATA Cursor cursor managedQuery(uri, projection, null, null, null) int column index cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA) cursor.moveToFirst() return cursor.getString(column index) |
7 | Scene2d Stage Actor setup issues I am creating a game using libgdx. In the same each level has a class. I have stage as a member variable of the class. To this stage, I add actors. Inside the levels class, I have attaced the input processor to the stage like below. stage new Stage() sviewPort new StretchViewport(OSR Constants.VIEWPORT WIDTH, OSR Constants.VIEWPORT HEIGHT) OrthographicCamera camera new OrthographicCamera(OSR Constants.VIEWPORT WIDTH, OSR Constants.VIEWPORT HEIGHT) camera.position.set(0, 0, 0) camera.update() sviewPort.setCamera(camera) stage.setViewport(sviewPort) Gdx.input.setInputProcessor(stage) The level object is instantiated in another class known as GameScreen. GameScreen implements the Screen interface. I am unable to detect touch events on my actors in the stage. Each actor has also been given bounds as per the world coordinates. I have added the following code on each actor to detect touch this.addListener(new InputListener() public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) System.out.println("touchdown at " x " " y) return true ) |
7 | Mobile Game Google Play no supported dev country and capitalization alternatives (no policies violation or suspicious behavior)? If my country is listed as not supported as a developer country (for payments), this mean developer can upload app but no make any money with it. If I understood correctly, not even in app ads are allowed (I have my doubts about ads because It has no sense they aren't allowed). Is there any mean, friendly with Google policies, to monetize the app? For example Desktop version is free to play. Optional content requires a payment. Mobile version is free to play. Optional content requires you to log in with same account you used to purchase it on desktop. No ads and no in app purchase in mobile version. Is the above scenario OK? Which are the alternatives? Notes To me, no ads has no sense. After reading Developer Console documentation I assumed that ads are OK but after doing some research It turns on that many people thinks that ads are not OK. |
7 | How to use HyperLink with Actor in Libgdx I am making a quiz game using LibGDX. I want it to redirect to a website. I am using classes like Text and Label that extends Actor to write text using a bitmap Font. I have no idea on how to provide a link (like anchors in html) in a native app. However, I am not very good at Android but know java well. In android , I saw on stackexchange, we can do so using Intent or string.xml configuration. Can anyone suggest me a way to do so using Actor in libGDX? |
7 | Which app markets should I deploy my Android game to? I just launched my Android game today. I'm curious to know where I can deploy it. Of course, Google Play is the veritable king of markets, and my own game site will be next. After that, which marketplaces are mature and are worth deploying to? I looked at SlideMe GetJar Soc.io And some other ones that I didn't use YAAM (kept crashing and erroring out) 1Mobile (couldn't figure out how to upload my app) Insyde Market My question is really, which ones are out there and are worth uploading too? (And 1Mobile seems good, but just can't figure out how to upload.) Each site requires their own size screenshots and logo, so it's a bunch of extra work. I'd rather stick to the 80 20 rule and apply 20 effort to hit 80 of the markets. |
7 | Faster way to draw dynamic meshes in OpenGL ES I'm writing a 3D game which is going to inlcude some dynamic meshes. For now, my code looks like this private float mVertices private FloatBuffer mVertexBuffer public void onDrawFrame(GL10 gl) first clear the screen of any previous drawing gl.glClear(GL10.GL COLOR BUFFER BIT GL10.GL DEPTH BUFFER BIT) initialize the matrix gl.glMatrixMode(GL10.GL MODELVIEW) gl.glLoadIdentity() update the vertex data for (int vtx 0 vtx lt mVtxCount vtx) fill in the x, y and z components of the vertex position mVertices vtx 3 x mVertices (vtx 3) 1 y mVertices (vtx 3) 2 z update the vertex buffer mVertexBuffer.clear() mVertexBuffer.put(mVertices) mVertexBuffer.position(0) render the vertex buffer gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glVertexPointer(3, GL10.GL FLOAT, 0, mVertexBuffer) gl.glDrawElements(GL10.GL LINES, mIndices.length, GL10.GL UNSIGNED BYTE, mIndexBuffer) Here is an easy sample as the index buffer does not change so I only update the vertex position, normal and texture coordinates. Of course I understand dynamic mesh will always be slower to render than static mesh, but I wonder if the method I use is good or if there is a faster better way to do this . |
7 | Optimal Compression for Speech I'm designing a game that depends heavily on audio I will have some 300 speech files (most of them just a word or two long). This can very quickly escalate the size of my final game. What's the optimal way to encode compress speech files to keep the size minimal without getting audio artifacts? Please address both per file compression encoding, and also zipping compressing the set of all speech files together in your answer. Because I'm not sure which (or combination of both) factors will give me the best results. Edit I need this to run in Silverlight and Android, so I'm presumably stuck with only MP3 as my option (other than uncompressed wave files). |
7 | Faster way to scale images than gluScaleImage? I'm porting a C game to Android using the NDK and there's one bottleneck that's really slowing down the code gluScaleImage(). Does anyone know of a faster way to scale image textures? |
7 | LibGdx Scalling sprites on Android I have a sprite that is a few buttons but need them in the center of the screen for all android devices. I tried setting it's location to the center of the screen by dividing the orthogonal camera by 2, but it doesn't help. Any simple way to fix this? |
7 | How to delete Google Play Services? I want to delete Google Play Services in the Google Play Developer Console, but I can't. Here is what I did I published my game to Google Play without Google Play Services. I decided that I want Google Play Services in my game, so I integrated them in the source code. After that I created Google Play Services for my game in the Google Play Developer Console. But the created Google Play Services didn't work. The were Unpublished at that moment. I read that in order for them to work, you have to publish them. I published them, they still don't work and I can't delete them. In order to delete them I must unlink the game, but since the game is published I can't unlink it. I asked Google Support what to do, they told me to delete the project in the Google API Console and after 7 days the game will be unlinked. There has been 15 days since then and nothing happens. Please tell me what can I do. |
7 | How to manage screen and input when using libSDL2 for both desktop and Android? I have worked on libSDL1.2. Since, the release of 2.0, SDL also supports android. So, I am trying to develop game that can work both on desktop and android. But there are few things that are confusing me. When we are creating a window, we pass the width and height of screen. But on android game covers whole screen and different devices have different resolutions. So how can we create a screen which appears uniform on both desktop and android. How to handle inputs like back button. Also, how to load graphics based on DPI. |
7 | What units is Box2d AndEngine's velocity measured in? I'm developing a game on AndEngine (with Box2d) and on iOS Sprite Kit simultaneously. I want the game's physics to be identical on both platforms. Sprite Kit uses Box2d internally for physics simulation and I'm using Box2d AndEngine to use it in AndEngine. In Sprite Kit, I use physicsBody.velocity. In AndEngine's Box2d, I use body.SetLinearVelocity(x,y). In Sprite Kit, a physics body's velocity vector is measured in meters per second. What is the corresponding unit of SetLinearVelocity in Box2d AndEngine? |
7 | Using multiple sprite sheets for same object AndEnginge I have multiple sprite sheets for my object(Parrot) like eating, moving left to right, right to left and much more. I am using AndEngine gles2.0. How should I implement it? Every time I have to use different sprite sheet, detach previous one and on same location add new one. This is going to be hectic! Anyone here who already implemented this kind of scenario? If I use single sprite sheet for every animation it size will increase and it will throw a exception of out of memory! |
7 | What affects the size of APK files? The size of the .apk file built by Unity is larger than I expected. Is it image resolution, number of scenes, or something else? |
7 | Reducing APK File Size by using JPG instead of PNG for game background images I've just finished my (openGL ES 2.0 Android) game and it's almost ready for Alpha testing. When I export the application to an APK File, the file is taking up 16MB and I would like to reduce this as much as I can. Here are some points about what the project contains and what I've tried to reduce the size already 222kb of Ogg Vorbis files used for Sound Effects 1 x MP3 file at 5.59MB (128kbps Bitrate) 4 x sets of PNG files used for textures (XHDPI, HDPI, MDPI amp LDPI I'm not using XXHDPI) Just over 1MB of code What I've tried thus far to get where I am I've optimised the PNG files using Optiping I've applied ProGuard to my code before exporting, this didn't really help by much as 99 of my app is resources. So my question is, is there really much else I can do to reduce the size of the APK? I was thinking about maybe using JPG format source files for my Background OpenGL textures instead of PNG anyone have any experience with this? Does it hurt performance at all? I can see that it would make quite a difference my atlas of backgrounds in PNG format for XHDPI is 1.7MB and a 90 compressed JPG comes in at around 650KB. I'm just not sure if it's a good idea as everyone always advocates PNG JPG. Any pointers from personal experience would be helpful amp also if I've overlooked anything other than using JPG's. |
7 | Cant write read to from external storage with LibGDX My create method looks like this Override public void create () batch new SpriteBatch() FileHandle file Gdx.files.external("file.txt") file.writeString("My god, it's full of stars", false) I allso included lt uses permission android name "android.permission.WRITE EXTERNAL STORAGE" gt lt uses permission android name "android.permission.READ EXTERNAL STORAGE" gt The Exception i get is this 02 13 14 45 51.858 12439 12466 com.snowdevs.tweetiebirds E AndroidRuntime FATAL EXCEPTION GLThread 1120 Process com.snowdevs.tweetiebirds, PID 12439 com.badlogic.gdx.utils.GdxRuntimeException Error writing file file.txt (External) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 353) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) Caused by com.badlogic.gdx.utils.GdxRuntimeException Error writing file file.txt (External) at com.badlogic.gdx.files.FileHandle.writer(FileHandle.java 330) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 350) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) Caused by java.io.FileNotFoundException storage emulated 0 file.txt open failed EACCES (Permission denied) at libcore.io.IoBridge.open(IoBridge.java 452) at java.io.FileOutputStream. lt init gt (FileOutputStream.java 87) at com.badlogic.gdx.files.FileHandle.writer(FileHandle.java 322) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 350) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) Caused by android.system.ErrnoException open failed EACCES (Permission denied) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java 186) at libcore.io.IoBridge.open(IoBridge.java 438) at java.io.FileOutputStream. lt init gt (FileOutputStream.java 87) at com.badlogic.gdx.files.FileHandle.writer(FileHandle.java 322) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 350) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) I use a Nexus 5 with Android 6 Marshmallow for testing. I searched and found that Android 6 uses runtime permissions but the LibGDX guys says that it works even on Android 6... Is there a fix With or Without runtime permissions? |
7 | Number of Impressions on Admob for Revenue Just curious for a rough estimate how many impressions would it take to make 300 dollars, a day, in ad revenue? |
7 | Phone for Android game development I've been developing casual iPhone iPod Touch games touch for about two years. I'd like to port some games to the Android platform. Since I'm stuck w a two year iPhone contract I don't want to get an Android phone that requires a service plan. What is the best phone to get for development in this situation? |
7 | Make a callback to android methods from libgdx How can I make a callback from libgdx to an Android method? I want to use the method to overwrite a file in the internal memory. |
7 | Loading and rendering one large image or many smaller ones I am working on an android game with a top down style view similar to the original GTA's or a scrolling version of Legend of Zelda. I have recently begun designing some prototype levels for the game which vary between a corridor style dungeon similar to diablo or an open area with obstacles similar to Zelda. My question is would it be better to have one large background image and draw it once or a relatively small one (size of or less than the view) and draw it multiple times. My concerns are the memory required to load store a large background image vs the performance boost of only drawing one image. Any input would be appreciated. |
7 | What organic traffic can I expect from publishing on Google Play, without other marketing? I've just published a new Android game on Google Play. It has been a bit over 48 hours. It's active in the store, and I can search for it by name to get to it. However, I've had 0 organic downloads thus far, only a couple from my friends. As far as I know, it has not been shown in the "new games" list yet, and the only store listing views in the stats are the ones from myself and friends. Is there some time by which I can expect some "organic" exposure, or will I ever? Is promoting my game by other channels the only option? I'm not asking for advice on promoting my game. I'm only asking about what organic exposure I can expect on Google Play. |
7 | Accelerometer based games smoothness Take Doodle Jump and other games that rely on the accelerometer. The movement of the character is very smooth and I have no idea how they implemented it. I've seen a number of SO GameDev forum questions, but the discussion ends abruptly when someone recommends a high low pass filter. I've tried that (unless I'm missing something) and the results are nowhere near smooth. All I'm trying to do is move a character on the x axis. This is the code I have and it's very "choppy". It's actually the code you can see on the official Android tutorials. float alpha 0.9f tried many values from 0.1f to 0.99f. chopiness still there Override public void onSensorChanged(SensorEvent event) if(event.sensor.getType() Sensor.TYPE ACCELEROMETER) if(init) gravity 0 event.values 0 gravity 1 event.values 1 gravity 2 event.values 2 init false else gravity 0 alpha gravity 0 (1 alpha) event.values 0 gravity 1 alpha gravity 1 (1 alpha) event.values 1 gravity 2 alpha gravity 2 (1 alpha) event.values 2 Remove the gravity contribution with the high pass filter. linear acceleration 0 event.values 0 gravity 0 linear acceleration 1 event.values 1 gravity 1 linear acceleration 2 event.values 2 gravity 2 character.setX(character.getX() linear acceleration 0 ) I also tried multiplying linear acceleration 0 with a sensitivity, where 0 lt sensitivity lt 1 but the choppiness still doesn't go away. What is the next step from here to achieve a smooth movement like in Doodle Jump? |
7 | Marketing PC Android 2d Physics Game I've been working on a game for couple years now, its fairly original, has definite potential within an indie market, and appeal for the masses also. I want to deploy on Android and PC, green light it on steam and looking into Kickstarter. I'm also going to set up a website where it can be played, have a dedicated server to link 'matches' and post demos on sites like mofunzone and armorgames. I've used Jbox2d, and am also curious about the licencing with this engine and can't seem to find documentation on that. I'm almost done the 'demo' and my question is, how should I market it? I was thinking I'd make the game free on android, charge something like 10 on steam, and charge say 1 month to play online (for the pc version) If anyone has any good links, research or advice from personal experience, it would be greatly appreciated. |
7 | LibGDX ActorGestureListener after change position I have this code to get pan touch inside an Image and it works fine, but when I uncomment this line img.setPosition(100, 100) it doesn't work anymore, why? Texture tex new Texture(Gdx.files.internal("square.png")) final Image img new Image(tex) img.setPosition(100, 100) img.setSize(157,45) img.setColor(0,0,0,1f) img.addListener( new ActorGestureListener() Override public void pan(InputEvent event, float x, float y, float deltaX, float deltaY) super.pan(event, x, y, deltaX, deltaY) int minX (int)img.getX() int maxX (int)img.getX() (int)img.getWidth() int minY (int)img.getY() int maxY (int)img.getY() (int)img.getHeight() if ((x gt minX amp amp x lt maxX) amp amp (y gt minY amp amp y lt maxY)) Utils.print("PAN") ) stage.addActor(img) |
7 | How to switch between views in android? I've tried several methods to switch between two views in my program. I've tried creating a new thread then have the view run for 5 seconds before creating intent to start my main activity. This is the code snippet from the said view class mHelpThread new Thread() Override public void run() try synchronized(this) Wait given period of time or exit on touch wait(5000) catch(InterruptedException ex) finish() Run next activity Intent intent new Intent(Intent.ACTION MAIN, null) intent.addCategory(Intent.CATEGORY HOME) startActivity(intent) stop() mHelpThread.start() I can access the said view without error but it doesn't disappear after 5 seconds nor did it switched to main view when I even utilized an onTouchEvent() to detect touch on the screen of which it should have automatically closed. I've also tried adding a button on the said view to manually switch to main view Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) setContentView(R.layout.help) final HelpView helpView this final Button btnback (Button) findViewById(R.id.back) btnback.setOnClickListener(new View.OnClickListener() public void onClick(View v) Intent intent new Intent(helpView, MainActivity.class) startActivity(intent) ) These codes worked, though, for creating a launcher for my program. So I thought that it would work the same if I added an option for help rules(for the game) that would switch to another view. I've only since started using eclipse for android so pardon my lack of knowledge. Here is also the snippet from my manifest lt uses sdk android minSdkVersion "11" android targetSdkVersion "15" gt lt application android icon " drawable ic launcher" android label " string app name" android theme " style AppTheme" gt lt activity android name "MainActivity" android label " string title activity main" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.DEFAULT" gt lt intent filter gt lt intent filter gt lt intent filter gt lt activity gt lt activity android name "SplashScreen" android theme " style Theme.Transparent" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.LAUNCHER" gt lt intent filter gt lt activity gt lt activity android name "HelpView" android theme " style Theme.Transparent" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.DEFAULT" gt lt intent filter gt lt intent filter gt lt intent filter gt lt activity gt lt application gt |
7 | Android glsl discard problem Whenever I use discard or an if statement in my shaders, I get an error message with the text lt qgl2DrvAPI glAttachShader 398 gt GL INVALID VALUE I think this is a version problem, but I'm really not sure. |
7 | Building for the Android errors Unity3D EDIT After doing some research on my own I found that by deleting the debug.keystore file everything fixed itself. So currently I'm exporting my game strictly for testing to the Android. However, when I attempt to build for the Android, I get these errors Using keystore C Users Tim Williams.android debug.keystore THIS TOOL IS DEPRECATED. See help for more information. Debug Certificate expired on 4 14 12 11 18 AM UnityEngine.Debug LogError(Object) PostProcessAndroidPlayer BuildApk(String, Boolean) (at C BuildAgent work b0bcff80449a48aa Editor Mono BuildPipeline PostProcessAndroidPlayer.cs 1014) PostProcessAndroidPlayer PostProcess(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C BuildAgent work b0bcff80449a48aa Editor Mono BuildPipeline PostProcessAndroidPlayer.cs 444) UnityEditor.HostView OnGUI() And Error building Player UnityException APK Builder Failed! Failed to build APK package. See the Console for details. Does anyone have any ideas what these errors are, and how I could fix them? This is my first time building for any mobile device, so I'm a bit confused (Also, I do have the Android SDK.) Thanks, Tim. |
7 | Make a sprite jump to a certain direction in libGDX I was wondering how you can make a sprite jump to a certain direction in libGDX just like the brick does in the famous mobile game "Amazing Brick' I want to make my sprite jump up a bit to the right when I tap the right part of the phone and make it jump up but to the left direction when I tap on the left part of my phone. I am using libGDX on android studio and I am on a beginner level, trying to develop a unique game for android. Plz help. Thanks in advance. o |
7 | On Android, why would you handle expansion files yourself instead of using Google Play? Why aren't all Android games using Google Play's ability to serve their expansion files? Why some are handling it themselves inside their apps? |
7 | Android in game pause screen Right now Im calling a new activity with an xml view when I pause my game, but Since I do this I need to use context in my real time code, and this is causing a memory leak. Is there any preffered way to pause the game? By pause I mean if game is over, if I die, or if I press pause button. Would a custom dialog work just aswell? this would mean I wont have to leave my main activity while im in game. |
7 | How to use the box2d contact listener in android (java port)? I don't have any idea about the box2d collision detection in android. I googled and got results that suggest to use the contact listener but I don't know how to use it in android java. |
7 | Edge Detection on Screen I have a edge collision problem with a simple game that i am developing. Its about throwing a coin across the screen. I am using the code below to detect edge collisions so i can make the coin bounce from the edges of the screen. Everything works as i want except one case. When the coin hits left edge and goes to right edge the system doesnt detect the collision. The rest cases are working perfectly, like hitting the right edge first and then the left edge. Can someone suggest a solution for it? public void onMove(float dx, float dy) coinX dx coinY dy if (coinX gt rightBorder) coinX ((rightBorder coinX) 3) rightBorder if (coinX lt leftBorder) coinX (coinX) 3 if (coinY gt bottomBorder) coinY ((bottomBorder coinY) 3) bottomBorder invalidate() |
7 | How can I save my game state so it can be resumed when my application resumes? I've found that after resuming my game the whole engine is reloaded and application is reinitialized. I want to save engine state and in "onResume," resume the game process from where it left off. I've tried to save the engine (mEngine) and then after resume the game in "onLoadEngine" return saved engine. I think it is a bad solution and it doesn't work anyway. What is the best solution for resuming my game (after the power key was pressed, for example) in AndEngine ? |
7 | Android AndEngine creating a body behind the sprite exactly I am using AndEngine for Android. I created a body, but it is not behind the sprite as I wanted. Body.setTransform(Sprite.getX() 32, Sprite.getY() 32, 0) This is what I am currently using and this is how it appears. My body is the white circular borders, and my sprite is the red circle. and When I remove 32 from the code the body doesn't even appear. Extra code FIXTURE DEF PhysicsFactory.createFixtureDef( 1, density 0.75f, elasticity 0.5f, friction false) isSensor the Body Body PhysicsFactory.createCircleBody(this.physicsWorld, Sprite, BodyType.KinematicBody, this.FIXTURE DEF) Body.setUserData("eSprite") this.physicsWorld.registerPhysicsConnector(new PhysicsConnector(Sprite, Body, true, true) my sprite is 65px .. |
7 | RagDoll in AndEngine I want to create a RagDoll body in andEngine which can run and jump over different jumpObjects. Can any one give a nice tutorial on how to create RagDoll body and how to move it, like jump and running. Thanks in Advance. |
7 | How to specify colour in a single 32 bit value I'm writing my first game using OpenGL 2 ES (for Android), and I've currently got a particle engine and some player sprites running successfully. I'm using 4 floats for the colour of each particle which seems like total overkill. It makes sense that I should be able to use a single 32 bit int (or perhaps a single float) to hold the colours (perhaps in RGBA format) which would presumably save a lot of unnecessary loading copying processing, but I'm struggling to understand how I could do this. I guess that I would need to change the shaders to take the relevant format, and also i'd need to change the way I load the color shader attribute. My fragment shader has varying vec4 v Color gl FragColor v Color texture2D(u TextureUnit, gl PointCoord) and the attribute (passed into the fragment shader from the vertex shader) is set up with glVertexAttribPointer(aColourLocation, COLOUR COMPONENT COUNT, GL FLOAT, false, BYTES PER VERTEX, floatBuffer) I've searched the documentation for what I should change vec4 and GL FLOAT to, and what how I'd multiply the colour with the texture, and have tried a few things but with no success. |
7 | LibGDX Android Textures reload other textures, and transparent images get black backgrounds Pictures I have very strange problems with my LibGDX Game in Android The problem is that sometimes the textures get black backgrounds when they should be transparent, and sometimes when I remove the texture, or press the back button, the textures get replaced with other textures that I have. To clarify I'm using x texture to show the status of health. I'm using three x textures to show how many lives the player got, and when I lose health, and remove one texture, the x texture get replaced with y or z texture, or the remaining x textures get black backgrounds. Sometimes it works flawlessly, and the x texture gets removed, and the backgrounds are still transparent. I'm loading my textures via an AssetManager, and just load them on create(). In my render I use this Gdx.gl.glClearColor(1, 1, 1, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) Gdx.gl.glBlendFunc(GL20.GL SRC ALPHA, GL20.GL ONE MINUS SRC ALPHA) batch.enableBlending() batch.begin() for (Entity life LifeEntities) life.render(batch) batch.end() I'm also using this in my Launcher Class. AndroidApplicationConfiguration cfg new AndroidApplicationConfiguration() cfg.r cfg.g cfg.b cfg.a 8 MainGame myGame new MainGame(arrayName) initialize(myGame, cfg) I do dispose the textures also. I have looked up on google and on gamedev about this problem, but all the questions are for problems when the transparent always have black background, not when it is something that happens like a bug. Any suggestions on where the problem could be? Thanks a lot, if you need more code, please let me know. Pictures of the problem |
7 | How can I tell if OpenGL has finished rendering the current frame? If I make a call to http developer.android.com reference android opengl GLSurfaceView.html requestRender() from my game loop, how can I tell when OpenGL has finished rendering? I don't want to make a call to requestRender() again in the next frame until the previous frame has finished rendering. Sorry for the basic question I'm new to opengl and trying to switch to it from canvas. Also, is GLSurfaceView.requestRender() a blocking call? |
7 | Separate parts of a game engine I'm pretty new in developing videogames. By now I only used SDL with C C to create games. I'm currently learning OpenGL and I realized that to be fluid and easy to maintain the code must be logically separated. Since I want to use OpenGLES on iOS and Android I was wondering how the engine must be imagined in a technical way, some questions came up Do I have to separate input update functions from draw functions in different threads? Is there only one proper way to think a game engine loop? What kind of assets should I use to create a 3D game using openGl ES to get better performance? EDIT I figured that I had more questions lacking of answers reading the links DMGregory refered me to. I'll keep reading it till I fully understand it and than ask for the good questions. Thanks a lot. |
7 | Cross platform ad hoc local mobile multiplayer I want to implement ad hoc cross platform (iOS, Android, and PC) device discovery for local multiplayer, like this scenario http www.youtube.com watch?v csXYZf2vGdE Multiple players, each with different devices (iOS, Android, PC). One player starts a game. The others can search and automatically discover his game and enter into a local multiplayer match. This would all be done P2P, without any dedicated game servers. Is this possible with current technology? |
7 | Monogame 3.3 SoundEffect play Freezes After using Monogame 3.3 with Xamarin Android, SoundEffect.Play method freezes the game. I try to convert wav files 8bit mono, 16bit mono no changes. This error on Samsung T101 android 4.0.3 but SoundEffects works with another android device which has 4.2.2. I don't have this problem with Monogame 3.2. Any suggestion? Thank you! Android debug log below. The thread 'Unknown' (0x4) has exited with code 0 (0x0). Failed to generate OpenAL data buffer 04 22 23 34 04.380 I mono stdout(10068) Failed to generate OpenAL data buffer Failed to get buffer bits , format Stereo16, size 73632, sampleRate 44100 04 22 23 34 04.380 I mono stdout(10068) Failed to get buffer bits , format Stereo16, size 73632, sampleRate 44100 04 22 23 34 04.390 D Mono (10068) DllImport searching in 'openal32.dll' ('. libopenal32.so'). 04 22 23 34 04.390 D Mono (10068) Searching for 'alDistanceModel'. 04 22 23 34 04.990 D Mono (10068) Image addref System.Runtime.Serialization 0x28084d0 gt System.Runtime.Serialization.dll 0x27ef090 1 04 22 23 34 04.990 D Mono (10068) Assembly System.Runtime.Serialization 0x28084d0 added to domain RootDomain, ref count 1 04 22 23 34 04.990 D Mono (10068) AOT module 'System.Runtime.Serialization.dll.so' not found Cannot load library load library 1091 Library ' data data com.homemadegames.exterminator lib System.Runtime.Serialization.dll.so' not found 04 22 23 34 04.990 D Mono (10068) Assembly Ref addref MonoGame.Framework 0x1c80558 gt System.Runtime.Serialization 0x28084d0 2 04 22 23 34 04.990 D Mono (10068) Assembly Ref addref System.Runtime.Serialization 0x28084d0 gt mscorlib 0x1c66118 9 04 22 23 35 31.110 D dalvikvm(10068) GC CONCURRENT freed 159K, 5 free 8403K 8775K, paused 5ms 1ms 04 22 23 38 12.350 D dalvikvm(10068) GC CONCURRENT freed lt 1K, 2 free 8905K 9031K, paused 5ms 1ms |
7 | How to use the box2d contact listener in android (java port)? I don't have any idea about the box2d collision detection in android. I googled and got results that suggest to use the contact listener but I don't know how to use it in android java. |
7 | Scaling and new coordinates based off screen resolution I'm trying to deal with different resolutions on Android devices. Say I have a sprite at X,Y and dimensions W,H. I understand how to properly scale the width and heigh dimensions depending on the screen size, but I am not sure how to properly reposition this sprite so that it exists in the same area that it should. If I simply resize the width and heigh and keep X,Y at the same coordinates, things don't scale well. How do I properly reposition? Multiply the coordinates by the scale as well? |
7 | How can I draw crisp per pixel images with OpenGL ES on Android? I have made many Android applications and games in Java before, however I am very new to OpenGL ES. Using guides online, I have made simple things in OpenGL ES, including a simple triangle and a cube. I would like to make a 2D game with OpenGL ES, but what I've been doing isn't working quite so well, as the images I draw aren't to scale, and no matter what guide I use, the image is always choppy and not the right size (I'm debugging on my Nexus S). How can I draw crisp, HD images to the screen with GL ES? Here is an example of what happens when I try to do it And the actual image Here is how my texture is created get id int id 1 gl.glGenTextures(1, texture, 0) id texture 0 get bitmap Bitmap bitmap BitmapFactory.decodeResource(context.getResources(), R.drawable.ball) parameters gl.glBindTexture(GL10.GL TEXTURE 2D, id) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE MIN FILTER, GL10.GL NEAREST) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE MAG FILTER, GL10.GL LINEAR) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE WRAP S, GL10.GL CLAMP TO EDGE) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE WRAP T, GL10.GL CLAMP TO EDGE) gl.glTexEnvf(GL10.GL TEXTURE ENV, GL10.GL TEXTURE ENV MODE, GL10.GL REPLACE) GLUtils.texImage2D(GL10.GL TEXTURE 2D, 0, bitmap, 0) crop image mCropWorkspace 0 0 mCropWorkspace 1 height mCropWorkspace 2 width mCropWorkspace 3 height ((GL11) gl).glTexParameteriv(GL10.GL TEXTURE 2D, GL11Ext.GL TEXTURE CROP RECT OES, mCropWorkspace, 0) |
7 | Viewport Pixels trouble Intel XDK I'm creating a game in Intel XDK, and using their API to get the viewport width and height. These are coming back at 1122 pixels and 746 pixels, respectively. When adding my text at 150 pixels down and 100 pixels across its being placed in the center at the bottom. var canvas document.getElementById('game') var ctx canvas.getContext('2d') var width 1122,height 746 ctx.fillText(window.innerWidth ' ' window.innerHeight,100, 150) That is writing on the screen 1122 748, but it's placed at the bottom of the screen. Not 100 pixels down by 150 pixels across. It's directly in the middle. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.