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
votes
0answers
5 views

LWJGL camera rotation is pivoting around original point instead of around where it has been translated (w/ glRotatef)

I've been playing about with LWJGL and I've encountered a problem. When I move the player's camera and then rotate it, it appears to pivot around where the player originally was. How do I make it so ...
0
votes
1answer
27 views

Java: Camera Rendering

Which is the best way to detect whenever an object or tile is inside the Camera Range so I can draw it? With "best" I mean more efficient, and quicker. Thanks
0
votes
0answers
40 views

What is the !== equivalence in Java? [on hold]

I took a Javascript script for my Java project : if (hitTest[eventilex + eventiley * tw] !== 255) { return { x: Math.floor((x + tw) / tw) - 1, y: 2 * (Math.floor((y + th) / th) - ...
0
votes
1answer
17 views

Java APLLICATION : How to play sound

Hello I have a game that has a title menu and I want to play music in the title menu. The game is an application NOT an applet. (and I'm not changing it) I saw a video where he uses sun.audio pckage, ...
1
vote
0answers
17 views

Physics like asteroides

I try to make a ship that has the physic properties like asteroides. I have this for now(All in Java): Ship.class public class Ship { public static final float sMaxHealth = 0.1F; ...
2
votes
1answer
22 views

Saving resource

I'm trying to develope a simple platformer on Java, I was wondering if is it better to handle the collissions in a level (player with floor, player with enemy ecc...) by a level handler class which ...
0
votes
0answers
18 views

Collision in Tiled Map - LibGDX

I have collision code that deals with left or right or top or bottom. I am using Tiled Map with LibGDX. Question is: How do I detect collision with other cells by all 4 sides, and not specifically ...
0
votes
0answers
20 views

How to render graphics in java [on hold]

I'm using thechernoproject's code from youtube and for some reason I cant get a black rectangle to fill the screen in my render method. : package com.thecherno.rain; import java.awt.Canvas; ...
-1
votes
0answers
16 views

build path errors ever since java 8 [on hold]

so I'm working on thechernoproject tutorial on YouTube. I just had a ton of path problems but figured it out on the eclipse website. now when I run it It calls and error for each line of code in the ...
-1
votes
0answers
47 views

Java 8 update ruined my build path [on hold]

Today I finally updated to java 8. It said I had old versions so I let it uninstall them. then my eclipse wasn't working so I knew it was out of date. I uninstalled java 7 from my computer because 8 ...
0
votes
1answer
32 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 ...
0
votes
0answers
41 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
28 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
2answers
44 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){ ...
-1
votes
0answers
28 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
14 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
36 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
45 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
42 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
0answers
39 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 ...
-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 ...
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 ...
0
votes
0answers
30 views

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

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
42 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
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
33 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 ...
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 ...
-1
votes
0answers
27 views

Behavior for a line with different angels [closed]

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
2answers
136 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 ...
0
votes
0answers
16 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
46 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
2answers
55 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 :( ...
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
82 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 ...
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: ...
0
votes
1answer
59 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
49 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 ...
-1
votes
1answer
47 views

Distributed Multiplayer Game Server Architecture [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: Some questions ...
-1
votes
0answers
34 views

LWJGL - Keyboard.next() not firing

I am trying to make a class which will handle all of my inputs, however Keyboard.next() isn't returning true. Here is my code. while(Keyboard.next()) { if(Keyboard.getEventKey() == ...
0
votes
1answer
37 views

How to keep track of previous scenes and return to them in libgdx

I have three scenes: SceneTitle, SceneMenu, SceneLoad. (The difference between the title scene and the menu scene is that the title scene is what you see when you first turn on the game, and the menu ...
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. ...
0
votes
0answers
29 views

Rendering bug in java

I'm using a simple rendering method in java to render tiles. Everything looks fine, but I notice that some rows grow 1 pixel when I move, and dhen shrink back, but I have no idea why. Infos: I'm ...
0
votes
0answers
12 views

Slick util TiledMap stops all other drawing

Im trying to add tile maps to my game. Before I added the tile map, I had 3 quads being drawn for testing purposes, but after adding the tile map, the quads are no longer drawn. private static void ...
0
votes
0answers
12 views

Java2D Swing rendering off center on ONLY OSX

I'm having an odd issue with my animation that is happening only on OSX, and not on windows. On my windows computer, the animation occurs full screen in a JFrame, as it is supposed to - however on my ...
0
votes
0answers
21 views

How do I add an image inside a rectangle or a circle in JavaFX?

Suppose we have a rectangle called r Rectangle r = new Rectangle(40, 20); and an image called image Image image = new Image("...src for image"); How do I fit the image inside the rectangle? ...
0
votes
1answer
55 views

What is the approach of creating an image puzzle game with libgdx

I would like to create a game which consists of taking a random image, slicing it up into some number of pieces (according to a selected difficulty) and letting the player solve the puzzle. I've ...
0
votes
1answer
45 views

Java: Irrelative Simplex Noise [closed]

I am stuck in another problem with Noise(I´ve never did this before). Now Terrain is generating and its quite well but its Irrelative to each other. Here is a screenshot As you might notice Each ...
0
votes
0answers
21 views

How to use the zoom gesture in libgdx?

I found the example code for the GestureListener class, but I don't understand the zoom method: private float initialScale = 1; public boolean zoom (float originalDistance, float currentDistance) { ...