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
2answers
294 views

How can I improve this collision detection logic?

I’m trying to make an android game and I’m having a bit of trouble getting the collision detection to work. It works sometimes but my conditions aren’t specific enough and my program gets it wrong. ...
0
votes
2answers
529 views

Euler angles to Cartesian Coordinates for use with gluLookAt

I have searched all of the internet but just couldn't find the answer. I am using LibGDX and this is part of my code that loops over and over: public void render() { GL11 gl = Gdx.gl11; ...
0
votes
1answer
183 views

Java - Tile engine changing number in array not changing texture

I draw my map from a txt file. Would I have to write to the text file to notice the changes I made? Right now it changes the number in the array but the tile texture doesn't change. Do I have to do ...
0
votes
1answer
272 views

Java Slick2d - Mouse picking how to take into account camera

When I move it it obviously changes the viewport so my mouse picking is off. My camera is just a float x and y and I use g.translate(-cam.cameraX+400, -cam.cameraY+300); to translate the graphics. I ...
-3
votes
2answers
940 views

How to fire a bullet in a specific direction?

I am developing an Android game. I have problem with bullet firing. It's a space ship that has to fire bullets but right now it's firing in a random direction. I have to fire a bullet to the enemy ...
2
votes
3answers
608 views

Movement in RPG

I want to make an RPG game in which I move tile by tile. So when I hit up, the tile row that I am on decreases by one for example. Also, it's supposed to be a slow movement so that I can see the ...
-1
votes
2answers
3k views

Breakout ball collision detection, bouncing against the walls

I'm currently trying to program a breakout game to distribute it as an example game for my own game engine. http://game-engine-for-java.googlecode.com/ But the problem here is that I can't get the ...
12
votes
2answers
2k views

Why is C/C++ preferred for game developers?

Some people say it offers more control to developers, but what is it precisely that can be controlled through C++ which can't be controlled using, for example, Java?
1
vote
1answer
1k views

JOGL hardware based shadow mapping - computing the texture matrix

I am implementing hardware shadow mapping as described here. I've rendered the scene successfully from the light POV, and loaded the depth buffer of the scene into a texture. This texture has ...
1
vote
4answers
624 views

Implmenting RLE into a tilemap or how to create a large 3D array?

Currently I've been using a 3D array for my tiles in a 2D world but the 3D side comes in when moving down into caves and whatnot. Now this is not memory efficient and I switched over to a 2D array and ...
0
votes
1answer
567 views

Java - Finding distance between player and tile in array

What is the best way performance wise to do this? When I click a tile I want it to get the distance and if I am close enough I can interact with the tile. One way would be to find the tile by doing ...
2
votes
2answers
2k views

Java: How to Make a Player Class in a Tile-Based RPG

So I've been following a JavaHub tutorial that basically uses a pixel engine similar to MiniCraft. I've attempted to make a Player Class as such, and I'm basically making a mock Pokemon game for ...
2
votes
2answers
150 views

Get all triangles that are < N dist from you?

Does anyone know of a way I could add a radius to this code for p? Like basically saying "this is true if the triangle is < N dist from the point" public boolean isPointInTriangle( Vector3f p, ...
9
votes
3answers
3k views

How to move an object along a circumference of another object?

I am so out of math that it hurts, but for some of you this should be a piece of cake. I want to move an object around another along its ages or circumference on a simple circular path. At the moment ...
1
vote
5answers
2k views

Collision detection - player gets stuck in platform when jumping

So I'm having some problems with my collision detection with my platformer. Take the image below as an example. When I'm running right I am unable to go through the platform, but when I hold my ...
2
votes
2answers
2k views

rotating menu with Actors in libgdx

I am intending to build a circular menu, with menu items equally distributed around the circle. When clicking on a menu item the circle should rotate so that the selected item is facing the top. I am ...
0
votes
1answer
214 views

Better way to go up/down slope based on yaw?

Alright, so I got a bit of movement code and I'm thinking I'm going to need to manually input when to go up/down a slope. All I got to work with is the slope's normal, and vector, and My current and ...
2
votes
2answers
550 views

How to create reproducible probability in map generation?

So for my game, I'm using perlin noise to generate regions of my map (water/land, forest/grass) but I'd also like to create some probability based generation too. For instance: if(nextInt(10) > 2 ...
0
votes
4answers
308 views

How to run around another football player

I have finished a simple 2D one-on-one indoor football Android game. The thing that it seemed so simple to me, a human being, turned out to be difficult for a computer: how to go around the opponent … ...
-1
votes
1answer
712 views

Thread safe double buffering

I am trying to implement a draw map method that will draw the tiled image across the surface of the component. I'm having issue with this code. The double buffering does not seem to be working, ...
2
votes
5answers
603 views

“Play Now” via website vs. download & install

I've spent some time looking over the various threads here on GDSE and also on the regular Stackoverflow site, and while I saw a lot of posts and threads regarding various engines that could be used ...
4
votes
1answer
559 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 ...
-1
votes
1answer
1k views

Small adventure game

I'm making a small adventure game where the player can walk through Dungeons and meet scary characters: The whole thing is 20 java classes and I'm making this a standalone frame while it could very ...
0
votes
1answer
244 views

Creating a good looking interface for a Java CCG?

I would like to create a Java collectible card game. I have the logic down pat, but I am having some trouble with the interface. I would like to make it look nice. Rather than using the standard java ...
1
vote
1answer
145 views

What web technology could I use which would support a decision tree?

I am a big game development fan but I haven't done any commercial work in the past. I have been asked by a non-profit to look at developing a game similar to the award-winning www.playspent.org They ...
2
votes
3answers
4k views

Where can I find tutorials for LWJGL? [closed]

I don't know if this is against the FAQ so if you close this, it'll be no surprise. I have done research but all the tutorials I have seen have been to hard to follow; I reckon there are better ones ...
-1
votes
1answer
396 views

How do I convert sin, cos and tan into an int in Java?

How would you be able to change Math.sin, Math.cos and Math.tan into an int? This is because I heard that it is useful to have those Math resources in movement, gravity, etc. in gaming. Also, as a ...
0
votes
1answer
348 views

Effectively implementing a game view using java

I am writing a 2d game in java. The game mechanics are similar to the Pokémon game boy advance series e.g. fire red, ruby, diamond and so on. I need a way to draw a huge map maybe 5000 by 5000 pixels ...
4
votes
3answers
622 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 ...
1
vote
2answers
1k views

how should I network my turn based game?

I'm writing a very basic turn based strategy game which allows a player to select units and attack enemy units on their turn. The game is written in Java using the slick2d library and I plan to use ...
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 ...
0
votes
2answers
297 views

Matrix loading problems with jbullet and lwjgl

The following code does not load the matrix correctly from jbullet. //box is a RigidBody Transform trans = new Transform(); trans = box.getMotionState().getWorldTransform(trans); float[] matrix = new ...
0
votes
1answer
335 views

How to select an image on the J2ME Canvas

I am working on J2ME. I have got a canvas, with a layout of a Checkers board. At the position of pieces, I have placed images. The point at which I got stuck is, how to select/highlite a piece's image ...
-2
votes
1answer
184 views

Issues with networking in my Java game, Client crashes when I try and read from the server input

A buddy and I have been programming a code game over the last 2 weeks, it is intended to be a multiplayer game with the ability to have 2 players play against each other. I am running into an issue ...
1
vote
2answers
2k views

Pass information between states in slick 2d?

I am making simple game in java using Slick 2d. My question is how many ways of passing information between states are available in Slick 2d. I am having a Hero class that holds all the hero stats and ...
1
vote
1answer
468 views

Change density of the body dynamically

In my game, I want to change density of my body object when it collide with other objects. I found something like following to change density but further I could not able to find any hint for this. So ...
2
votes
1answer
3k views

Java - 2d Array Tile Map Collision

How would I go about making certain tiles in my array collide with my player? Like say I want every number 2 in the array to collide. I am reading my array from a txt file if that matters and I am ...
0
votes
1answer
2k views

How can I Implement KeyListeners/ActionListeners into the JFrame?

I'll get to the point: I have a player in my game that you control with the keyboard yet the key methods in the player class and ActionListener w/ KeyAdapter in the Board class don't seem to fire. ...
1
vote
2answers
2k views

Dynamically load images inside jar

I'm using Slick2d for a game, and while it runs fine in Eclipse, i'm trying to figure out how to make it work when exported to a runnable .jar. I have it set up to where I load every image located in ...
0
votes
2answers
306 views

Android Game Development problem with Speed = Distance / Time

I have been coding speed for an object. I have made it so the object will move from one end of the screen to another at a speed depending on the screen size, at the monemt I have made it so it will ...
4
votes
5answers
1k views

Should my game handle collisions in the Player object?

I'm making a 2D platform game. Right now I'm just working on making a very generic Player class. I'm wondering if it would be more efficient/better practice to have an ActionListener within the Player ...
0
votes
1answer
412 views

How can I run a .jar file with XNA?

Could someone help me to develop a method to run any .jar file (with parameters) from in C# with XNA?
3
votes
1answer
1k views

With Slick, how to change the resolution during gameplay?

I am developing a tile-based strategy game using Java and the Slick API. So far so good, but I've come to a standstill on my options menu. I have plans for the user to be able to change the ...
0
votes
1answer
417 views

Can't remove JPanel from JFrame while adding new class into it

Basically, I have my Frame class, which instantiates all the properties for the JFrame, and draws a JLabel with an image (my title screen). Then I made a separate JPanel with a start button on it, and ...
1
vote
3answers
2k views

Question about JPanel “transition” for Java Swing

I want to make like a sort of main menu (in GUI). When the user clicks the start button, the screen transition into another "screen" (JPanel). This image will make it easier to understand. ...
2
votes
2answers
630 views

Help Decide between C#/XNA client or Java

The game runs on a client/server architecture currently setup for TCP, and the client code was built in AS3 to be web based. What we're running into is 3 problems for the client. AS3 has no ...
3
votes
3answers
4k views

How to render axometric/isometric tiles that are a 2d array in logic, but inclined 45º visually?

I am making a tile-based strategy game which i plan to have 2.5D visuals in an axometric/isometric fashion. Right now i'm programming it's logic and rendering it as a literal 2-dimensional array ...
9
votes
3answers
10k views

Fitting Android game to different screen sizes

I am making an Android game that is only in portrait screen orientation. It works great when I run it on my phone, but when I run it on a tablet, even though the screen size is bigger, all of the ...
4
votes
3answers
566 views

Box2d Collision problem

I'm not good with words so here's a picture to describe my problem: In my game there is this big ball which the user can move on x-axis only. Now, if the ball is falling like the red one, it's ...
1
vote
2answers
1k views

Adding a short delay between bullets

I'm having some trouble simulating bullets in my 2D shooter. I want similar mechanics to Megaman, where the user can hold down the shoot button and a continues stream of bullets are fired but with a ...