Tag Info

Hot answers tagged

8

TextureAtlas#findRegion(String) returns a region with a name that matches the name specified. It does not copy the region, therefore any changes you make to the region will be reflected in the TextureAtlas. To overcome this issue, simply instantiate a new TextureRegion object and pass it the region found inside your TextureAtlas: background1 = new ...


3

The simple answer is that in general, your levels should be defined as data, and your code should be the same for all levels, it just reads the data to know what to do.


2

A lot of great Libgdx extensions have been added to the maven repository such as freetype, tools and many other great libraries. This means you can add extensions in a blink of an eye, at least if you used the gradle LibGDX setup. In your case you want to add freetype, look it up in the link above and select the version you need. Now select the tab Gradle ...


2

You can use pendulum physic to approximate your rope swing. Calculate the fluctuation period (this is true for small fluctuations) T = 2*PI*SQRT(L/g) where: PI = 3.14 g = 9.8 (if I remember) the earth gravity acceleration L : the rope length, or better the length from rotation fulcrum to the character hands. Then you get the fluctuation angle as ...


2

Short answer: This doesn't do what you think it does. float pressure - A normalized value that describes the pressure applied to the device by a finger or other tool. The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), although values higher than 1 may be generated depending on the calibration of the input device. ...


2

You should register the pointer you are walking with. Pointers are the number of touches on the screen and they are provided by the listeners you are using. I think if you change this it to something like below you can get it to work: @Override public boolean touchUp(int screenX, int screenY, int pointer, int button) { if (int pointer != 0) ...


2

Why would you make the game free on android and let PC users pay $10 + $1/month? The big trend for most indies is building a fanbase as soon you have something to show from your game. Blogging about everything that involves your game and perhaps let your fans influence your design. You can find a lot of sources at open indie developers like Grid Sage ...


2

Basically, what a hashmap does is store the objects in a random location in your memory. Complexity is O(1) which means that it will always take the same amount of time to retrive an object from the hashmap. The amount of time depends on various factors. This might be quite fast for few objects, but as soon as you start drawing scene with hundreds of ...


2

I could say that using ETC1 or any other compression will surely improve your memory usage but will NOT improve your CPU/GPU usage. See uncompressed file formats can be used without any additional processing whereas compressed ones must be decompressed (processing impact) first. If you would reuse (and not load up every time) those textures would act just as ...


1

If you are creating a 2D game with tiles you can easily implement your own culling which is a lot cheaper since you only itterate over exactly what you need within your tile array. Things you should know: Camera location Viewport width/height Tile width/height Now we can calculate how many tiles should be drawn. Total horizontal tiles on screen = ...


1

You're already halfway there since you send matrix data every frame. A little bit of history. attributes used to be called varying because their value varies depending on the vertex in the buffer. uniforms are called such because their data is uniform across every vertex of the buffer. Since your matrix is uniform the GPU can handle it being changed at ...


1

First of all yes, off course you are able to create mobile games with the Unity free engine. Otherwise it would be silly to have added a feature like that in the free version. In the past free versions there was limited access to the engine but still plenty of tools to work with and complete a game. Unity changed it's license since unity 5.0, they had too ...



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