Tagged Questions

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

1
vote
1answer
91 views

Libgdx - Sprites disappearing [closed]

I'm facing a little problem and I have no idea to bypass it. I've made a dungeon generator and I'm able to spawn randomly mobs, the problem is that when they are not moving the game is fine, but at ...
0
votes
1answer
67 views

background move to the right

I'm developing an android app and want to make move the background to the right. The problem that I have is if it moves it does not repeat the background. I appreciate every suggestion. Thanks. The ...
0
votes
2answers
356 views

Java collision detection and player movement: tips

I have read a short guide for game develompent (java, without external libraries). I'm facing with collision detection and player (and bullets) movements. Now i put the code. Most of it is taken ...
2
votes
1answer
384 views

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...
0
votes
0answers
55 views

Have button style not change when down

I'd like the button style to only change when it is checked and not change when it is pressed down, and/or have only the font color change. I'm using the built in Skin function with a .json file, ...
0
votes
0answers
100 views

Frame Buffer couldn't be constructed: incomplete attachment error on nexus 7

So I am running into an issue where I cannot load my game onto the nexus 7 because of the error stated previously. I read online that this is because the device can't use the Format class or something ...
0
votes
1answer
114 views

Nullpointerexception when loading resources in openGL ES 2.0 Android project

Overview My splash screen starts by display a 'loading' dialogue and then kicks off an asyncTask (The loading dialogue is derived from the standard Android View class) Within the doInBackground ...
0
votes
0answers
39 views

Java Graphics Rendering Bug

So I've been playing around with moving objects using KeyListeners and active rendering via while(true) loop. CANVAS.createBufferStrategy(3); BufferStrategy buffer = CANVAS.getBufferStrategy(); ...
0
votes
0answers
129 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 ...
0
votes
1answer
123 views

Re-using one texture for multiple OpenGL Quads

I've been looking over my code and I'm just wondering, when I set a texture for say, 20 quads that need to use the same texture, it seems as though I'm creating a new texture each time...... surely ...
1
vote
2answers
163 views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. ...
0
votes
2answers
67 views

How to obtain the currently bound texture ID in an openGL ES 2.0 project

In my game, I have: GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texID); Where texID is an integer returned by my setTexture() method. Let's say, in this instance it's 1. When I bind my textures ...
5
votes
2answers
1k 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 ...
1
vote
1answer
139 views

Dialog Title Does Not Fit

I successfully added my own font to the default .json file and it displays, however I get some weird sizing issues. Specifically when I try to create a Dialog. This is what it looks like: Ignore the ...
1
vote
2answers
229 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
50 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 ...
-1
votes
1answer
56 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 = ...
1
vote
0answers
85 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 ...
0
votes
2answers
244 views

Texturing a VBO cube (JOGL)

I've been having trouble texturing a cube using vertex buffer objects. EDIT: I updated/replaced my shaders to fit the right version. The program compiles and links, but it shuts down java in ...
1
vote
1answer
101 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 ...
2
votes
1answer
258 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 ...
-2
votes
1answer
112 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
253 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
0answers
54 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 ...
0
votes
0answers
85 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 ...
0
votes
0answers
139 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 ...
-1
votes
1answer
62 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 ...
2
votes
1answer
101 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 ...
1
vote
1answer
160 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
146 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 ...
0
votes
1answer
135 views

LibGDX drawing map using tiles without space

I am making a board game. To draw the map on the board I use different tiles. On some screen the map looks good but on some other screens there is a space between the tiles. How can I do so there ...
0
votes
0answers
56 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
0answers
78 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 ...
2
votes
1answer
85 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 ...
2
votes
4answers
120 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 ...
2
votes
1answer
174 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 ...
1
vote
1answer
78 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 ...
0
votes
1answer
122 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 ...
1
vote
2answers
190 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 ...
1
vote
0answers
93 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
81 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
85 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; ...
0
votes
1answer
41 views

Slick UnicodeFont displays in different location depending on the screen size?

I am using the Slick2D library to draw text. The text draws perfectly, however it is in the wrong location! I could easily draw it in the correct location, however the problem is that the "correct ...
0
votes
1answer
66 views

Moving a tiled map in a jframe

I rendered a tiled map, with the help of slick2d, in my JFrame in Java. I can move my main character, but it is just that the character itself moves. I would like to do it that, if the player moves, ...
4
votes
2answers
229 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 ...
0
votes
2answers
101 views

How should I access frame buttons from a controller in an MVC approach?

I'm developing an italian card game using the mvc pattern. I have the class GameFrame that contains the view. The user's card are buttons (JButton objects). I have 3 controllers: GameController: to ...
0
votes
3answers
275 views

How to optimize collision detection

I am developing a 2D Java Game with LibGDX. This is what it kinda looks like (simplified): The big black circle is the player, which you can move by tilting the smartphone. The red circles and blue ...
0
votes
1answer
114 views

How do I find a unit vector of another in Java?

I'm writing a Java formula based on this tutorial: 2-D elastic collisions without Trigonometry. I am in the section "Elastic Collisions in 2 Dimensions". Part of step 1 says: Next, find the unit ...
0
votes
0answers
64 views

Sprite transparency not effected libGDX

I am making a game using libGDX and Tween Universal Engine. My problem is as follows: I have 2 screens so fars, a splash screen with the logo, and a second one which is the main menu. In the splash ...
0
votes
0answers
284 views

Limiting game loop to exactly 60 tics per second (Android / Java)

So I'm having terrible problems with stuttering sprites. My rendering and logic takes less than a game tic (16.6667ms) However, although my game loop runs most of the time at 60 ticks per second, it ...