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

Is there any caution to take when coding a game in JAVA? [closed]

Are there any properties of JAVA that I should watch out for when coding a game? I've heard that some parts of JAVA can be resource-intensive, like when JAVA handles garbage collection
1
vote
5answers
100 views

Checking game objective status in efficient way on each update call

I am creating a 2d mobile game where there are three levels. Each level has 20 objectives. This can increase in the future. Examples: Level 1 Current Objective: 2/20 Objective : Collect 1000 coins ...
1
vote
1answer
35 views

Removing the titlebar while using slick2d?

I recently started using slick2D in my gaming programs and a problem I have is not having the ability to remove the border/titlebar. I usually do this to create my own cutom look/ interface but if I ...
-1
votes
0answers
26 views

Opengl Loading .PLY File

I'm loading a .ply file exported from blender into my program. The model's vertices are displayed correctly, and I THINK the normals are correct, however the colors are slightly off. This is what the ...
-1
votes
0answers
49 views

move camera 2d java game

I am having some problem moving stuff on map. Before I had, where camera or screen stay same and player moves on it and it worked fine but I want to change it so that player stay still and camera or ...
3
votes
2answers
51 views

How To Correctly Extend the Sprite Class in LibGDX

I am currently pursuing game development as a hobby, and have run into what seems to be a conflict in my mind regarding how to properly (using best practices) extend the Sprite class in LibGDX (or for ...
0
votes
1answer
83 views

Problem with enum as game state

In the current game I'm building, I'm having trouble moving from one game state to another. I'm using enum to control my states. As of now, this is my enum: public static enum State { M_MENU, ...
2
votes
1answer
73 views

Smoother controls

I am trying to move my background left if the user hits the right key. and right if the user hits the left key, so that it will look like the player is moving. The problem is that whenever I hold the ...
4
votes
2answers
88 views

Inventory Grid Detection

I'm working on creating an inventory system for a game. The inventory system will use cells and 2D images to represent items, like Minecraft, Diablo, or WoW. I've hit a bit of a snag when trying to ...
0
votes
0answers
41 views

Removing image background color?

I have a sprite sheet (image) and I want to draw it on the screen. image = sprite sheet image x = player x position y = player y position width = player width height = player height public class ...
-6
votes
2answers
89 views

Moving a sprite diagonal?

I wonder how I should increase and decrease the value of xPos and yPos to be able to move a sprite object diagonal and in different angles? canvas.drawBitmap(image, xPos - (image.getWidth() / 2), ...
0
votes
2answers
57 views

LWJGL Game crashes on some other machines [closed]

I just tried running my game on a friend's laptop, but for some reason it crashes. The exported .jar runs fine on my machine, and some others too. I can see that is has something to do with the ...
-3
votes
0answers
67 views

Why does my collision detection code not work? [closed]

I am using java to create a simple android brick breaker app. I am having trouble implementing the collision detection function between the ball and the bat/bricks. public Collision hitBy( ...
0
votes
1answer
68 views

Android activities, when to use them?

I'm getting back into programming my game and I can see that I've used activities for so many things. I only have one with a custom-view (my actual game), the others are activities with XML-views, ...
-1
votes
0answers
30 views

Camera for a minimap in Slick2d

I've generated a map grid, and I want to place it in the top of the screen and have the camera follow whicherver tile on the grid is selected. I've tried the solution of making a viewport and ...
2
votes
1answer
71 views

2D Software Lighting Issues in Java

I'm creating a 2D top-down tiled game in pure Java and by now I'm trying to implement a way to do lighting. First, some details on how I render: there is a screen class which handles all the ...
-3
votes
0answers
62 views

Animating in Swing? [closed]

I am trying to make a Sprite move across a background image in swing, but every time I update the position and it repaints, it repaints with the previous position of the image as well. However I am ...
-1
votes
0answers
54 views

Text File Map Editor [closed]

I have a map that is in the following format: 5 5 01 01 01 01 01 02 02 02 02 02 01 01 01 01 01 02 02 02 02 02 01 01 01 01 01 This renders as 5x5 with rows of tile 01 and tile 02. Is there a program ...
1
vote
3answers
94 views

First Person Shooter vertical mouse aim

I've just started writing a 3D First Person Shooter in Java, and I'm having a bit of trouble with tracking the mouse movements and moving the camera accordingly. I'm implementing typical FPS movement, ...
8
votes
2answers
320 views

Random Zelda-style map generation

Im trying to randomly generate a map of rooms connected by doors, and I've succeeded in generating one using this code: public void generate(GameContainer gc) { rooms = new ...
-2
votes
1answer
124 views

Will this Entity Code work? [closed]

How do you create 2D entities? Here is something i tried to write up as a base for entities but is this usable and is entites like this?: public abstract class Entity { int attackRange; // ...
2
votes
0answers
114 views

Detecting collision between ball (circle) and brick(rectangle)?

Ok so this is for a small uni project. My lecturer provided me with a framework for a simple brickbreaker game. I am currently trying to overcome to problem of detecting a collision between the two ...
-4
votes
1answer
43 views

Words matching system [closed]

There is a game called 94seconds and i'm interested in how they made words matching. I've decompiled apk and saw mongoDB and BSON classes and apparently they are used to store dictionaries for ...
-1
votes
1answer
39 views

Required Throwable found SlickException when initializing states

When I write this statment throws a SlickException. I got an error and this is the message: required Throwable found SlickException. This my code : public void initStatesList(GameContainer gc) ...
-4
votes
0answers
54 views

Exploding, and breaking bodies in Box2d/LibGDX

I have a top down game in which a player is moving forward, and box2d bodies spawn in front of the player. Once a player hits the bodies, I intend to exaggerate normal physics a bit, and if the body ...
-1
votes
1answer
49 views

Creating a BufferedImage with several smaller images?

I am making a 2D tile based game. The tiles render fine from a spritesheet and a text file. However, I am using a for loop to draw the map to the screen. When it refreshes, it slows down the loop, and ...
-1
votes
0answers
81 views

Walking and orbiting bodies around a planet

I'm new in game developing and I was wondering if you could help me with an idea that I have in mind for a 2D game. The game consists on a character walking around a planet and several enemies ...
3
votes
1answer
49 views

LWJGL Eclipse Resource Deployment

I'm still experimenting with some OpenGL in LWJGL, and as I get to know more and more about OpenGL, I start to do more complicated things like multi texturing, shadowmapping and more. Now, right now ...
1
vote
2answers
86 views

Moving Sprite With Physics Frame

Normally, a physics frame in pink (see image below) gives the body for detecting hit signal. It usually either falls down or lifts up depending on the gravity orientation. The question is: Is it ...
5
votes
2answers
145 views

Is it legal to pack LibGdx libraries in my jar file? And to obfuscate them?

I'm using LibGDX and deploying a runnable jar file, using the Eclipse feature, with libraries extracted into it. There are also .so files and .dlls inside. 1 . Is it legal to do so? I didn't find ...
-3
votes
0answers
41 views

FBX file format related books [closed]

I just wonder if anybody knows of good books that would cover how to work with FBX file format, in either c++, C# or java. Thanks.
-2
votes
0answers
40 views

Have object follow a predefined path [duplicate]

I found this Traffic Simulator, and was wondering how does the person who made that get the cars to go around the bend? I have been looking through the source code but can not find it. Does anyone ...
1
vote
1answer
168 views

How to render a tilemap efficiently? [duplicate]

I'm using this code to load a tiled map, composed of 1000x1000 32x32px tiles: map = new TmxMapLoader().load("levels/xyz.tmx"); camera = new OrthographicCamera(); camera.setToOrtho(false, ...
-3
votes
0answers
44 views

Layout of poker game in android? [closed]

its a run time game and i use the eclipse and presently its a two deal game. But i did not fix his layout. Which layout is better to use that game?
0
votes
0answers
43 views

How to get ARGB value of pixel from loaded image?

I want to scan GIF image and check every pixel. If pixel isn't transparent I want to add it to array of Points2D (point will have the same x and y as pixel. That's because I need coordinates, not ...
-4
votes
0answers
98 views

Looking to move from web design to game development [closed]

i have been building websites for about 5 years now, so i am fairly well skilled in html, javascript, php, perl, css etc... However i am now looking to go into game development and start learning it ...
0
votes
1answer
63 views

Tile Maps in Java JFrame Game

I am making a 2D Java game with Java's own drawing library. I was wondering how I would make a tile map display on the screen. I would prefer to use a GUI application to make the maps. I'm looking for ...
0
votes
1answer
52 views

Is there a way to make a game using lwjgl work on android?

I'm working on a platformer and I'd like to make an android version. Do I need to rewrite everything for android, or can I use something to make the lwjgl code work with android?
0
votes
1answer
34 views

Merging InputProcessor and GestureDetector

I'm planning to make a simple soccerball app. When I attempt to drag the ball, I use the touchDragged() from InputProcessor to move the ball left or right. Next, while holding before releasing, I use ...
1
vote
1answer
93 views

Simulating building stress

I need to simulate the effects of adding supporting materials to a building structure for a genetic algorithm in a block-based world. Essentially I am planning to use a genetic algorithm to optimise ...
0
votes
1answer
107 views

How to implement bullet physics in libgdx

I am new at game development want to know that how can I implement bullet physics in libgdx. I searched lot of things on Internet but nothing found worthy.
2
votes
3answers
191 views

What are the benefits of using a 2D game engine on Android?

I have thought about just coding a 2D game on Android using just pure Java and the Android SDK, no engines like libdgx, cocoa-2dx attached. I don't know if I really need to use a game engine or not. ...
-1
votes
2answers
80 views

Tile Based Collision Checking In Java?

I have my map stored in 2 arrays: Tiles : Tile names TileTypes : SOLID or BASIC I want to be able to walk through BASIC Tiles (Like ground tiles). But not the SOLID Tiles (Like wall tiles). I ...
-2
votes
0answers
70 views

adding a camera to a game. how? [closed]

I would like to add a camera that will show the off-screen area of my game when the ball passes near to the edge of the screen. I am new to java and would like to know what coding I would need to do ...
0
votes
1answer
42 views

JFrame launcher stays open when I'm finished with it

I have written a launcher that prompts the user for their name then starts the game when they hit enter. The launcher looks like this: But when the user hits enter, this happens: The launcher stays ...
3
votes
1answer
95 views

Cut a translucent square in a texture

How to remove (cut-out) a transparent rectangle in a Texture, so that the hole will be translucent. On Android I would use the Xfermodes approach: ...
0
votes
1answer
39 views

Pick and Drop the Ball Testing Without Replicating the Physics Frame

I am making a program that pick, drag, and drop the ball. In real life, once you pick the ball and drop it, whenever the available object is (what you see is what you get) will only be picked and ...
4
votes
0answers
98 views

Structuring server-side networking with entity-component systems

I've been working on an online game, and recently have been working on converting the base of the game to use the Artemis Entity System Framework. I'm having a bit of difficulty conceptualizing ...
0
votes
1answer
115 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 ...
6
votes
1answer
117 views

How to force a line break before the last word of a line reach the edge?

I'm printing a sliding text by adding each letter after a short period of time. My problem is that when the text multilines, the last word of a line starts on the current line and jumps to the next ...

1 2 3 4 5 19