Hot answers tagged

9

Text files are a perfectly fine way to create savegames. It's easy to implement and it allows you as the developer to edit savegame files in a text editor in order to test things more quickly. But for easier parsing and better compatibility between versions, you might want to use a standard markup format like XML, JSON or YAML which you serialize and ...


2

Checking the Wikipedia article on Network Time Protocol, we find this Windows documentation as one example: Under the right operating conditions, systems running Windows 10 or Windows Server 2016 and newer releases can deliver 1 second, 50ms (milliseconds), or 1ms accuracy. To achieve the tighter 50 ms bound, the documentation says: The target computer ...


2

Looks like you need to compare angles and work out their difference. Here's one way to do it: // Returns the difference between two angles, from -180 to +180 degrees. float deltaAngle(float aDegrees, float bDegrees) { float difference = aDegrees - bDegrees + 180.0f; return (float)(difference - Math.floor(difference/360.0f) * 360.0f - 180.0f); } // ...


2

You can make your grid 8x8 and expand all impassible tiles into a 4x4 patch of impassible tiles. Or in other words a tile is impassible if any of the tiles in a 4x4 region around it is impassible. Then you can path find based on a 1x1 entity on that modified grid and when you make an entity follow that path you expand it's location opposite as you expanded ...


1

If you don't need the deceleration to be the same fixed amount each frame, you can instead apply a "drag multiplier". This is used in many games as a crude approximation of air resistance, where the faster you go, the more air you have to push through per unit of time, increasing the friction at high speeds. public float velocityMultiplier = 0.95f; ...


1

I found the solution in a badlogic forum. This: modelBuilder.part("minecraft:loading_model", mesh, 4, new Material(TextureAttribute.createDiffuse(atlas), blendingAttribute, FloatAttribute.createAlphaTest(0.95f))); Or this: modelInstance.materials.get(0).set(FloatAttribute.createAlphaTest(0.95f));


1

Please note that we generally expect users to show some effort when asking questions. Also, we expect them to show us only the relevant code necessary for the question. We also expect them to be precise with what they need. Although your question was really badly formatted at first, the downvotes you got probably come from your lack of research and code ...


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