Hot answers tagged

18

To answer your question directly, no Steam doesn't notify the purchaser that the game needs Oracle's Java Runtime Environment installed to play the game. That's because there shouldn't be any need to, any game that has a dependency on the JRE will download and install it as part of the normal Steam installation procedure. This is no different than games that ...


13

This is by no means an answer, but some points to consider. It did not fit in the comments box. I would think that even if you were to use c++, you would need to ship your game with a bunch of Redistributable, at least on Windows. Unless you can manage to not use Visual Studio tools and such. I don't know what happens for Mac users. And if you go with ...


6

This related question recommends using launch4j. Based on 3 Ring's code page, it looks like they use getdown for Spiral Knights. You might consider reaching out to Puppy Games to see if they're willing to share any insights. Similarly, there are some devs on java-gaming.org that have some experience with this.


3

You load your images like this: texture = TextureLoader.getTexture("PNG", new FileInputStream("res/" + fileName + ".png")); However if you read through the source code of slick you'll see that internally it is represented as TextureImpl which was the following documentation. A texture to be bound within JOGL. This object is responsible for keeping ...


3

I've done something similar in the past and I used a quadratic equation to find the time t where the two paths (target and bullet) intersect. This is what it looks like when implemented using libGDXs classes; private static Vector2 sub(Vector2 lhs, Vector2 rhs) { return (new Vector2(lhs)).sub(rhs); } private static Vector2 ...


3

I don't think you can fix that "loading" issue, if your game has to open a file from HDD, load the content, parse it and draw it there's nothing to do that could speed it up. I would say that, the best you can do is store the whole map in memory and get chunks more often, like 100m sou you should be able to high speed reading from ram and the lag would ...


3

You seem to lack some insight on your issue. A couple of things to consider: Is your true maximum frame rate on your PC really 60 or is it more? NVida drivers limit the frame rate to the maximum draw rate of the monitor, typically 60 Hz; this is due to the fact that there is no need to ask to draw faster than what the monitor is able to process. By ...


3

I would make it little different, i would make a procedural path builder and then spawn floor tiles randomly all over the map, so the rooms will be more "natural created" and them will be linked at least for 1 tile, i can't code in java but i'll code the example in javascript, i think it's clear enough. var c = ...


3

You did not specify whether you will have many circles or just a few. However, by the measures you mentioned I assumed it's just a few (by the way, if the measures you are thinking of are correct, only 4 circles will fit perfectly into the rectangle...). So, if you have just a few circles, you can opt for a very naive solution: save each new valid circle in ...


2

As people have said in comments section, A* or (AStar) is a viable algorithm for this, and a good waypoint. Here you have a generic AStar implementation in Java so you can start with something. Please, ask if you have any question. import java.util.*; public class AStar { public static class PriorityList extends LinkedList { public void ...


2

Scene2D already checks if an Actor is on your viewport or not. You don´t need to code that. Edit: I´m searching on the Scene2D documentation about this, I can´t find it, but I know it is true, if someone can help me and link it, that would be nice :) I think it is necessary to add a reference to the documentation for this answer.


2

GL11.glColor3f(alpha, alpha, alpha); won't work for 2 reasons: It's opaque. You'd need GL11.glColor4f(alpha, alpha, alpha,alpha); It affects the next object to be rendered, not everything already rendered. It would be easier to render a semi-transparent quad over the whole screen (with a slightly higher z-depth) prior to drawing the menu. This will cut ...


2

Sounds like you're looking for the vector magnitude, also called (depending on context) its length, Euclidean norm, or Pythagorean Theorem. ie. speed = sqrt(dot(velocity, velocity)); As Alexandre Vaillancourt points out, in libGDX the len() method does exactly this. Other environments will almost always have an equivalent (eg. in Unity it's .magnitude) ...


2

I'm not sure if its a good solution but i use to add x, y and z (gonna call this XYZ from now) and store it in a linked list with an object identifier and the average side size (we gonna asume that, in this example the object is a cube of 20x20x20 so 20*3/3 = 20). //PSEUDOCODE MYOBJECT ob(/*id*/ 1, /*size*/ 20, /*x*/ 30, /*y*/ 12, /*z*/ 4); ...


2

I'm going to drop this alternative into the mix. Its one that I really liked and used myself, with some changes. https://www.reddit.com/r/gamedev/comments/1dlwc4/procedural_dungeon_generation_algorithm_explained/ Roughly speaking the steps are: Generate a bunch of squares of various sizes, save them to an array (you probably want a class for these ...


2

You seem to just show the foliage at pre-determined distance. Why don't you lerp foliage opacity between transparent and opaque across some distance range? Could be the simplest most noticeable improvement.


2

You can find all what you need here Tile maps class, and read the section Rendering Tiled Maps according to Libgdx docs: Performance considerations While we try to make the renderers as fast as possible, there are a few things you can consider to boost rendering performance. Only use tiles from a single tile set in a layer. This will reduce ...


2

You shouldn't call dispose directly on a Texture loaded by an AssetManager, they are disposed the the AssetManager is cleared or disposed or if you call unload on the AssetManager and pass the Texture. The reason you shouldn't dispose assets from an AssetManager is that they can be shared between many other assets (two fonts may use the same texture for ...


2

It depends on what you need to store. If you just want the positions of the tiles, a 2D array is probably the easiest way to store it (unless you have a dynamic world size). If you want the connections (for movement costs, etc.) then a Graph is probably what you want to use.


2

You can set spotlights and simulate light by a raycast algorithm and interpolate to have the light intensity, here's an approximation in javascript that i wrote to test something similar some time ago, read it carefully, it's not clean as it could be but it can help you to find out your own solution. var canvas = ...


1

Don't get caught up in the exact numbers used in the example. Those are not the main point. It's how they are relative to each other. You see that xhdpi 200x200 is twice as big as mdpi 100x100. Notice the if in the example. List of densities: xxhdpi: 3.0 xhdpi: 2.0 hdpi: 1.5 mdpi: 1.0 (baseline) ldpi: 0.75 Sample example but with different numbers: ...


1

If I understand you correctly you are having problems going left and right. First off currentFrontSpeed should never be negative since it's speed not velocity. Speed is a scalar and as such should not capture any direction and will always be positive. To move in different directions you should modify the angle instead where for example right is -90 from ...


1

One way to do this would be to clamp (limit) the x and y values of the camera to your width and height of the game. It may look something like this: Clamp method: public int clamp(int var, int max, int min) { if(var > min) { if(var < max) { return var; } else return max; } else return min; /* * var = your variable ...


1

Usually a single one dimensional array would work fine, just remember that, to get the tile you want you have to use the formula tile[x +(y*tiles_in_row)]


1

I reccomend you delete and load smaller pieces (~50m) at a time to keep a more stable (if not lower) fps.


1

You're already part of the way there with recognising that your targets have a constant velocity - as well as the speed they are moving at, they're also moving in a specific direction (which is the difference between a speed and a velocity). If you know where the bullet is travelling (given its current location and velocity) you can calculate that after x ...


1

From you code I can't tell what the ownerv vector is so I can't tell you why it's giving you the wrong result. But to do it from scratch, according to Wikipedia's article on vector projection, you can do the following; Create a vector a that is the direction from o to v. Create a vector b that is the direction from o to n. Let d be the dot product of a ...


1

One way to approach this would be to represent the definition of the first bodies as Rectangles, then the problem of figuring out the position and rotation of the bridges goes aways as the bridge is always made up as a polygon touching the top corners of the Rectangle. The above image was generated using this approach, full source code below. It uses ...


1

The best way to solve this is not with trigonometry, but with vector math! I'm going to write some quick pseudocode of what you need to check for difference in angles, if you want the juicy details of the whys and hows scroll further down. Summary: float l1x = entity.getPosition().x - player.getPosition().x; float l1y = entity.getPosition().y - ...


1

It´s hard without seeing the code, but I think I can give you an asnwer. You can check which rooms are next to which rooms using the rows and columns of the file you created. The pathfinding is a bit harder, once you have your current room and the objetive room (the one next to the current room, I guess), all you need to do is define exact point for ...



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