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

0
votes
1answer
12 views

LWJGL Resize window and glTranslate breaking screen resolution

I'm trying to make a 2D Tile RPG game with LWJGL but I'm having a problem with the display resizing. I want the user to be able to re-size the window to whatever size they want just by expanding it ...
1
vote
1answer
249 views

How do I detect a tile map collision's direction?

I'm implementing collision detection with the map for my platformer. I have a method that generates a polygon on every tile and checks if the player hits it -- that's all fine. The problem is that ...
0
votes
2answers
34 views

Negamax Checkers not working properly

I'm trying to implement negamax in my checkers game. Sometimes the IA does the appropriate move, sometimes don't. Here is my code: private int evalPawns(ArrayList<Pawn> pawns, int turn){ ...
0
votes
1answer
24 views

How do I combine two textures / texture regions / images into a single entity using libgdx?

I've googled this but can't seem to find anything on "concatenating" two images, especially using libgdx. Any ideas? (pointers, algorithm suggestions, etc are highly appreciated) Thanks.
0
votes
1answer
229 views

LWJGL font not rendering, even with depth test and texture_2D

I'm running into an odd little problem here. I'm attempting to render a basic console over my LWJGL-based application, which should be easy enough through a decorator pattern of renderers (as in, one ...
0
votes
1answer
3k views

How To Scale Canvas In Android

I am writing a android game using Canvas as the way to draw everything, the problem is that when i run it on different android phones the canvas dosn't change size i tried using canvas.scale() but ...
0
votes
0answers
37 views

Simple Libgdx bullet example

I'm looking for a SIMPLE example of the use of the bullet physics engine in libgdx. Before you point me at the wiki, I have read that, but that mostly describes installation, and just a "raw" ...
0
votes
1answer
88 views

How do I limit the number of tiles being rendered?

I have a game like GTA that is a top down game. I have a txt file with a load of numbers representing tiles. When you walk around the 50 x 50 map tiles start to flicker (disappear and reappear in a ...
0
votes
1answer
266 views

How to update libgdx scene2d Label text dynamically?

I display a BitmapFont on the screen, update its text and the font is updated dynamically on the screen as well. I seem to fail to do the same with a scene2d Label added as actor to a Stage. The ...
-1
votes
0answers
26 views

Good resources for spritesheets [duplicate]

I did use the shy guy kingdom and opengameart.com but I want one that's a little more up to date. I'm not the best digital artist unless I use a stylist. Also point me out to some basic sprite ...
0
votes
0answers
12 views

Incorrect click event when resize on libGdx

I want to use scene2D, in libGDX, to detect click on object. I have this simple Game sample : Stage stage; @Override public void create() { this.stage = new Stage(1280, 720, true); ...
-1
votes
0answers
34 views

How to make a basic exp system [duplicate]

I'm using java and planning out a game i'll work on. Before I start coding, how would I add so the user gets a reasonable amount of exp each level so I don't have to have a max level.(I might ...
0
votes
0answers
38 views

Java game 2d rectangle collision [on hold]

I've been working on a school-project and I've been working quite hard. The thing is, the collision detection I've been trying does not. :( I am doing all the rendering rendering with ...
0
votes
0answers
34 views

Simple way to add Gamestates and menus to a game [on hold]

I'm using java which is the only mastered language I know(c# a little). I've copied someone on YouTube's code but it doesn't make much sense. I know everyone codes differently but how would I add one ...
-2
votes
0answers
38 views

Best book for java game dev.? [on hold]

I know killer game programing in java is popular and helpful and seems too advanced for me. If it is most recommended I will read a java book that leads to it. I have beginning java game programming ...
0
votes
1answer
39 views

Player doesn't jumps in Box2D implementation [on hold]

Well, i'm trying to learn andEngine. I was able to successfully implement the move functionality for the player. Now, i'm trying to make the player jump using Box2D. I referred few online tutorials to ...
-1
votes
0answers
49 views

AI for enemy in 2d game [on hold]

I need an AI algorithm for enemy in 2d game for aiming at player and shooting. This is a j2me game. The enemy first comes from top and waits few seconds and then moves to left and then goes to ...
1
vote
0answers
142 views

How do I implement a “sliding out of / into” effect on a settings menu similar to that in Angry Birds?

I'm trying to implement a settings menu component similar to that in Angry Birds - a button control that makes an options menu slide out of it and back into it when clicked on. I use scene2d.ui to ...
0
votes
0answers
26 views

Good site to begin learning Game Dev. in Java [on hold]

I have a basic understanding in java which I should review, and am confused on the different ways people program in youtube videos. can someone point me where to start properly, yet a bit advanced. ...
0
votes
1answer
40 views

JBullet - Detecting when 2 objects collide?

How can I detect when 2 collision objects collide with JBullet? Currently, all body types are going to be of type RigidBody. I have quite literally been trying to find the answer of this for over 2 ...
0
votes
2answers
133 views

Do Java and Actionscript use OpenGL?

As far as I know there are only 3 base graphics libraries on Windows, the GDI, OpenGL and DirectX, is that correct, so that means that Java, Actionscript and all language use one of these 3 libraries ...
2
votes
1answer
206 views

Transforms in Box2D

I'm attempting to implement a camera in my game. I had it working for regular objects, but I began using Box2D and obviously things changed a bit. I have a Body object that I want to draw at the ...
0
votes
1answer
27 views

Slick2D: Animation not being parsed from spritesheet correctly

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so: spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192); ...
0
votes
0answers
37 views

Playing repeated sound in Java

I'm trying to play sounds in a Java game with the following code: AudioStream audioStream = new AudioStream(stream); AudioPlayer.player.start(audioStream); The stream variable is just an ...
0
votes
0answers
32 views

Using multiple uniform blocks in OpenGL

I'm using OpenGL with JOGL and want to use two unfirorm blocks in my vertex and pixel shaders. The following GLSL-Code shows the definitions:- uniform perObject { Material uMaterial; mat4 ...
-1
votes
0answers
26 views

Behavior for a line with different angels [on hold]

hi i need a cod for make a Behavior for a line with different angels . i mean for android if a user draw a Horizontal line on screen , device save the angle and put a Behavior for it if user draw a ...
0
votes
0answers
14 views

GWT problem with Box2D WheelJoint

I am using the below libgdx java code for a wheel joint and rear axle using Box2D. This works fine for android, Desktop, but when I attempt to run through GWT I get the following error. at ...
0
votes
1answer
44 views

OpenGL ES 2 jittery camera movement

First of all, I am aware that there's no camera in OpenGL (ES 2), but from my understanding proper manipulation of the projection matrix can simulate the concept of a camera. What I'm trying to do ...
0
votes
1answer
184 views

Java Slick2D - Problem using ScalableGame class

I am having a problem adjusting the size of the screen while using the ScalableGame class from the Slick2D library. I would like the background and objects (images and graphic shapes) to adjust to ...
0
votes
2answers
132 views

Can I use multiple OpenGL version together

I want to use GLSL but keep my current OpenGL 1.1 setup. The thing is that can I use OpenGL 2.0 shaders on OpenGL 1.1 renders?
0
votes
2answers
53 views

Smooth input handling in Java [closed]

I am writing a Java game. My problem is to get a really smooth input. If I hit the key W the character has to go forwards, but if I hit A and release the W key, the character doesn't go left ways :( ...
0
votes
1answer
126 views

Java 2D World question

I have a 2D world background made up of a Grid of graphics, which I display on screen with a viewport (800x600) and it all works. My question is I have the following code to convert the mouse ...
0
votes
2answers
655 views

LibGDX Perspective Camera for 2D

I'm very new to LibGDX and I'm trying to use DecalBatch with PerspectiveCamera, simply to have z-coordinate for my sprites, as SpriteBatch does not offer that. However, I don't know how to calculate ...
3
votes
1answer
61 views

LibGDX How to take screenshot and use as background for pause screen

So I am trying to take a screenshot of the current situation during the PlayState of the game and when the player pauses the game I want the game to take a "screenshot" save it in memory and not as a ...
-1
votes
1answer
35 views

Slick2D: Resizing the Window

I am using Slick2D, and I wanted to know which is the best way to resize, maximize, minimize the window, For example, Resizing all the images or scaling them, or Slick2D has an integrated method, Any ...
0
votes
1answer
343 views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
0
votes
1answer
73 views

Grid collision - finding the location of an entity in each box

I am trying to implement grid-based collision in a 2d game with moving circles. The canvas is 400x400 pixels. Below you can see the code for my Grid class. What I want it to do is check inside which ...
0
votes
1answer
81 views

How can I determine which square in my memory game was pressed?

I want to develop an simple memory game on Android. The memory game have squares like the picture below. How should I determine which of the square is pressed? Should I use image buttons? Personally ...
0
votes
1answer
30 views

Libgdx stage rendering issues

I'm using scene2d for the first time, and I can't get anything to draw EXCEPT the stage ui. Say I have my ui on top of my game screen: uiStage.act(): batch.begin(); gameSprite.draw(batch); //does not ...
-1
votes
1answer
56 views

Objects vs. relational tables [closed]

I'm developing a browsergame that consists mainly of units capable to fight each other. Around this, there are of course different players, alliances etc. like you would expect from an Ogame clone. I ...
1
vote
2answers
912 views

Drawing Lines on android with matrix

Can a matrix be used when drawing lines and paths on android? the DrawBitmap mathod takes a matrix as argument, I cannot find anything similar when drawing lines.
0
votes
0answers
44 views

Secure Login with Login Server [closed]

I'm programming a multiplayer game for mobile phones.I'm working on a distributed server architecture for handling lots of concurrent players. Here is my architecture on my mind: So my question is: ...
2
votes
1answer
47 views

How do I split a texture into differently shaped pieces with libgdx?

I want to split a texture into variously shaped pieces with libgdx, like the pieces of a puzzle game. TextureRegion.split() is not an option, as it splits into equally sized rectangular texture ...
10
votes
1answer
7k views

Making a HUD/GUI with OpenGL (LWJGL)

I'm at the stage in my game development where I need to make a HUD or GUI. I've never gotten to this part, so I don't know how its done. I tried rendering a simple quad at a fixed position on the ...
0
votes
1answer
58 views

Java Game Gravity Collision Detection Working Incorrectly

I have searched for this question but was unable to turn up any results - I am making a Java platform game (I have created many top-down games, but nothing with gravity like a platformer) and I have ...
2
votes
1answer
133 views

How to have the game world get rendered on just a part of the screen?

I am implementing a game on both Desktop and Android. The Desktop version will just rely on the keyboard to handle the user input on the game screen, whilst the Android one will have to have a set ...
0
votes
0answers
59 views

Slick2D: Rendering Error [closed]

I am new to Slick2D And I am having a nullpointer exception Error with rendering Images. With my code when the key "W" is pressed a whole array of blocks is moved 16 pixels but its throwing a ...
1
vote
2answers
1k views

rotating menu with Actors in libgdx

I am intending to build a circular menu, with menu items equally distributed around the circle. When clicking on a menu item the circle should rotate so that the selected item is facing the top. I am ...
0
votes
0answers
27 views

Java applet - I want to use cookies to save the game. How do? [closed]

This is the code I have now. It doesn't work. It doesn't seem to save any cookies to the browser in the first place. The applet is accessible here: http://pineapplemachine.com/juju/juju.html // ...
0
votes
2answers
52 views

Clamping large content to smaller area

I'm using OpenGL (with LWJGL) in Java, but the question is language independent. I have some region (a rectangle for simplicity), and, let's say, a big tiled map which I want to show in this area. ...