Tagged Questions

Java is both a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

learn more… | top users | synonyms

1
vote
1answer
179 views

How should I implement the “Observer” pattern with respect to a game world?

I'm thinking of ways to implement the Observer pattern in a game I'm developing at the moment. I can have a Game World (local map) with Game Objects (player, NPCs, monsters etc...) inside of it. Other ...
0
votes
0answers
88 views

Slick2D/LWJGL Drawing coloured lights problem

I am using the Slick2D engine. I've followed this snippet for creating light sources. I have followed step step, added what is actually important for me, and tested it and the lighting effects ...
2
votes
1answer
96 views

Daily Unlock in LibGDX

I am trying to make a game that is a collection of mini games. The mini games will unlock daily. There are story for each day. And the story cannot be repeated so for example the player start playing ...
1
vote
1answer
43 views

In JBox2d when dragging a Body, why is the direction is flipped vertically?

Why is it when I drag a JBox2d Body with the mouse, the vertical component is flipped? e.g. If I drag down-right, the Body moves up-right. Is this expected behaviour, a bug in JBox2D, a Mac ...
0
votes
1answer
197 views

Smoothing Pathfinding on Tile-Based Terrain but Free-Roaming Player

I'm sorry if this is a long post, but I feel as though the details should help clarify gray areas. I'll try and provide a detailed layout of what I'm trying to achieve, what I have so far, and where ...
0
votes
2answers
144 views

Avoid threads/multithreading [closed]

So here is the thing: I have made a thread for each generator an outpost has. We have a total of 6 outposts , 5 generators each. 3 teams, engineers can only repair generators and prevent their ...
0
votes
1answer
104 views

TiledMap not drawing completely [closed]

While attempting to constrain camera scrolling to within the TiledMap I discovered that it seems the renderer for the map is not drawing the entire map. The map is 1600x960px so one would assume the ...
2
votes
1answer
199 views

Processing move between tiles with an animation in isometric map

In my isometric map, entities can only be in the center of the floor tile. So it's tile per position. This is my map with an entity: Entity can either move forward, left, or right. Where forward ...
2
votes
1answer
246 views

Drawing tile images with bigger height on floor tiles on 2.5D isometric map

Hello I am creating my first isometric game. I have floor tiles which are 112*56 in size. This is a simple strategy game I am making, it's an existing game, I just copied the idea for practice since ...
0
votes
1answer
87 views

Array of map data

I'm looking for your thoughts on the best way to store map data. I need to store data for territory ownership for each pixel on the map. The data for each pixel is as such: Player 1 points: 24 ...
0
votes
1answer
104 views

AI / Pathfinding gets stuck

In my tile-based game, I'm using a A-star algorithm, which I have not written myself but I believe should be correctly implemented. The problem I have is that the enemy AI can get stuck so that the ...
0
votes
3answers
236 views

What is the easiest way to make an object follow the edge of a sprite?

I have a rounded rectangle sprite and another sprite that's just a circle. I want the center of the circle to follow the edge of the rounded rectangle. Is there any easy way to accomplish this task? ...
0
votes
0answers
71 views

How to render multiple VBOs in LWJGL

I'm still trying to grasp the understanding of VBOs. When you create the floatbuffer, I was told if you keep adding to the put, you would get more points for a shape with more points. My problem is, I ...
0
votes
2answers
125 views

LibGDX Images not loading

Now my Image isn't loading to the screen. I tried to be decorative with the code but since it isn't working I made it just like the video I'm whatching. I don't get any exceptions, but the image ...
0
votes
2answers
47 views

java capping fps [duplicate]

hello again I have a basic platformer game and I want to make an fps counter and cap the fps to 30 but I don't know how. I want this because when I start up the game sometimes the character moves ...
0
votes
1answer
59 views

Does LibGDX abstract OpenGL ES away or can I still use my OpenGL ES knowledge?

I've been learning OpenGL ES, and am now turning my attention to using LibGDX. My main concern with LibGDX is, if needed, will I be able to apply my OpenGL ES knowledge to something if needed and ...
1
vote
1answer
138 views

Tiles touching all of same color check

I'm currently having a problem that has stopped my productivity for quite a while. I need to check if all tiles of a color is touching each other for each color like this: I have all my code for ...
0
votes
0answers
24 views

Drawing jbox2d shapes in slick2d

How would be the best way to go about drawing polygons in slick after forces where applied to them via jbox2d? There seems to be no way to get the vertices of a body defined in jbox2d...
2
votes
2answers
709 views

Problem to match font size to the screen resolution in libgdx

I'm having problems to show text on my game at same size on different screens, and I did a simple test. This test consists to show a text fitting at the screen, I want the text has the same size ...
0
votes
0answers
82 views

libgdx ScissorStack problem

Im making a user interface using libgdx I created a Window class & a Textfield class, that both use clipping. I use the ScissorStack class of libgdx for clipping. The Textfield is drawn inside ...
1
vote
1answer
123 views

Collision between player and heightmap

Im programming a small project, an opengl height map. It is build of triangles, which points are fit to the right y position (read out of an image). The player is represanted by a cuboid. (p1, p2, ...
3
votes
1answer
108 views

How do you create a game overlay that makes the underlying graphics inactive?

I've created a simple game, and I drew a large rectangle in photoshop with faded edges that I want to use to overlay the game until the user presses "Begin" (on the overlay). The problem I'm currently ...
-1
votes
1answer
65 views

Java Game: Fullscreen images

Hi I am making a football stratedgy game and I have it the game working. I was playing prison architect and minecraft in fullscreen and noticed there was no windows it was covering the whole screen. ...
0
votes
0answers
43 views

InvocationTargetException caused by IllegalArgumentException due to trying to create a new OpenAL instance

So, after creating this class, (in this LINK) , I ran into a new problem, I recieved an InvocationTargetException, which is generally caused when a method is invoked and an exception is created when ...
0
votes
0answers
24 views

Using Graphics from my Frame's paint() gives cutting effect every call to repaint()

Every frame the run() method of my thread calls the repaint() of the frame subclass, in this frame subclass I override the paint(Graphics) and since I want to have different screens from my game I ...
0
votes
0answers
47 views

Is there any benefit to using sprite sheets in Java with awt?

I am aware that this question addresses the issue for flash and this question addresses the issue vaguely for miscellaneous rendering engines like OpenGL. The way the latter asserts the superiority of ...
1
vote
1answer
167 views

Restarting a libGDX game to apply changes to resolution

How can I restart a LibGDX game to apply certain changes to the game such as changes to the resolution (going from 1920X1080 to 1280X720), or changing full screen. Granted the resize(int width, int ...
3
votes
1answer
265 views

Centering a textbutton in a table libGDX

I have a few Tables spread across a Stage, now I have a problem. In one table, all the TextButtons are centered, while in a different one they aren't, like this: Table 1 Table 2 XXXtextXXX ...
1
vote
1answer
99 views

Libgdx - Sprites disappearing [closed]

I'm facing a little problem and I have no idea to bypass it. I've made a dungeon generator and I'm able to spawn randomly mobs, the problem is that when they are not moving the game is fine, but at ...
0
votes
1answer
69 views

background move to the right

I'm developing an android app and want to make move the background to the right. The problem that I have is if it moves it does not repeat the background. I appreciate every suggestion. Thanks. The ...
0
votes
2answers
382 views

Java collision detection and player movement: tips

I have read a short guide for game develompent (java, without external libraries). I'm facing with collision detection and player (and bullets) movements. Now i put the code. Most of it is taken ...
2
votes
1answer
482 views

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...
0
votes
0answers
56 views

Have button style not change when down

I'd like the button style to only change when it is checked and not change when it is pressed down, and/or have only the font color change. I'm using the built in Skin function with a .json file, ...
0
votes
0answers
119 views

Frame Buffer couldn't be constructed: incomplete attachment error on nexus 7

So I am running into an issue where I cannot load my game onto the nexus 7 because of the error stated previously. I read online that this is because the device can't use the Format class or something ...
0
votes
1answer
133 views

Nullpointerexception when loading resources in openGL ES 2.0 Android project

Overview My splash screen starts by display a 'loading' dialogue and then kicks off an asyncTask (The loading dialogue is derived from the standard Android View class) Within the doInBackground ...
0
votes
0answers
39 views

Java Graphics Rendering Bug

So I've been playing around with moving objects using KeyListeners and active rendering via while(true) loop. CANVAS.createBufferStrategy(3); BufferStrategy buffer = CANVAS.getBufferStrategy(); ...
0
votes
0answers
147 views

ShapeRenderer is pixelated in libGDX

When I use a ShapeRenderer, it always comes out pixelated. But if I draw the shape in photoshop with the same dimensions, it's very smooth and clean-looking. My method is just as follows: package ...
0
votes
1answer
131 views

Re-using one texture for multiple OpenGL Quads

I've been looking over my code and I'm just wondering, when I set a texture for say, 20 quads that need to use the same texture, it seems as though I'm creating a new texture each time...... surely ...
1
vote
2answers
178 views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. ...
0
votes
2answers
85 views

How to obtain the currently bound texture ID in an openGL ES 2.0 project

In my game, I have: GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texID); Where texID is an integer returned by my setTexture() method. Let's say, in this instance it's 1. When I bind my textures ...
5
votes
2answers
2k views

How To: Java Game to Steam Greenlight

I am planning to create an indie game using Java and Eclipse IDE and I want to put the finished product to Steam Greenlight. How does the whole process work after the game is finished and running ...
1
vote
1answer
159 views

Dialog Title Does Not Fit

I successfully added my own font to the default .json file and it displays, however I get some weird sizing issues. Specifically when I try to create a Dialog. This is what it looks like: Ignore the ...
1
vote
2answers
237 views

Where should I put my game loop?

I've seen some tutorials on programming a good game loop, but none mention where (in the game code) I should call it. My guess is I should call it from the main() method. Am I right? Is there another ...
0
votes
1answer
61 views

Generating multiple instances of one opengl object with random coordinates

Sorry if the question is dumb but my brain just cannot solve it for some reason.. So I've made one opengl object public static Square ball = new Square(75,75); And I am trying to make it so that ...
-1
votes
1answer
57 views

Simple rendering produces minor stutter

For some reason, this game loop renders the movement of a simple rectangle with no stuttering. double currTime; double prevTime = System.nanoTime() / NANO_TO_SEC; double FPSTIMER = ...
1
vote
0answers
101 views

Hiero Font not working [closed]

For ease of use I decided I would use the Skin class to make buttons and text, and the like, rather than draw them myself. So I downloaded Hiero to package a .ttf font into a BitmapFont and it all ...
0
votes
2answers
285 views

Texturing a VBO cube (JOGL)

I've been having trouble texturing a cube using vertex buffer objects. EDIT: I updated/replaced my shaders to fit the right version. The program compiles and links, but it shuts down java in ...
1
vote
1answer
107 views

Why isn't my background drawing to the screen?

Ok, So I have a game I have been working on for a few months now and I am now stumped beyond belief. My friend who has spent days working on this background gave it to me and I put it in my game. On ...
2
votes
1answer
285 views

LibGDX collision detection on moving and rotating object (rectangle enemy) [closed]

i am trying to get collision dectection working properly but when i do it, the collision area keeps moving. no matter what i tried. there are 2 objects and the objects are moving and i cannot get the ...
-2
votes
1answer
113 views

How does the minecraft main menu play a “movie” [closed]

I've been wondering for a while, and been doing a lot of research on the subject: how does the main menu in minecraft play a "video". As far as i can tell, it's not a .gif, it appears to be a movie. ...