Hot answers tagged

4

You must configure GDX to use GL30 prior to calling functions on Gdx.gl30: config.useGL30 = true; com.badlogic.gdx.graphics.GL30 does not contain glClear and glClearColor in its interface because it is a subclass of com.badlogic.gdx.graphics.GL20 and those functions are inherited from GL20 therefore there is no need to define them in GL30's interface. ...


3

LibGDX is based on LWGL and its advantage are that a lot of the base stuff is already written and you don't need to write it. Some people prefer to write it themselves though. LibGDX is generally used in mobile game development, but can also be used on Windows, Mac and Html. Some final words: For beginners I would suggest using LibGDX, because it is easier ...


2

The relationship between the Gun and the Bullet is purely 'spawner/spawned'. It's not parent-child. In real-life, when you shoot a bullet with a gun, both objects are no longer linked: you can move the gun as you want, once the bullet is out of the barrel, there's nothing you can do to change its trajectory. So in your case, you should make the bullet as ...


2

A simple way to achieve smooth lighting in a tile based game, is to draw a "lightmap" to a render target, and then drawing this render target over top your scene while alpha blending it. Your light map render target would be the size of your tile map, but in pixels. Each pixel would represent the light color of its corresponding tile. This render texture ...


1

Some years ago, Blizzard had an April fool's joke about World of Warcraft: the Ogre character (two-headed), could be played by two players. This was hilarious, because it's a non-sense. You're doing the same thing here: you have two different systems that control the same component. An entity's position should be controlled either by the PhysicsSystem or ...


1

From the libGDX github wiki: Note: By default, the Json class will not write those fields which have values that are identical to a newly constructed instance. If you wish to disable this behavior and include all fields, call json.setUsePrototypes(false);.


1

Unless there's a specific reason you'd need (want) to process the data in a State you should probably stick to Ashley's own EntitySystem. Without you yourself expanding the functionality of State, EntitySystems are for sure more flexible, as in you can tell it to not process the system, you can do something when it's added / removed etc. Also the ...


1

I see two solutions to this: Make your player a part of the TiledMap by adding him to his own layer. This will automatically render him in the correct order like all of your other tiles. Add an integer property to your tiles in whatever program you're using to create your maps named "zIndex" and then sort your tiles by this property and render them in the ...


1

Sort by z position. You will probably want to add an origin to every object as well to determine their position in the game world (ie the players feed, the center of where the box touches the ground, etc.). There are some restrictions for what objects this will work for though. When the players z position becomes larger or smaller than that of an object he ...



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