Tag Info

Hot answers tagged

4

One option is to use a wake lock. Example from the docs: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); wl.acquire(); // screen and CPU will stay awake during this section wl.release(); I've got this answer from this stack overflow post. ...


3

I have faced similar problem before. I am pretty sure that co routines won't help you reduce the lag. Multi threading will be a proper solution instead of co routines. But apparently I didn't use either of them. My game had finite predefined pool objects. So instead of instantiating them, in the editor I made a parent game object named Pool and made all the ...


3

One way to avoid using a load of if/else/else if statements that always checks the same set of things is to use the state machine design pattern. You start by defining the different states that influence the behaviour, based on the player preferences. Then you extract the behaviour from where it is now, and add it to a method of a class that derives from ...


2

I spent a good while looking how to implement Box2D in Android studio, so for anyone else in the same boat, or just looking to implement Box2D - here goes. For implementing Box2D into your java code/framework, Box2D is tuned to work with numbers between 0.1 and 10 (it works in meters), quoting from the Box2D manual: http://box2d.org/manual.pdf Box2D ...


2

It should work if you change these parts in show(): viewport = new ScalingViewport(Scaling.fillY, GAMESCREEN_WIDTH, GAMESCREEN_HEIGHT, camera = new OrthographicCamera()); and add a resize method: @Override public void resize(int width, int height) { int SCREEN_WIDTH = width; int SCREEN_HEIGHT = height; viewport.setWorldSize(GAMESCREEN_WIDTH, ...


2

I've never tried to get this to work myself, but it seems like you would just need to increase the upward force applied to the jet ski's body as a function of the depth of the jet ski below the "surface" of the water object. The easiest way to get the distance below the surface might be to make a constant variable that describes the height of the water's ...


2

I know this question is a little old but Android has changed some in the past 3 years so I think it's worth posting this answer. Starting in Android 4.4, there's native screen recording. You can use ADB from a computer the phone is connected to or there are at least a dozen or so apps to help you do it (some with root, some without). Without root, you'll ...


1

The problem was a body from the previous level seemed to be left behind for some reason in that spot in the screenshot from level two. To correctly and definitely remove the bodies, I now do this: // Loop through all of the current bodies in the world. for(int bodyNumber = 0; bodyNumber < world.getBodyCount(); bodyNumber++) { // If the body still ...


1

Possible? Obviously. http://www.android.com/tv/ showcases a few games that are available. I assume that they are using the same channels that they would use to make a game for a phone or a tablet, based on the pictures and a little familiarity with the SDK. Although I don't use libGDX that much, I assume that because it rides on the Android SDK, it ...


1

Short answer: You need to create Unity Android plugin of Android project using Google Cloud Messaging. Details of how to create Android Unity plugin you can find Unity's official site. Here are some details: A) You have to start with google Android sample app, understand the push-related API methods ...


1

Which game specifically? What engine does it run on? Is the source available? If the source isn't available then you're SOL unless you REALLY like decompiling. Chances are good the code base is C or C++ (lets hope so). That means you have to compile with the Android NDK which isn't trivial. My experiences with it have been painful. You're right you have to ...


1

You can download a plugin in asset store to regulate vibration. here's a link: https://www.assetstore.unity3d.com/en/#!/content/10982 or you can check this one it's FREE: https://www.assetstore.unity3d.com/en/#!/content/16648



Only top voted, non community-wiki answers of a minimum length are eligible