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

In Java swing, while handling a 2D top down game, how should I handle scaling for quality transformations (mainly screen rotation)

For my top down game, I plan to have screen rotation where entities don't rotate, but everything else does. I am using a raster array to store my image so I don't have to render things stacked on each ...
0
votes
0answers
12 views

Which movement system on server side (HnS Click to move)? [on hold]

I'm creating a Hack'n'Slash with Unity as Client and Java as server. Today we started developping movement system, and we don't know what to choose for the movement on server side (it's a click to ...
0
votes
1answer
30 views

2D planetary system simulation- how to improve gravity model? How to control simulation speed?

I'm making a simple planetary system simulator. I've run into some problems with physics model and simulation speed and I'd like to learn how to fix them. My main class is Body: public abstract ...
-1
votes
0answers
18 views

How to add thermal effect to bitmap or YuvImage Live CameraPreview [on hold]

I want to add thermal effect to Live Camera in Android . I am successed in implementing greyScale effect to live Camera. But don't know how to set thermal effect to yuv or bitmap . You can see my ...
0
votes
1answer
23 views

Libgdx distorted texture size

I'm just starting to learn LibGDX and have been having some troubles getting my world size to match with my texture size and box2d bodies. I have a texture 64x64 that I am trying to display but it ...
0
votes
0answers
21 views

Problem with keyListener

I have written some code that makes a labyrinth,and fills the JPanel with my figures (Wall, Player, Road and Gate). I want to move the player with WASD, so I have written the following code. The frame ...
0
votes
0answers
17 views

JBullet - Two RigidBodies will not collide

I am adding two ships into my collision world. (The green dots are the collision shape (an ObjectArrayList) that I am passing to the ConvexHullShape) However they don't seem to collide. In fact, ...
1
vote
2answers
56 views

OpenGL Vertex Array Object(VAO)

I have drawn a triangle and a square using open gl and everything was fine. I have then tried to draw the same triangle and square, while implementing VAO's and now I only get a white triangle - ...
2
votes
2answers
59 views

Best way to deal with a large variety of items?

I am currently working on my first java game and I am having trouble figuring out how I should implement my classes that will have heavy variety. For example, I am considering having an abstract item ...
0
votes
1answer
34 views

Libgdx - Jumping, What am i doing wrong?

I really can't work out whats wrong with my code. I have an input listener for gestures, when I Swipe the position goes up on the y axis fine but he doesn't come back down, if with Gravity added. I'll ...
0
votes
0answers
20 views

Trying to get OOP working with libgdx [on hold]

I'm trying to use this player class for my entity stystem, but rendering isn't working right. I'm trying to have each class render on it's own by calling entity.render(); in my core application class. ...
1
vote
1answer
30 views

JBullet - How can I make my object float on the water?

I'm trying to use JBullet for a ship PVP game. I've got two ships which are meant to rest on the water. Obviously these ships will be colliding, but the problem I have currently is "water" ...
0
votes
0answers
20 views

Shaperenderer not showing any shapes

I'm trying to use the shape renderer in LibGdx, but I don't see anything. I followed the docs as well, but nothing appears. Is there something wrong with my setup? public class MyGame extends ...
0
votes
2answers
31 views

Ball oblique impact physic in Java?

I know Q3 + Q4 = 90 I searched internet and many physic topics, but not found how to calculate this values in Java? (I found V3 and V4 but not found Q3 and Q4) So how can i calculate V3, V4, ...
0
votes
0answers
17 views

Android Studio Project Creation Error [on hold]

I have recently taken up Android Game Development, but my Android Studio is acting up. I installed Java JDK 7, just for the record. When I try to create a new project, I get this stupidly annoying ...
0
votes
1answer
68 views

Platformer collision advice

I've been trying to implement collision for a platformer but I can't find a good way to get the collision of certain sides without it get glitchy. So i try to get the collision of the top rectangle ...
-3
votes
1answer
39 views

String of coordinates into an ArrayList? [closed]

I have a String with coordinates which looks like this: (These coordinates are loaded from a text files and tells the position of entities) String coords = "0,0 0,1 5,2 7,4 10,5" My question is, ...
0
votes
1answer
31 views

Pan camera within bounds of large image

I have a camera that I pan around a large image which works fine, however when I reach the end of the image I can keep panning on and on, forver. I have looked everywhere for an answer on how to ...
0
votes
0answers
54 views

beginning game development for Android, where to start? [closed]

I am an experienced programmer with C, java and little ruby/Python experience. I want to develop games for Android but the number of game engines available (I think they are called game engines, not ...
0
votes
2answers
49 views

GestureDetection Issues - How do I make my Actor jump on Swipe?

I've been trying to solve this for hours now, In theory I totally understand how the GestureDetector works but I'm trying to integrate it with the Libgdx SuperJumper Tutorial (for now). Here: ...
0
votes
3answers
48 views

Why should i set glClearColor and setProjectionMatrix in render method many time in LibGDX?

import com.badlogic.gdx.Game; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class MyGame extends Game { public OrthographicCamera ...
0
votes
1answer
33 views

Moving a Polygon based on Camera position [JAVA]

I am in the process of implementing TMX Maps (made in Tiled) for my game. In Tiled, I can create polygons, which leaves a tag, containing the points. Loading in these points to a Polygon ...
-2
votes
0answers
26 views

need a Multplayer Poker Game Source Code using Java/GWT [closed]

the best example of a source code i need is gpokr.com.. but it's source is closed. i already found games like pokerTH, but it's too complex for me to understand and in a language i don't fully grasp ...
0
votes
0answers
37 views

Hard time implementing AABB collision into a platformer

I have AABB collision working fine. The problem is I can't get it to work with a platformer style game. The collision makes the player move a bit static when colliding and the gravity wont work with ...
0
votes
1answer
27 views

Opengl textures change color of everything

Whenever I render textures, all shapes get the color of the texture. I'm not sure why, but I think it's something to do with the way I render textures. Here's what I use to draw textures: public void ...
2
votes
1answer
78 views

Good approach in designing game classes [on hold]

I took a semester-long course in java but I'm still a beginner in Object-Oriented programming paradigm. Suppose that I want to create a simple game where the player can go to different locations. Each ...
0
votes
0answers
21 views

Opengl camera handling

I normally do parallax scrolling with x and y which works, but I'd like to make a camera class instead so I can rotate as well. Right now the camera is set to the player's position but doesn't scroll. ...
0
votes
0answers
21 views

Alternative to world/terrain editing with jmonkey

I have been studying Java for almost a year and have been trying to develop a game using jMonkey. I have tried Unity before but since I only know Java I decided to go with jMonkey. My problem is that ...
1
vote
0answers
49 views

Is there a cross-platform way to convert SVG file to PNG at runtime? [migrated]

I need to convert SVG files to PNG files at first launch of a game and then save these PNG files to some assets folder. I'm wondering if i can achieve it on both Desktop and Android. The reason why i ...
0
votes
1answer
59 views

How BufferStrategy works

I've used this piece of code a lot in my games, but I still don't know exactly how it works. // Main loop while (!done) { // Prepare for rendering the next frame // ... // Render ...
-1
votes
0answers
29 views

Body.getPosition returns NaN

I'm trying to create my own shooting Ai and for that I calculated at which angle the shooter needs to be depending on the distance from the target. The problem is that a whole lot of times I get this ...
0
votes
0answers
26 views

How to toggle fullscreen with lwjgl

I'm using glfw in lwjgl-3 to try to create a toggleFullscreen method. However it always gives me errors. I saw this question Toggle Fullscreen at Runtime but it didn't help because glfwOpenWindow() ...
2
votes
1answer
29 views

Java Libgdx: How do you add cells to a TiledMap?

I'm trying to make a Side-Scrolling game that will allow you to place/remove tiles. I'm using the TileMap Editor to render the custom Tilemap but is there any way to add tiles? I have it where I can ...
2
votes
1answer
21 views

Rendering curved text in AndEngine

I'm trying to implement a small game using AndEngine and I have a question about the Text. More specifically, I'm wondering if it is possible to deform the text so that you can have a "curved" text or ...
1
vote
1answer
34 views

Suddenly cant run project in libgdx anymore

Ok so in a sudden case of nostalgia, I switched my eclipse workplace from my working libgdx projects to an older one. After looking through my old stuff I had some problems switching it back, since I ...
1
vote
1answer
23 views

Correct way to integrate scaled axis angular velocity into a quaternion

Across my travels on the internet I have came across to ways of integrating a scaled axis angular velocity into a quaternion. The first way converts the angular velocity into an axis angle quaternion ...
6
votes
3answers
1k views

Framerate is affecting speed of object

I'm experimenting with building a game engine from scratch in Java, and I have a couple questions. My main game loop looks like this: int FPS = 60; while(isRunning){ /* ...
0
votes
0answers
16 views

JBullet Capsule falls through Plane when Capsule is translated

I am using JBullet (Bullet physics, Java port) and for a player I have a Capsule shaped rigidbody and am translating it for movement (rigidbody.translate()). I even have the dynamicsWorld call ...
1
vote
2answers
63 views

How can I detect a perfect passageway for collision detection?

The problem is when I move diagonal it moves fractions of units and therefore my coordinates might be a fraction of a unit say (40,400) might be actually (40.12,400.40) but another problem is my pink ...
0
votes
1answer
27 views

How and where to handle collisions? [Java] [duplicate]

Okay, so in my game I have a Level class, which hold an ArrayList of entities. In addition to this, I store the Player here (naturally enough). In my Entity class, I have a method which checks for ...
0
votes
1answer
36 views

Handling collision with LWJGL rectangles

I'm testing collision with other rectangles so I can implement it into my current project. The problem is the rectangle starts at the right x and y, but I'm not sure where exactly they are. I'm pretty ...
0
votes
1answer
77 views

OpenGL multiple mesh management

I've been working on coding a new 3D engine in Java. For the moment at least I'm sticking to openGL... Currently I'm reworking how meshes get transformed and then drawn. ATM each mesh created has ...
0
votes
1answer
61 views

Passing of board data in board games

Every time I make board game, I am faced with a decision. I have classes for the board and/or game logic, and another for the UI. I don't know how I should pass the board data to the UI. I could make ...
0
votes
0answers
22 views

JBullet Only Updates Position when I update it in Code

The title is a bit weird...but here it goes: I have JBullet configured so that I can move things in my code, as the game tick structure is something like this (the update code located in ...
0
votes
0answers
32 views

(LibGDX/JAVA) How can I get a rectangle to rotate with this pendulum so I can start detecting collisions?

One of the objects in my game is a pendulum that swings in a semi-circle. This is done by having an update() method like this: public void update() { angleAcceleration = +1.81 / length * ...
0
votes
1answer
53 views

How to add a callback to addAction in scene2d

Sorry if this is a newbie question, I'm still learning libgdx. I'm using scene2d and I am trying to fade a tooltip into my scene and fade it out after 4.5 seconds. Everything is working in my code ...
0
votes
0answers
37 views

Sprites not being rendered on screen change - Android Libgdx

In my game over screen for my Libgdx Android game I've the following code which starts a new game upon a screen touch. if(Gdx.input.isTouched()) { ScreenManager.setScreen(new ...
0
votes
1answer
46 views

Game lags when my player collides with a specific object (solution known, unsure how to implement)

I'm developing a game in Android using LibGDX (although this is more of a JAVA problem than an engine problem). My aim is to have my player bounce off one spring onto another that will eventually take ...
-1
votes
1answer
32 views

Scrolling is going too fast

I used delta based off the LWJGL tutorials and it works (I get 16 or 17 delta) but everything is scrolling nonstop. Here's how I render things: public class Game { int camX; int camY; ...
0
votes
0answers
25 views

Android: How to scale the imageView? [closed]

Right now my application allows the user to double-tap a bitmap image and a circle is drawn exactly where the user double-taps. Now I want to implement a button that can resize the circle that is ...