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
22 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
6 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
27 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
29 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 ...
-1
votes
0answers
32 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
33 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
47 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
34 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
24 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
33 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
35 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
26 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
0answers
49 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
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
2answers
124 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
12 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
43 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
49 views

Smooth input handling in Java [on hold]

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
54 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
33 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
79 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 ...
-1
votes
1answer
55 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 ...
0
votes
1answer
28 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
42 views

Secure Login with Login Server [on hold]

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
57 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
44 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 ...
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 // ...
-1
votes
1answer
43 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 ...
0
votes
0answers
43 views

perlin noise 2D tile map [closed]

How would I make perlin noise, and how would I use it to make a tile map? I want to be able to generate tiles for nearly anywhere the user would wish to go. I don't want to just use a random number ...
-1
votes
0answers
33 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
0answers
58 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 ...
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 ...
-3
votes
0answers
22 views

how to set bound collisions of a rectangle in java [closed]

i have this class with an image with a method called getbounds() that returns a rectangle. the player class has the same method. the collision works but i how do i keep the player bounds less than the ...
0
votes
1answer
29 views

How to use an array to load multiple images in java [closed]

i made this minecraft 2d like game with a class named blocks that hole an image of a dirt block. in my JPanel class it is drawn one at a time to form multiple blocks with thier collsiions. how do i ...
0
votes
0answers
9 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
11 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
19 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
51 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
44 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) { ...
1
vote
1answer
50 views

How to poll input for a gui in libgdx?

Ok, so my question is simple. How do you poll input with a GUI class without it affecting what's underneath the GUI? So suppose you have an RPG game with a gui for the d-pad and other controls: ...
0
votes
1answer
67 views

Why doesn't my animation stop when I press a key?

I wrote a program that animates two squares diagonally across the screen, from opposite sides. Used Timer object to do so. The squares collide with each other and also with the frame boundary to ...
0
votes
1answer
50 views

libgdx: Rotate sprite on 3d plane

Im trying to create a game on a 3d plane but with 2d objects. I have a perspective camera and the ground plane drawn. I can't seem to get sprites onto it. I am trying to render the sprites, then to ...
0
votes
0answers
69 views

Moving objects smoothly, bad perfomance

I just finished developing my mini-game on Android and I got some questions about perfomance and generally "how to": If I have 25+ objects on the creeen (just a polygon with 7-8 angles) its starts to ...
0
votes
1answer
68 views

Getting the Ray position from View and Projection Matrix

I'm having some trouble calculating the direction and position of the ray from my matrices. I have tried some things such as: private Vec3 getPick(Mat4 projection, Mat4 view) { Mat4 ...
0
votes
2answers
59 views

How to get all points within a box?

What is the fastest way to get all of the points within a bounding box? If I had an ArrayList<Point>, and they weren't mapped to coordinates, would I have to loop through every point to see if ...
0
votes
1answer
59 views

How to clear out a drawn texture from the screen in libGDX

I am trying to clear out the drawn texture from the screen. Lets take a classic game example - in many games when the character goes through the coins the coins clears out from the screen and ...
0
votes
0answers
27 views

2D Collision in JavaFX - Bad accuracy with .intersects()

I have several Shape objects - Circle, Rectangle and Polygon. I use the built-in .intersects(Bounds1, Bounds2) method to detect collision but it's quite inaccurate. Circle c1 = new Circle(20); ...