Hot answers tagged

4

The Chartboost TOS says, in part: You will not, and will not allow any third party to... directly or indirectly generate queries, or impressions of or clicks on ads, including without limitation Online Services Ads, through any automated, deceptive, fraudulent or other invalid means (including, but not limited to, click spam, robots, macro Online ...


3

Libgdx is a free game library that supports java and can be deployed to Android and iOS. You will definitely be able to use a lot of your existing code and, depending on how you implemented your Android game, you may even be able to convert many of your draw calls to the Android canvas directly to draw calls in Libgdx. Libgdx definitely has a steeper ...


3

There is no simple way to convert your java code into Unity, unfortunately. You are going to have to convert the entire code base into either C# or Javascript. Even the way you do your scenes are going to have to be updated. There is no easy way around it, sorry to say.


2

More code would be helpful, but you likely need to put this in your show method. public void show() { Gdx.input.setInputProcessor(yourInputProcessor); // This should keep it from exiting. Gdx.input.setCatchBackKey(true); ... }


1

The best way to load in music and sound effects resources is through LibGDX's audio methods: Music music = Gdx.audio.newMusic(Gdx.files.internal(path_to_music_file)); Sound sound = Gdx.audio.newSound(Gdx.files.internal(path_to_sound_file)); To play the music: music.setVolume(1f); music.play(); To play the sound effect: long id = sound.play(); sound....


1

This is actually pretty straight forward. Instead of loading up an image from a static path, you would want to store up (the implementation depends on how you store your levels) a path to the correct background for the level along the other level data. As you are loading and creating your game objects, you would load the path to the background image and set ...


1

It is a little bit difficult understanding your question, but I think your problem is caused by the fact that you update all ballons in the update (float dt) method even though you're not drawing them. This means that when 200 iterations has passed and you draw ballons and ballons2 for the first time, they have already moved some distance.


1

in your update method you should add the below code. if (Gdx.input.isKeyPressed(Keys.BACK)) { game.setScreen(new MenuScreen(game)); } // and in your game Screen classes show method Add this code Gdx.input.setCatchBackKey(true);


1

You missuse the animation class. you need to do the following: currentframe = animation.getKeyFrame(Gdx.graphics.getDeltaTime(), true); Currently you use an increasing time for your time passed. which is wrong, the animation class handles the passed time by itself. Easier explained: Imagine a cake. If you eat constantly 3 percent you'll see it fade ...


1

I'm giving you how I did this in java before I switched to Unity. Perhaps you can use it in c# with small modifications: So lately I did it this way: screenWidth = getResources().getDisplayMetrics().widthPixels; screenHeight = getResources().getDisplayMetrics().heightPixels; But I used to do it this way too (probably deprecated): Display display = ...



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