New answers tagged

0

Published a sample doing 30FPS using choreographer API. https://github.com/googlesamples/android-ndk/tree/master/choreographer-30fps Does that work for you?


0

My guess is that you have a stray ! in your code. Remove the ! in: if (!Gdx.input.isTouched()) { This is making it so shootToward() is being called when the player is not touching the screen.


0

I use this and it seems to work on different devices. The motion of putting the phone down gives me a value for the delta x of -0.5041921 on a samsung galaxy and a -0.5021868 on a Nexus 5. using UnityEngine; using UnityEngine.UI; public class GyroController : MonoBehaviour { // public Text x, y, z; public Dice dice; public GameManager ...


1

I think you have created many jar files. Combine the two or more jar files into one and give them the same package name. If you get the jar file from Eclipse, create more classes in the same package, and call this package name into your plugin. This will be a better choice.


1

If you want to use sqlite with libGdx you can use opensource project gdx-sqlite . gdx-sqlite is a cross-platform Libgdx extension for SQLite database handling. The extension abstracts database handling to provide a unified method to handle database transacitons across multiple platforms while also adding SQLite support for desktop version of Libgdx ...


2

Look at some free android Java tutorials on youtube or read some from places like code+tuts or mybringback. Nobody is going to hand you code. Guru Raj is right, use lists because they are less of a pain to use and also fetch your words from an external csv file or so. That way you can pull your word library from wikipedia. Then you can pull random words ...


0

Check if button is held down by user. create a bool value and turn it true if the button is held down and false if not. then move the player is bool value is true and stop if false.


2

You can store the values in a database,It is simple if you use database like sqlite but that wont work with libgdx -android. Instead you can use gdx-sqlite gdx-sqlite is a cross-platform Libgdx extension for SQLite database handling. The extension abstracts databse handling to provide a unified method to handle database transacitons across multiple ...


0

Unity is probably set to build for Android 4.0.3 (or something higher than 2.3.3). You can change this in the Player Settings.


3

Unity remote sends a compressed stream from the editor to your phone and then sends back the inputs from the phone to the editor. there is nothing you can do about it being bad quality. How ever this does not represent the final quality of the build. Try making a real build for android and check how it looks then.


3

If you're definitely only ever going to have one instance of these objects, and presumably you are, then this would be a better way to go. However, maybe a better solution would be to use the Singleton pattern, and (for example) create a static GetScreen() method in the Screen class that any other class can call to obtain the single instance of the Screen ...


1

The nice thing about the Factory pattern is that the base class can be abstract and you can have different derived Factory classes. That means you can have an ExplosionFactory, a BulletFactory, an EnemyFactory and so on, which all inherit from the basic class GameObjectFactory. Any code which is common to all objects would be in the GameObjectFactory while ...


9

It won't hurt performance. It might in fact be (very, very negligible) faster because you save the overhead of passing these objects to the game objects. The reason static classes are often frowned upon is that their static properties are global variables and globals cause all kinds of problems architecture-wise. For example, when you ever decide you might ...


1

I don't know android specifically, but if you are using OpenGL ES, you can use a shader to make this work. First create a image like this in black color. Then use a color tint. Now use a fragment shader to draw this texture. The code looks like this. #ifdef GL_ES precision mediump float; #endif varying vec2 texCoords; uniform vec4 color; uniform ...


0

Your game engine choice is really up to you, but I love using Tiled in conjunction with Libgdx (which supports android very well). Libgdx has a great library for reading .tmx files (the kind created by Tiled). You can read all about The library in the documentation. And yes, it does have support for Map Objects. At the very least, you could look at the ...


0

I would do this rather than have a dozen classes and races; public class GameCharacter { public enum CharacterClass { WARRIOR { @Override public void attack(GameCharacter from, GameCharacter target) { //Do something here } }, MAGE { ...


2

As hinted at in the comments, you'll want to use a combination of Inheritance and Composition. (Inheritance being is a and Composition being has a). In your case, each Character isn't a race or a class, but instead has a race and has a class. Each race would then inherit from a base Race class, and each Class would inherit from a base Class class. An ...


0

The libGDX TextField is, according tho the API specification, a "A single-line text input field.". That's why it's not wrapping the text.


0

API level 13 isn't the only one you are supposed to install in order to export APKs from Game Maker (Studio, I guess). All you need to do is check this guide out and follow the steps. I did so and Android module worked fine.


0

I am not exactly sure what your problem is. Did you place the pos.X + 1 in the proper place. Could you edit to show the object? Then maybe your problem could be solved. For a start, you should check where you placed all your objects and everything. That is were the errors usually come.


0

The problem was in this line. TextureRegion tmp = new TextureRegion(Asset.sprites, SPRITE_SIZE * SPRITE_COUNT, rand * SPRITE_SIZE); I've used the wrong params, so I forgot width and height. I changed to this. TextureRegion tmp = new TextureRegion(Asset.sprites, 0, rand * SPRITE_SIZE, SPRITE_SIZE*SPRITE_COUNT, SPRITE_SIZE);


0

In onAdClosed() you need to check if the user has watched the ad. public void onAdClosed() { if(adFinishedPlaying()) { giveUserPoint(); } } }


0

You never tweak gravity. It is a constant force. A jump is an instantaneous force applied to a body only when the altitude of the body is at 0. To jump, you must apply a force or acceleration strong enough to overcome gravity. We do this by applying a force that results an acceleration of +9.8 or higher example: Mass=10 Force=10 Acceleration=1 (no-good) ...


0

To directly answer your main question, yes, you can draw lines connecting arbitrary coordinates in arbitrary ways in Unity. One of my favorite Unity assets for this is Vectrosity, and you can play with some of their wireframe-style demos here. I haven't used Vectrosity in a VR project yet myself, but I see no reason it wouldn't work, beyond the usual ...


0

After researching LibGDX and OpenGL further I've found the root of the problem, which was loss of OpenGL Context. All of the texture loading needs to be done when the thread has access to the context, which is true when the app first loads but becomes false later on. In order to fix the problem, the textures need to be loaded in a thread that has access to ...


2

Yes, that's the minimum size for an empty project when deployed. Mono Runtime The Mono Runtime which allows your C#, JS, Boo code to execute - basically like the .NET Framework - not a trivial piece of machinery! Unity Platform You know wherever you are using UnityEngine? That doesn't come from nowhere. All the logic and functionality of the engine (a ...


0

I don't know why, but cloning mModelMatrix2 into mTempMatrix2 and using that as the operand in Matrix.multiplyMM instead of directly using mModelMatrix2, solved the problem float[] mTempMatrix2 = mModelMatrix2.clone(); Matrix.multiplyMM(mModelMatrix2, 0, mTempMatrix2, 0, mRotationMatrix, 0); If somebody can post a comment and explain me why it ...


0

Matrices can be interprited in two different ways: Column major and Row major. Consider the following matrix: [1, 5 ] [0, 1 ] Putting it in a float[] as you did stores it in memory as such: { 1, 5, 0, 1 } So essentially, every two sequential numbers form one row of the matrix - this is storing it in row-major format. However, the multiplication ...



Top 50 recent answers are included