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
0answers
39 views

Lateral Friction Phisics

I am trying to create a physics engine for my game, and need to cancel out any lateral velocity for when entities turn. I have tried to mimic this page's example, but it is not working. I have objects ...
0
votes
2answers
81 views

Algorithmic error in tile engine? [closed]

I'm toying with creating a tile-based 2D java game engine. I can render the "local" area without issues(I.E. deciding which local tiles to render). The problem came when I introduced floating point ...
0
votes
0answers
45 views

Sound Effect Delay occurs when game is deployed with GWT backend?

I've been posting my games on to my personal website recently and I noticed a slight hiccups with the LibGDX games I've made. Within the first few seconds following the loading of the game, there is a ...
-2
votes
1answer
50 views

What do the 6 points stand for in Polygon().getPoints().setAll?

I have the following code to create a polygon: Polygon poly = new Polygon(); poly.getPoints().setAll(14d, 17d, 26d, 17d, 20d, 27d); // What do these mean? What do these 6 points stand for?
0
votes
3answers
72 views

Getting entity type object [closed]

I have a custom entity class and what it does is create a SQUARE object. public class Entity { Rectangle rect; public Entity() { this.rect = new Rectangle(20,20); rect.relocate(200,200); ...
1
vote
1answer
64 views

Get Tile Location On Screen (Java Slick and Tiled2D)

I want to create a rectangle around each tile that's blocked value = true. How can I find the X and Y (on screen) coords of the each individual Tile?
-3
votes
1answer
85 views

How do you divide the screen into tiles? [closed]

I have been reading alot on tile-based game programming but i could not find a satisfying answer to this question. I want to know how i can divide the screen into tiles of a size like 32? I am doing ...
1
vote
1answer
218 views

3d Water Simulation formula questions

I have created a Grid: At each point along the grid, is a vertex (Intersection Points): Each of these points has an x,y,z position. Vector3f(x,y,z). In an attempt to animate the grid into a group ...
1
vote
2answers
78 views

What caused rotation in exported blender model to jMonkey? (OGRE)

First off, I am very new to jMonkeyEngine 3 and still learning. Not exactly sure what could be causing my snowman to have already been rotated before import. I created him in blender and it was facing ...
5
votes
2answers
364 views

How does this formula for generating water waves work?

I have been trying to implement the wave equation described in this paper ("Water Simulating in Computer Graphics," Kai Li and Liming Wu) in Java. Part of the paper discusses modeling waves as a sum ...
2
votes
1answer
140 views

Libgdx - Collision position - Box2D

I'm actually developping my own game but i'm facing a little problem. I trying to figured out how to get the position of a fixture (collision) between two entities. For example this : ...
2
votes
0answers
52 views

How should I model rotation caused by bounce friction? [duplicate]

In my Java2D simulation, I have a disc which, when it bounces off the boundary of a 2D region, begins to rotate, as if it had gotten some spin from the wall. I'm having trouble relating the ...
-1
votes
1answer
95 views

java tile based game :tile lag fix

hi I have a game where it reads a txt file and loads a map 0 represents air and 2 represents dirt I have a class for each tile as well as a tilemap I will show u my code. the problem is it lags like ...
-1
votes
1answer
74 views

Grid based Collision Detection between circles [duplicate]

I am working on a 2d arcade game where I have 5 types of circles with different sizes: The ship, the missiles, and 3 types of monsters. This is what it looks like: Currently I'm using brute force ...
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 ...
0
votes
0answers
47 views

Space invaders 2d array to represent scene [duplicate]

For code optimization purposes, I want to create a 2d array that contains 40 equal squares (10x10px). Each square represents 1\40 of the displayed window (400x400px). I populate the 2d array with the ...
1
vote
2answers
138 views

Game Design: Faction/Player circular relationship

For a Java game, say I have two classes: Player, representing a player in the game. Faction, representing a faction of players in the game. When the game starts up, all factions are loaded into some ...
11
votes
2answers
756 views

How do I create a World Healing Wave effect?

I want to change my dark and depressing background to a happy grassy background, in real-time, such that the happy background is shown in a radius around a game character. A forcefield of happiness, ...
0
votes
0answers
57 views

Window resizing doesn't work correctly

im currently having issues on resizing my game. It's a 2d Game and I want resizing to look a little(or exactly) like this: Original size: Smaller window size: My resizing function currently ...
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 ...
4
votes
1answer
228 views

unable to launch LibGDX Particle Editor.jnlp

I am not able to launch LibGDX ParticleEditor.jnlp file on my system(win7 64 bit) with java7. when I execute this file with javaws.exe in jre7/bin folder, it displays splash screen of badlogic games ...
0
votes
0answers
23 views

Make QueryAABB touch in the center of a body to respond

I am allowing the user to drag their fingers to select bodies. The bodies are then added to a array list to be removed later. The problem is, i would like the users finger to have to cross the middle ...
0
votes
1answer
103 views

Game states vs calling new activities

I am trying to decide what the best method is to call "level complete-screen" and "game over-screen" in my real-time android 2d game. Currently I am using game-states and only updating my game when ...
2
votes
1answer
83 views

Invert Alpha on Image

I'm making a lighting system right now, and the last part I have to do is to invert the alpha channel on the final light map. My previous code that used to work was DataBufferByte buf = ...
-1
votes
1answer
95 views

How to swap the position of two sprites? [closed]

I'm making a game like Candy Crush with Cocos2D in Android. I've made the sprites but I want to swap to sprites by touch . How to swap the position of two sprites?
0
votes
2answers
83 views

How do I show a Quit button on Desktop but don't show it on Android with libgdx?

So I would like to display a Quit button on the Desktop main menu screen, but I wouldn't want to have it on Android too. What is the correct approach to achieve this? Do I have to check the ...
0
votes
0answers
57 views

Adding Sprite in 3d scene?

I want to add sprite in 3d, with object load with .g3db, I read some of topics here how can I use, but there is problem batch.begin(); Gdx.gl.glEnable(GL10.GL_BLEND); ...
2
votes
2answers
76 views

Why aren't resources such as Pixmap disposed on finalization in LibGDX?

I've been looking at the LibGDX framework, and certain classes such as Pixmap require to be disposed manually when you are no longer using them (call the dispose method). I'm wondering, since this is ...
0
votes
1answer
56 views

Universal Tween Engine: are accessor hierarchies possible?

Background: I'm using Universal Tween Engine, which allows generic accessors to be implemented to permit tweening of arbitrary atttributes. I have a hierarchy of game entity classes that share a ...
2
votes
1answer
60 views

How can I extract the Geometry from a j3o file?

I created a blender file and then converted it into the j3o file. The only way to load the 3d structure in the game is through a Spacial object: Spatial towerModel = ...
0
votes
2answers
253 views

GameServer UDP or TCP Java [closed]

This is a Java related question. I've got this question and I searched on the internet but didn't really get any clear answer. I want to develop a little multyplayer game which needs real time ...
1
vote
1answer
319 views

Using Unity 3D in LibGDX

Is it possible to use Unity 3D engine with LibGDX when making Android game apps? Is it also possibly used for making 2D games using Unity 3D and LibGDX? I would like to know if it's possibly ...
1
vote
0answers
52 views

Does anyone know a good knockback algorithm? [closed]

I was just wondering if someone had a good knock back algorithm for a top down shooter game. I was hoping for not as much as a knock back but more of a push. that would be great.
0
votes
1answer
209 views

Android local multiplayer

I am working on a FPS game for Android and I want to make a support for local multiplayer with no additional devices or server required. One of the player's devices would serve as a server, getting ...
1
vote
1answer
108 views

How can I kill a libGDX AsyncTask immediately?

Is there any way of killing a running AsyncTask immediately in libGDX? The AsyncExecutor that submits it seems to just have one method (dispose()) that kills all the AsyncTasks that it handles after ...
0
votes
2answers
160 views

AndEngine - Smooth scaling on a sprite

I'm trying to implement a pinch zoom on a sprite. I would like to get an effect like the SmoothCamera, but on a single sprite. I've managed to pinch zoom on the sprite by changing its scale, but the ...
0
votes
0answers
53 views

Getting nearby entities with flixel-gdx

What's the easiest (while at least somewhat efficient) way to get FlxObjects within a certain range of a point or other FlxObject? e.g. I'm a monster NPC, are there any units within range I should ...
0
votes
1answer
109 views

Switching screens in a game

I am working on a simple 2D game in Java. I want the game to have an opening screen, instructions screen, and the screen with the game itself. From the opening screen the user presses buttons to get ...
0
votes
1answer
180 views

Java High-Resolution Timer for a simple game

I want to work on a model of some kind of simple shape shooter game I would develop for either the desktop or the Android, using the libGDX library. There's something I want to incorporate into the ...
2
votes
1answer
166 views

Match-3 algorithm to fill empty space left from removing matches

I am currently creating a match 3 game. I am at the point where I have objects dropping down in the column when only one item is removed. So if an item is removed, the above item moves into its old ...
1
vote
1answer
119 views

How can I drag a polygon based on a mouse-moved event?

I have drawn a polygon in Java using java.awt.Polygon. I want to move that polygon with the mouse (by dragging it). I know that I have to use mouseDragged method in addMouseMotionListener. That way I ...
1
vote
2answers
151 views

How can I move an object towards another along a straight line

How can I move an object (like a cube) towards another object? Let's say that we have a red cube in the center of a floor, and a blue cube in another location, there aren't objects between this two, ...
0
votes
1answer
49 views

How can I create a cross-fade between two quads?

I have two quads, and I would like to have each one of them on the screen for 5 seconds, then fade to the next one. How could this be done? My code: package net.makerimages.Unacrawl.stateSys; ...
2
votes
3answers
324 views

How would you draw a tile map with in perspective?

I want the maps in the game I'm working (in Java) to be draw with perspective just to sugar coat it, but I'm not sure how that can be done. If anyone has an article about the math behind it or ...
1
vote
1answer
87 views

need help in implementing KeyListener for 2D game in Java

i stated coding my first game in java, i need some help in imlementing KeyListener to fit my game. after some search in tutorials i've imlemented it like this : frame.addKeyListener(new KeyAdapter(){ ...
-1
votes
2answers
101 views

Java Tilemap Collision

I have tilemaps represented by values from 0 to 4. How can I make the player collide with tiles represented by 3 and stop the player from passing through it ? Here is my code for the player and ...
0
votes
2answers
165 views

Using System Time to compute delay times that correctly deal with app pauses?

In my Android app I have the requirement to introduce small (for slowing down animation) and larger delays (for the purpose of delaying the appearance of a character for example). I've experimented ...
0
votes
0answers
169 views

How can I get the entity a player is looking at in a Bukkit plugin?

I'm creating a wizardry plugin for Minecraft, and I was wondering how you would get the entity that a player was looking at, I know that you would have to use a Vector, but I really am not familiar ...
0
votes
1answer
136 views

How can I draw a single line using JMonkeyEngine?

I need draw a line between two boxes using their respective positions. I've created the Line object but I don't know how to show it in the scene. Line ray = new Line(box1.getLocalTranslation(), ...
0
votes
2answers
69 views

How can i Randomize Unique Numbers in Java [duplicate]

So i'm making a game where i have to randomize 52 numbers from 1 to 52 so the order has to change i use this class Deck { Random r = new Random(); int[] Card = new int[52]; }