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

5
votes
1answer
2k views

Circle-Rectangle collision in a tile map game

I am making a 2D tile map based putt-putt game. I have collision detection working between the ball and the walls of the map, although when the ball collides at the meeting point between 2 tiles I ...
5
votes
5answers
1k views

How to get more than one window in Java LWJGL

I'm trying to write a game in Java LWJGL. And I need more than one (multiple) display window. By default I've got one display window where I can draw everything. But I'd like to split some data to ...
5
votes
4answers
6k views

2D Platformer Collisions

I've basically asked this question before, and I know it's been asked probably a billion times, but I still can't seem to do it. All I want to know is how I should go about doing basic 4-way, ...
5
votes
2answers
1k views

Java game design question (graphical objects)

I'm beginner in game development, in Java and here on this site too and I have a game design question. Please comment my idea: I have a main loop which call update and draw method. I want to use an ...
5
votes
1answer
307 views

Implementing Vehicles in your game

In the game i am creating as an hobby (learning is the primal goal of it all) i plan to implement a space ship that the player can enter and use to explore it. I tried to search the internet for the ...
5
votes
1answer
1k 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 ...
5
votes
1answer
318 views

Move penetrating OBB out of another OBB to resolve collision

I'm working on collision resolution for my game. I just need a good way to get an object out of another object if it gets stuck. In this case a car. Here is a typical scenario. The red car is in ...
5
votes
1answer
206 views

Should I amortize scripting cost via bytecode analysis or multithreading?

I'm working on a game sort of thing where users can write arbitrary code for individual agents, and I'm trying to decide the best way to divide up computation time. The simplest option would be to ...
5
votes
2answers
388 views

Are display lists faster than VBOs?

I'm making a voxel rendering engine. My "chunks" are 32 * 32 * 256 blocks and I can render a 16 * 16 square of them (which corresponds to Minecraft's maximal render distance). I'm using VBOs holding ...
5
votes
1answer
1k views

Smooth movement in a tile based game

How can we make our character move smoothly across tiles? He moves tile by tile, but that looks unprofessional. In addition, when you hold down the arrow keys he zips across the screen. How can we ...
5
votes
1answer
702 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 ...
5
votes
1answer
617 views

Help for choosing a cost effective game server for Flash client [closed]

I am developing a flash-based game primarily for desktops, to be hosted on facebook platform (like cityville, sims social etc). The gameplay doesn't involve real-time communication between players ...
5
votes
1answer
1k views

What's the best way of drawing a glowing 3d line using LWJGL?

Sort of like a strip-light effect; not actually a light source, but just a polygon with glowing edges. Can this be done easily? Right now I'm contemplating drawing a line more than once with varying ...
5
votes
3answers
715 views

How do I send multiple matrices to a vertex shader?

I'm practising animations using bones/skinning. I am trying to send the shader one matrix per vertex. I can think of these two approaches. Method 1 I have one uniform handle for each bone matrix ...
5
votes
1answer
903 views

RPG game engine. Skill application calculations

Short preface I am a part of a small team which is entering game development. We're creating a new RPG setting with custom game system and mechanics based on dice rolls. I'm server-side java ...
5
votes
1answer
738 views

Isometric - precise screen coordinates to isometric

I'm trying to translate mouse coords to precise isometric coords (I can already find the tile the mouse is over, but I want it to be more precise). I've tried several different methods but I seem to ...
5
votes
1answer
824 views

Java rendering performance bottlenecks

I've read a lot of forums about making 3D games in Java but I was unable to build a full picture of how it performs in video games. I know that it works smoothly for small and average size games, but ...
5
votes
0answers
147 views

LibGDX controllers: how to fix crashes in JRuby?

I'm using JRuby with LibGDX and it's been going quite swimmingly, save for a crash I experience every time I try to use the controllers extension. Here's a basic rundown: I've required all the ...
5
votes
1answer
578 views

How can I create a 3D model in Java without using modeling software? [closed]

I am a lightly experienced game developer and this is my first time trying 3D objects in Java for the first time. I have been recently creating and updating games using AWT, Swing, and Graphics, but I ...
5
votes
4answers
3k views

Does Unity let you code in Java?

I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read ...
4
votes
3answers
3k views

How can I make my main character move in a parabolic arc when jumping?

I'm entering Android game development, and I already have a computer version of a game I want to publish. The thing is, I want to make this as good as it can be. With that said, I need a physics ...
4
votes
3answers
3k views

Why is my velocity decaying?

Programming in Java. Tinkering around with physics. My entities all have position and velocity. In the main loop, all I'm doing is applying gravity and bouncing off the edges, like so: // add ...
4
votes
3answers
462 views

Saving instances of classes, then recreating the instances [closed]

I have many types of entities, each type has a lot of if instanceof Spider (for example ) then do this in the game code... Now I got to the part where I want to save each type. They all are based on ...
4
votes
4answers
675 views

Algorithm to verify if a shape is inside another

I have a rectangular canvas and I need to verify whether a shape is totally inside that canvas or not. The shape can be lines, ellipses, arcs, rectangles and arbitrary polygons. Does anyone know a ...
4
votes
3answers
1k views

Tetris - Rotations using Linear Algebra (Rotation Matrices)

I'm making Tetris in Java and am at the point of rotations... Originally I was hardcoding each rotation: if (direction.equals("right")) { if (shape.equals("Bar")) { if ...
4
votes
2answers
6k views

How can I move a sprite in the direction it is facing?

I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction ...
4
votes
1answer
3k views

Scrolling tile system

I know this is a common question, but I can't find an answer to it that isn't written using a huge game library sadly. I'm trying to write a scrollable tile system, which allows the user to move ...
4
votes
2answers
553 views

Is it possible to compile an android game for pc desktop?

If I have an android game based on java native libraries. Is it to possible to compile into a windows/linux executable without a 3rd party emulator?
4
votes
4answers
511 views

Can a high FPS negatively affect how a program runs?

Yeah I know this is a broad question and will get down rated, I'm just hoping for some answer before it gets closed. Anyway, I'm using Slick 2D/Java to play around with graphics. I'm having some ...
4
votes
3answers
663 views

Java Anti-Cheat Framework? [closed]

Are there any anti-cheating frameworks for Java games in order to make it a bit harder to cheat? (eg. something that protects from things like Cheat-Engine) Obviously if the cheater were to develop ...
4
votes
2answers
339 views

Minesweeper: Mouse listener problem

I have wrote a code for game Minesweeper and there is no problem with the graphics,but there is some problems with MouseListener. Here is my code /* * To change this template, choose Tools | ...
4
votes
4answers
838 views

More efficient in range checking

I am going to use a specific example in my question, but overall it is pretty general. I use java and libgdx. I have a ship that moves through space. In space there is debris that the ship can ...
4
votes
3answers
1k views

How can I change this isometric engine to make it so that you could distinguish between blocks that are on different planes?

I have been working on an isometric minecraft-esque game engine for a strategy game I plan on making. As you can see, it really needs some sort of shading. It is difficult to distinguish between ...
4
votes
2answers
547 views

How can I mod an item to take experience from a player in Minecraft?

I am creating a mod that has invincible tools which take experience from the player each time they are used. Can someone please tell me how to make the tools take away the experience when used?
4
votes
3answers
6k views

Server-side Architecture for Online Game

basically I have a game client that has communicate with a server for almost every action it takes, the game is in Java (using LWJGL) and right now I will start making the server. The base of the ...
4
votes
4answers
21k views

Android game scrolling background

I'm just trying to figure out the best approach for running a scolling background on an android device. The method I have so far.... its pretty laggy. I use threads, which I believe is not the best ...
4
votes
4answers
277 views

How to avoid duplication using client-server model

I am using a client-server model to write a multiplayer-capable game (in Java). Currently the clients and the server are using the same code to run the game logic, in order to enable client-side ...
4
votes
2answers
173 views

How can I get a list of servers hosted by my players?

I'm writing a multiplayer 2D online game, where game servers are hosted by the players. I want to show players a list of the currently hosted game servers. How would I do that? I know how to let ...
4
votes
3answers
464 views

How to rotate a set of points on z = 0 plane in 3-D, preserving pairwise distances?

I have a set of points double n[] on the plane z = 0. And I have another set of points double[] m on the plane ax + by + cz + d = 0. Length of n is equal to length of m. Also, euclidean distance ...
4
votes
1answer
280 views

How do I make a cube move by rolling?

I am learning jMonkeyEngine by making some small games with it. I have a simple rectangular cube that I want the player to be able to roll around the game world. When he presses the arrow keys, the ...
4
votes
2answers
2k views

Separate loops for logic (tps) and rendering (fps)

I'm converting a game that was using a very basic game loop that executed update/render methods 20 times per second to lwjgl. I'm using the fps loop examples in their wiki, but have found that while ...
4
votes
1answer
379 views

Clock hand, how much should I rotate the hand by every frame?

I've got a virtual clock. The clock consists of the actual clock sprite, and a hand to go over it. I'm able to set how long the clock duration is. Say I set it to: 5 seconds. While the clock time is ...
4
votes
2answers
5k views

Texture antialiasing?

In my Minecraft-clone style game, blocks are textured with a border that is lighter then the block color. See picture below: To achieve this effect without the textures being blurry I use this ...
4
votes
1answer
1k views

Android Game Dev: Screen Scaling

This question is very closely related to a previous question of mine: Scaling a game view with letterboxes? My game runs at 480x800 right now but when the screen is smaller or bigger than that I ...
4
votes
2answers
236 views

How would I go about updating my electronic circuit simulator's 'electricity'?

I have made an application which allows the user to place down wires, power sources, and inverters on a virtual circuit board. All connections between tiles are automatic, as shown here: As you ...
4
votes
3answers
428 views

Are there methods faster than Strings for sending a sprite's state over UDP?

I'm programming a 2.5D networked game in Java. The networking works like this right now: Create new networked sprite object at the client. Send it to the server. Server distributes and saves it. ...
4
votes
1answer
455 views

Splitting logic into threads in Java tower defence game

I'm making a tower defence game in Java! It's my first game development. I want to know how many threads Do I need to create in a game, to split logic.. I've made this one: Main App thread (adds ...
4
votes
1answer
597 views

How to draw a global day night curve

I see many applications which have world-clock map, and I would like to make my own to enhance some of my mobile apps. I wonder if anybody has any knowledge where to start, how to draw a curved shadow ...
4
votes
4answers
2k views

Which Side Was Hit?

I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am ...
4
votes
3answers
2k views

Android “Activities” — one or many for games?

I've been learning Android in my spare time, and one of the first things every tutorial/guide will introduce to you is the concept of an "Activity." Everyone loosely defines an Activity as a screen ...