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

ShapeRenderer is pixelated in libGDX

When I use a ShapeRenderer, it always comes out pixelated. But if I draw the shape in photoshop with the same dimensions, it's very smooth and clean-looking. My method is just as follows: package ...
4
votes
2answers
500 views

How To: Java Game to Steam Greenlight

I am planning to create an indie game using Java and Eclipse IDE and I want to put the finished product to Steam Greenlight. How does the whole process work after the game is finished and running ...
2
votes
1answer
76 views

AndEngine GLES 2 Animate Character [on hold]

I want to animate my character in game. My graphic animator prepare for me three options. Frame-by-frame by this is over 9MB for one animation. With TextureSpriter 4-5MB. Spriter but I can't find ...
0
votes
1answer
52 views

How to achieve a Gaussian Blur effect for shadows in LWJGL/Slick2D?

I am currently trying to implement shadows into my game, and after a lot of searching in the interwebs I came to the conclusion that drawing hard edged shadows to a low resolution pass combined with a ...
0
votes
1answer
205 views

problem adding bumpmap to textured gluSphere in JOGL

I currently have one texture on a gluSphere that represents the Earth being displayed perfectly, but having trouble figuring out how to implement a bumpmap as well. The bumpmap resides in ...
1
vote
2answers
201 views

Where should I put my game loop?

I've seen some tutorials on programming a good game loop, but none mention where (in the game code) I should call it. My guess is I should call it from the main() method. Am I right? Is there another ...
0
votes
1answer
156 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = ...
1
vote
0answers
50 views

Hiero Font not working [closed]

For ease of use I decided I would use the Skin class to make buttons and text, and the like, rather than draw them myself. So I downloaded Hiero to package a .ttf font into a BitmapFont and it all ...
1
vote
1answer
78 views

LibGDX collision detection on moving and rotating object (rectangle enemy) [closed]

i am trying to get collision dectection working properly but when i do it, the collision area keeps moving. no matter what i tried. there are 2 objects and the objects are moving and i cannot get the ...
0
votes
1answer
74 views

Playing repeated sound in Java

I'm trying to play sounds in a Java game with the following code: AudioStream audioStream = new AudioStream(stream); AudioPlayer.player.start(audioStream); The stream variable is just an ...
0
votes
2answers
106 views

Java: Camera Rendering

Which is the best way to detect whenever an object or tile is inside the Camera Range so I can draw it? With "best" I mean more efficient, and quicker. Thanks
0
votes
1answer
31 views

Generating multiple instances of one opengl object with random coordinates

Sorry if the question is dumb but my brain just cannot solve it for some reason.. So I've made one opengl object public static Square ball = new Square(75,75); And I am trying to make it so that ...
0
votes
1answer
32 views

Simple rendering produces minor stutter

For some reason, this game loop renders the movement of a simple rectangle with no stuttering. double currTime; double prevTime = System.nanoTime() / NANO_TO_SEC; double FPSTIMER = ...
2
votes
2answers
204 views

Expandable 2d environment by spawning and controlling individual tiles

what is the best way to implement an environment that is "expandable" in every direction so that when the player moves in any direction a new row or column of tiles that can be manipulated ...
1
vote
1answer
72 views

Why isn't my background drawing to the screen?

Ok, So I have a game I have been working on for a few months now and I am now stumped beyond belief. My friend who has spent days working on this background gave it to me and I put it in my game. On ...
1
vote
1answer
129 views

Random lines away from images in java2d opengl game

Working on a java game that uses some pngs images for icons/textures. A few images ( fewer than 5, out of dozens ) are showing some odd parallel "artifact" lines. They move with the image, are ...
3
votes
1answer
350 views

How do I detect a tile map collision's direction? [duplicate]

I'm implementing collision detection with the map for my platformer. I have a method that generates a polygon on every tile and checks if the player hits it -- that's all fine. The problem is that ...
-2
votes
1answer
99 views

How does the minecraft main menu play a “movie” [closed]

I've been wondering for a while, and been doing a lot of research on the subject: how does the main menu in minecraft play a "video". As far as i can tell, it's not a .gif, it appears to be a movie. ...
0
votes
1answer
41 views

Libgdx Do a fixed rotation for orthographic camera

Im trying to rotate my orthographic camera in the render loop to a fixed angle, but I can only make the camera spin with the code I got: in the create OrthographicCamera camera = new ...
0
votes
1answer
339 views

LWJGL font not rendering, even with depth test and texture_2D

I'm running into an odd little problem here. I'm attempting to render a basic console over my LWJGL-based application, which should be easy enough through a decorator pattern of renderers (as in, one ...
0
votes
1answer
4k views

How To Scale Canvas In Android

I am writing a android game using Canvas as the way to draw everything, the problem is that when i run it on different android phones the canvas dosn't change size i tried using canvas.scale() but ...
1
vote
1answer
46 views

Get the game state using Multithreading in Java Monkey Engine 3

I’ve been trying out Java Monkey’s multi threading recently via the wiki’s tutorial. Since I just wanted to test a prototype clinet, I made a program which creates some cubes using the ‘Cubes’ library ...
-1
votes
1answer
39 views

get current frame from an one row graphic [closed]

I need to get the current frame of a image but it does not work and I don't know why... Could someone help me pls... thx package com.android.testgame; import android.graphics.Bitmap; import ...
0
votes
3answers
282 views

Collision Error

I am having trouble with collision detection part of the game. I am using touch events to fire the gun as you will see in the video. Note, the android icon is a temporary graphic for the bullets ...
0
votes
0answers
25 views

Deleteing Textures in Android OpenGL ES 2.0

I'm confused about how to delete a previously applied texture. So, I've applied my texture and am happily rendering it. I decide I want to delete the texture, so this is what I've tried...... void ...
1
vote
1answer
3k views

Drawing hexagonal grid on Android

I'm trying to draw a hexagon grid in my Android application. I don't want to reinvent the wheel here so I'm looking for some frameworks/libraries or just some basic ideas about how should one do this. ...
0
votes
0answers
67 views

Using VBOs for the begginer

I've spent the past 10 hours trying to understand this and couldn't get any good help. I whatched a youtube video on VBOs and have whatched it many times and tried many things, but I STILL DON'T GET ...
2
votes
1answer
51 views

Failing Screen Resize Method

So I want my game to draw to a specific "optimal" size and then be stretched to fit screens that are a different size. I'm using LibGDX and figured that I could just draw everything to a FrameBuffer ...
0
votes
0answers
27 views

LibGDX stops drawing if I create a lot of Timer Tasks, but only in Android. Why is this?

I'm working on a few small games using LibGDX, and today I just started testing the first one on android rather than the desktop. A few seconds into the game, it stopped drawing. All my print ...
2
votes
1answer
243 views

Transforms in Box2D

I'm attempting to implement a camera in my game. I had it working for regular objects, but I began using Box2D and obviously things changed a bit. I have a Body object that I want to draw at the ...
0
votes
1answer
46 views

Slick2D: Animation not being parsed from spritesheet correctly

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so: spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192); ...
1
vote
1answer
63 views

Multiple enemy array in LibGDX

I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And ...
0
votes
2answers
74 views

Make objects slide across the screen in random positions

I want to make an object appear randomly at the right hand side of the screen and then slide across the screen and disapear at the left hand side. I am working with libgdx. I have this bit of code but ...
2
votes
2answers
3k views

Simple Java networking game engine [closed]

I want to create a simple java networking game and search a networking engine that eases use of sockets etc. I have already read some questions on here and the internet about java networking for ...
1
vote
0answers
179 views

How do I implement a “sliding out of / into” effect on a settings menu similar to that in Angry Birds?

I'm trying to implement a settings menu component similar to that in Angry Birds - a button control that makes an options menu slide out of it and back into it when clicked on. I use scene2d.ui to ...
2
votes
1answer
62 views

libgdx arrays onTouch() method and delays for objects

i am trying to create random bullets but it is not working for some reason. also how can i make a delay so the bullets come every 30 seconds or 1 minute???? also the onTouch method does not work and ...
0
votes
0answers
41 views

Creating a voxel chunk with a VBO - How to translate the coordinates of each block and add it to the VBO chunk?

I'm trying to make a voxel engine similar to minecraft as a little learning experience and a way to learn some opengl. I have created a chunk class and I want to put all of the vertices for the whole ...
0
votes
0answers
44 views

(LWJGL)How would a game patch work

I made a game in java that I plan on selling some day. When I do eventually release it,I want people to receive patches instead of buying it again. How does a game patch work, and where the heck do I ...
1
vote
1answer
48 views

libgdx draw issue and animation

it seems as though i cannot get the draw method to work??? it seems as though the bullet.draw(batcher) does not work and i cannot understand why as the bullet is a sprite. i have made a Sprite[] and ...
1
vote
1answer
43 views

LibGDX onTouch() method Array and flip method

How can I add this on my application. i want to use the onTouch() method from the implementation of the InputProcessor to kill the enemies on screen. how do i do that? do i have to do anything to the ...
2
votes
1answer
72 views

libgdx collision detection / bounding the object

i am trying to get collision detection so i am drawing a red rectangle to see if it is working, and when i do the code below in the update method. to check if it is going to work. the position is not ...
2
votes
4answers
62 views

LibGDX - SpriteBatch's .draw() method requiring float[]

Please excuse my lack of knowledge with LibGDX, as I have just started learning it. I am going through some simple tutorials, and in one of them, I draw a string onto the screen like so: // the ...
6
votes
1answer
290 views

2D Polygon Triangulation

I am creating a game engine using the JBox2D physics engine. It only allows you to create polygon fixtures up to 8 vertices, To create a body with more than 8 vertices, you need to create multiple ...
8
votes
8answers
2k views

Best resources to learn Game Development from a Java background? [closed]

I'm an enterprise Java programmer, however something I've been interested in and what got me into the whole programming thing was the idea of being able to create a game. Just wondering if anybody ...
0
votes
0answers
55 views

How to create a copy of an instance without having access to private variables [migrated]

Im having a bit of a problem. Let me show you the code first: public class Direction { private CircularList xSpeed, zSpeed; private int[] dirSquare = {-1, 0, 1, 0}; public Direction(int ...
0
votes
1answer
60 views

LWJGL/Java - Implementing a writeable text box?

I would like to create a writeable text box where a user can input text into it. A nice "send" button that the person could click to send the text to the server would also be nice. I currently haven ...
4
votes
2answers
218 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 ...
2
votes
1answer
209 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 ...
1
vote
0answers
57 views

convert image to spritesheet of tiles for isometric map?

is there a way to convert an isometric image (like the first image) to a spritesheet (like the second image), in order to place each image on the isometric map with the code? The map looks like the ...
1
vote
1answer
63 views

Electronic circuit simulator four-way flood-filling issues

I've made an electronic circuit board simulator which has simply 3 types of tiles: wires, power sources, and inverters. Wires connect to anything they touch, other than the sides of inverters; ...