Tag Info

New answers tagged

0

First ensure that your Actors are able to report their bounds: public class Enemy extends Actor { Rectangle bounds; public Enemy() { bounds=new Rectangle((int)getX(), (int)getY(), (int)getWidth(), (int)getHeight()); } public Rectangle getBounds() { return bounds; } private void setXY(float pX,float pY) { ...


0

As long as I understand it, You can convert an Actions script 2 .swf, if it is predefined for the size of a mobile device, so it would fit in the mobile screen. But if you have to use the mobile interaction like touch, slash, etc, You'll have to do it from scratch on action script 3.


0

This is a major bug in Unity. For those who are stumbling here trying to find a solution, a very awesome gentlemen posted a fix over here at github https://github.com/hvs-clark/unity-android-rotation-lock Hopefully Unity fixes this crazy bug soon, so we don't have to use workarounds like this in the future. From what I read, it is by design, which in my ...


0

This is definitely possible. I would look into this book or ebook online and it teaches you how to write effective sound classes so that you can use them in the future, with situations like you are speaking of. You can iterate through samples in any sound file and throw flags on high/low pitches, amplitudes, frequencies, etc.. Here is the book: ...


1

It seems to me that you will need to perform some sort of Frequency analysis on the audio file in question. You could either pre-process the file on level load (using the data to queue up your level actions), or perform the analysis in real-time. Either way, you'll want to divide your audio waveform into sections, each comprised of N samples, and then ...


0

Ok after a lot of tries I made it,Stil I dont know if this is the best way to achieve this, if someone can explain why this is a solution it will be good! I just change the matrix mode to GL_PROJECTION and translate it gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(0f, 8f, 0f, 4f, -1f, 1f); gl.glTranslatef(x, y, 0f); ...


0

I made an Atari breakout game in my hs comp sci class, and I had trouble reflecting the ball off surfaces because I used x++ and y++, etc. to control the direction of the ball. To make this more efficient, I used vectors to control the speed and direction of my ball: x+= speed * cos(theta); Y+= speed * sin(theta); Incrementing theta by Pi/2 radians (90 ...


0

I was earlier in the same confusion and finally found out there is no proper solution for this. My consideration for Google play was not for ranking but for using the leaderboards and multiplayer features. And again If I go with Google Play Services alone, I miss a-lot with Facebook login. So you decide which has more weightage and pick one of it. If you ...


0

onAreaTouched Is triggered when the button is pressed, and that press is inside its bounds. This means the event will never be isActionOutside() or isActionCancel(), because a button simply wouldn't receive events like this. You need to have a global listener that listens for events. All your components talk to your global listener and the global listener ...


0

When you draw a sprite, the x:y coordinates you provide are the upper-left corner of the sprite. To draw it centered at a specific position, subtract half of its width and height from x and y respectively.


1

OK, that's waaaaay too much to ask in such a brief QA format, but here's a super-condensed answer: Create a GLSurfaceView see platform documentation: http://developer.android.com/training/graphics/opengl/environment.html#glsurfaceview Create an orthogonal camera that runs from 0,0 to 1,1 (see docs again) Load your foreground image (the one you want ...


1

Unity is a very powerful and very complex game engine. Most games only use a small fraction of its features. But no matter how much of it is actually used, a game which uses the Unity engine must include the whole engine which is a hefty 10MB chunk of additional filesize. For a very simplistic game like Flappy Bird, using such a huge engine is usually ...


2

It's possible to use an Android "APK Expansion File" so that additional content is downloaded at runtime the first time you launch it. Next, if you have very few graphics that always repeat (if I remember well Flappy Bird has very few graphics assets) they can be compressed in the .apk and expanded in-memory during execution. Graphics and art assets are the ...


1

Basically you have to balance - reduced number of draw calls - small memory footprint at runtime - small application package size (as already said) I suggest to organize textures/sprites that are printed in the same scene in "Sprites Atlases" and keep the max resolution of atlases around 1024x1024 or 2048x2048. This, combined with some good scripting as ...


1

There are essentially two things to consider when thinking about the drawback of a larger texture size; performance and build size. Large textures are more complex to render so have higher requirements of the hardware. Large textures also make the build size much larger which may be an issue when considering the mobile market - mobile devices have less ...


2

Not sure if this is the best way for detecting gestures, but this is how I would do it: On touchDown() I would set two member variables to store where the touch began. int xStart; int yStart; int xDrag; int yDrag; boolean gestureStarted = false; public boolean touchDown(int screenX, int screenY, int pointer) { xStart = screenX; yStart = screenY; ...


1

Following along with the other suggestions, you can use the screen width to determine the left or right side of the screen. I might also suggest using a dead spot around the balloon. Precision touching can be difficult. if you split the screen on a single column of pixels, touches near this divide might get registered on the wrong side of the line that the ...


0

Using two different inputs (one finger and two fingers) for a same action (add a force) can be disturbing. I would suggest you to only use one finger and orient the force accordingly to the touch position on screen. As you seem to use Unity, you can easily get the touch position thanks to Input.mousePosition. Combined with Screen.width you will know if ...


0

By throwing, i think you want some force added. Do this: Let the angle u want to throw be 60degree. And the force to be applied be 2Newton So, by using trignometric identities, u could do this: Vector2 force = new Vector2(2 * sin(60), 2 * cos(60)); Apply the force to ur body. (Most libraries take vector as force). (Also, u might want to convert it into ...


0

You can use this library github.com/pents90/svg-android only for android. Andengine (IDK if still in development) has an extension using this library https://github.com/nicolasgramlich/AndEngineSVGTextureRegionExtension LibGDX is not integrating this kind of feature because cannot support all platforms, just android, you can integrate this manually if your ...


0

Try to remake your game in libgdx. Libgdx is fast enough and doesnt have issues like that and it works on all platforms. Unfortunately this is only what I can think of right now and I dont like the idea of converting js to android java or whatever that coverter does. Although it will take some time, give LibGDX a test.


0

To make the moves of the AI more noticeable, you could animate them. Instead of removing the objects immediately, you could, for example, fade them to alpha over the course of a second. You could also do something more flashy like drawing a destruction animation or having them explode with a particle effect, depending on what's appropriate for the theme of ...


0

I don't know if this is going to work, but if I was you, I would only use one chunk at a time and that is the number of tiles that are visible. So something like 32x32 chunk should be fine, it depends on your viewPort and tile seizes. That way the performance should be much better.


0

There are a few ways to do this. One would be to continuously store your sprites position points in an array that's updated to hold the last 20 positions or so depending how many you need for your trail. Then you can simply apply white circle sprites(or whatever you want the trail to be made of) on to only the current points in that array or every other ...


0

Saw this the other day, might well be worth a look to solve this problem. Sounds like a pretty nice idea to me: http://tmtg.net/glesjs/ The fact that it works fine when in browser, but not when on Phonegap/Cordova is very strange indeed. The whole canvas/webGL situation on Android (can't speak for iOS) has always seemed pretty dire to me. Definitely ...


0

It is very likely that your bmp loader does not load the alpha channel and fills it with a default value, as BMP with alpha channel is non-standard. Try using a .png file instead. From wikipedia: "An integrated alpha channel has been introduced with the undocumented BITMAPV3INFOHEADER and with the documented BITMAPV4HEADER (since Windows 95) and is used ...


0

I think your code looks just fine, but the only thing that bothers me, is that you use the batch from Game class. I think you should use new SpriteBatch for each new Screen and not using the one from Game class. Or change your structure of code and have Game class which calls render function from LibGDX and from that render function call render functions ...


0

Callback approach Apart from some small errors in the accepted answer I prefer the callback approach to get the results so we don't have to perform all of this in the background. To simplify comparison I used the same GameHelper. This GameHelper object is a singleton containing a reference to the GoogleApiClient object. Updated example code: ...


1

It is an apk, but your computer associates that filetype with Gamespy Arcade Online. When I search on "gamespy arcade online filetype" I see that it is also APK: What is .apk file? The APK file extension is used by GameSpy Arcade service, a shareware multiplayer game server browsing utility To change this, search for "windows associate ...


1

Have you tried renaming it? Maybe theres a installed program that detects APK files as what you have said. And just to make sure, check show known extension in you folder options in windows



Top 50 recent answers are included