libgdx

How to display a Interstitial Ad in a LibGDX project?

落爺英雄遲暮 提交于 2019-12-01 12:29:52
I found a Flappy Bird GitHub project and changed it a little bit. I successfully implemented the AdMob Banner. But now I also want a Interstitial Ad which pops up when the Game is over (not every time of course) so here is my GitHub project: https://github.com/DaFaack/FlappyBibi Please explain me how to do it because I can't find a good explanation on the internet. I want to display the ad in the run() method. You can find it in the core package -> GameplayScreen.java File -> renderPlaying() method and then the run() method. This is the method i am talking about: private void renderPlaying() {

libgdx game not working in android phones

时光毁灭记忆、已成空白 提交于 2019-12-01 12:26:33
问题 i am trying to build android game from this libgdx based games but the android app crashes when ported to android game the libgdx code i downloaded from http://rengelbert.com/blog/downloads/froggerLibGDXSource.zip and i have build the android code for this game you can download it from here https://rapidshare.com/files/3456268683/FroggerLibGDXAndroid.zip the game crashes and not starting Please help me in porting the game to android this is the error message i got /AndroidRuntime( 2966): >>>>

How to completely disable MultiWindow support in LIBGDX game

亡梦爱人 提交于 2019-12-01 11:54:28
问题 I'm getting alot of memory allocations in my render thread and I've traced the cause to MultiWindow support which is weird because I have this feature disabled on my phone . I've added to AndroidManifest the following (based on this) code inside the application tag but with no luck, I still get unwanted memory allocations (only when I touch the screen): <meta-data android:name="com.sec.android.support.multiwindow" android:value="false" /> <meta-data android:name="com.samsung.android.sdk

LIBGDX speeding up a whole game (using box2d)

荒凉一梦 提交于 2019-12-01 11:21:51
问题 I was wondering how i can speed up whole game done with libgdx (for example after clicking a button). The way i have in my game is modify a timestep variable used in world.step(TIMESTEP, VELOCITYITERATIONS, POSITIONITERATIONS); but im now sure if it's a good idea. If there a any better way to archive that? 回答1: When using Box2D you can speed up your game by modifying the physics step. One problem is that you should use a constant steptime. I use the following code below in my games: private

libgdx Viewports - Why when I use FitViewport the touch input x and y is not accurate?

為{幸葍}努か 提交于 2019-12-01 11:00:39
libgdx Viewports - Why when I use FitViewport the touch input x and y is not accurate? Use viewport.unproject() instead of camera.unproject() so the cropping of the FitViewport is taken into acount. 来源: https://stackoverflow.com/questions/38226563/libgdx-viewports-why-when-i-use-fitviewport-the-touch-input-x-and-y-is-not-acc

libGdx How to use images or actor as body

寵の児 提交于 2019-12-01 10:37:31
I gone through the libGdx wiki/tutorial but I didn't find example to use an image or an actor as a physics body. In my game I am adding an actor to the stage. But I want to add this actor or sprite image as physics body. I have to drag this actor and even want to detect collision with other bodies. please give me reference if you have. Thanks This is a bit tricky. You don't use an image or an Actor as a physics body. You will need to implement something like a new "PhysicsActor" which extends Actor. This Physics actor will have a body as a property and will be the bridge between your libgdx

Ads are not displaying after publishing final application

南笙酒味 提交于 2019-12-01 10:00:47
问题 I had a game which I designed using libgdx. It was displaying ads before publishing it on Google Play as I tested it by this code: adView = new AdView(this); adView.setAdSize(AdSize.BANNER); adView.setAdUnitId(AD_UNIT_ID); AdRequest adRequest = new AdRequest.Builder().addTestDevice(TEST_DEVICE).build(); adView.loadAd(adRequest); Before publishing the game I changed some lines of my code to be like this: adView = new AdView(this); adView.setAdSize(AdSize.BANNER); adView.setAdUnitId(AD_UNIT_ID)

How do I make a libGDX Desktop application resizable?

断了今生、忘了曾经 提交于 2019-12-01 09:31:24
libGDX Applications must implement the .resize(int width, int height) method, so I figured that resizing a libGDX app is not a big deal, but I found no way to make the actual application JFrame or whatever that is draggable as with JFrame.setResizable(true). Is that simply not possible with libGDX ? If you use gdx-backend-lwjgl for you desktop app, then you can use: LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.resizable = true; new LwjglApplication(new YourGame(), config); Use newest source from SVN trunk. 来源: https://stackoverflow.com/questions/8779108

Best way to detect the touched object (moving) from collection in libgdx

好久不见. 提交于 2019-12-01 08:40:16
This is my first attempt in game development. I just started experimenting libgdx and understanding the different aspects of game programming. I looked at the sample projects, i can understand the overall architecture of the libgdx game. But to get hold of the basics of game dynamics, i started playing with low level stuff like how to draw simple shapes, how to move them, how to handle collision like that. So i planned to write a dead simple android game(Its not even a game for sure). This is the idea 1. Create random shapes and make it fly (move) 2. When user touches the shape, it ll explode

Libgdx box2d issue with dimensions and camera zooming

99封情书 提交于 2019-12-01 08:34:37
问题 I've got a problem with Box2D . I'm making a simple 2D game, with a player shooting to enemies. I read that 1 unity in Box2D is equivalent to 1 meter so i should use little dimensions. I set world dimensions to 160x90 but here are the problems: Using little dimensions i had to zoom my camera that is set to 1280x720 but as you can see there is a big drop of quality in shapes, and also the movements of bodies are no longer flowing. And the max speed is still too slow even if the world steps at