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
171 views

problem adding bumpmap to textured gluSphere in JOGL

I currently have one texture on a gluSphere that represents the Earth being displayed perfectly, but having trouble figuring out how to implement a bumpmap as well. The bumpmap resides in ...
0
votes
1answer
22 views

How do I create a scalable Slick2D game?

I'm trying to make my Slick2D game maximizable and minizable. This code is the most relevant my searching has turned up. What is it? How should I implement it or use it? (I read the web but I didnt ...
0
votes
1answer
124 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = ...
0
votes
1answer
47 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
2answers
59 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
-1
votes
0answers
16 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 ...
2
votes
2answers
153 views

Expandable 2d environment by spawning and controlling individual tiles

what is the best way to implement an environment that is "expandable" in every direction so that when the player moves in any direction a new row or column of tiles that can be manipulated ...
0
votes
0answers
51 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
21 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
22 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
30 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
20 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
22 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
17 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 ...
0
votes
2answers
192 views

In regards to applet games and UDP [on hold]

I've got about a year in Java experience, and would like to set up a server and client for an applet game. However, there doesn't appear to be any tutorials out there on anything like I want to use. ...
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 ...
-1
votes
0answers
49 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
2answers
228 views

LWJGL texture bleeding fix won't work

I tried a lot of things to fix texture bleeding, but nothing works. I don't want to add a transparent border around my textures, because I already got too many and it would take too much time and I ...
1
vote
1answer
106 views

Random lines away from images in java2d opengl game

Working on a java game that uses some pngs images for icons/textures. A few images ( fewer than 5, out of dozens ) are showing some odd parallel "artifact" lines. They move with the image, are ...
1
vote
1answer
256 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
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){ ...
0
votes
1answer
32 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
231 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
42 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
277 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
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
16 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
41 views

Java game 2d rectangle collision [closed]

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
46 views

Simple way to add Gamestates and menus to a game [closed]

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
43 views

Best book for java game dev.? [closed]

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 [closed]

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 [closed]

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
143 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
32 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
2answers
137 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
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 ...
-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
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
48 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
186 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
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 :( ...
0
votes
1answer
127 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
657 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 ...