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

2
votes
1answer
291 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
113 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
319 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
64 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
86 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
143 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
70 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
114 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
185 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
173 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
162 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
58 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
82 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
96 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
132 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
208 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
90 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
164 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
208 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
106 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
89 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
93 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
44 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
87 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
232 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
111 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
320 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
129 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
75 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
332 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 ...
1
vote
0answers
51 views

Box2D random crash when adding joints

I'm currently working on a project which uses Box2D, when the player uses a certain key it should anchor to the ground. For that I use a weld joint, but when I add the joint the game will sometimes ...
0
votes
3answers
524 views

how to design transparent screen in libgdx

this question is for LibGdx geeks. I want to make transparent screen in my game. For example, when level completes I want a new transparent screen pop up and show player's high score, buttons to ...
-1
votes
1answer
92 views

What is “immediate mode” in LWJGL?

I am not sure what "immediate mode" is in the context of LWJGL. I think it's when you use gluPerspective() function?
1
vote
1answer
215 views

Sphere-Sphere intersection and Circle-Sphere intersection

I have code for circle-circle intersection. But I need to expand it to 3-D. How do I calculate: Radius and center of the intersection circle of two spheres Points of the intersection of a sphere ...
-1
votes
1answer
80 views

Get stick analogue XY position using Jinput in lwjgl

I want to capture the movement of the analogue stick of the gamePad. is there any equivalent function to this? public void mouseMoved(MouseEvent mouseEvent) { mouseEvent.getX(); //return the X ...
-1
votes
1answer
82 views

How do I put different textures on different walls? LWJGL

So far I have it so you are running around in a box, but all of the walls are the same texture! I've loaded up other textures for the walls (I want the walls a different texture than the floor) but it ...
1
vote
1answer
141 views

Java Slick2d Animation not working

Hello everyone I am trying to make a simple 2d game using java and the slick2d library. this is my first time doing it and i need some help. Right now I am trying to make the Animations for the ...
0
votes
1answer
101 views

Slick and Timers?

I'm making a game where I need events to happen in a precise amount of time. Explanation : I want that event A happens at 12000ms, and event B happens every 10000ms. So "if"s should looks like this. ...
7
votes
2answers
662 views

Java single Array best choice for accessing pixels for manipulation?

I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered ...
0
votes
1answer
59 views

Problem with boundary collision

The problem: When the player hits the left boundary he stops (this is exactly what I want), when he hits the right boundary. He continues until his rectangle's left boundary meets with the right ...
1
vote
1answer
688 views

LibGDX: Smooth movement on a grid based game

I'm making a game with LibGDX where the player is on a grid (like a Chess board). For now, I'm moving the player by teleporting him 16px in a direction. I'd like to use the delta time to make smooth ...
4
votes
3answers
442 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 ...
0
votes
3answers
78 views

If player leaves a rectangle take him back to his previous position

Okay, I'm making a game. The map contains all the blocks/buildings/structures etc... The map is bordered by a rectangle. So what I want is if the player attempts to exit the rectangle he goes back to ...
0
votes
1answer
824 views

LibGdx efficient data saving/loading?

Currently, my LibGDX game consists of a 512 x 512 map of Tiles and entities such as players and monsters. I am wondering how to efficiently save and load the data of my levels. At the moment I am ...
0
votes
0answers
227 views

SurfaceView.Callback.surfaceDestroyed is called too early in Android

I'm making a simple animation application. Everything works as planned, except one little detail: About 50% of the time, exiting the application (Home or Lock button), makes the Logic throw a ...
1
vote
3answers
369 views

Interpolation using a sprite's previous frame and current frame

Overview I'm currently using a method which has been pointed out to me is extrapolation rather than interolation. As a result, I'm also now looking into the possibility of using another method which ...
0
votes
2answers
120 views

What design pattern should I employ for validating character movement?

I'm developing a RPG in Java and have a Map class, which will contain all the MapObjects (the Player, Enemies, Walls, etc.): Map.java public class Map { private int width; private int height; ...
2
votes
1answer
169 views

AndEngine GLES 2 Animate Character [closed]

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 ...
1
vote
2answers
329 views

Cover Screen with Snowing Effect in Libgdx

Oddly enough I cant find clear instructions on this theme (I only found rain and the method is very particular) so I ask, how do I implement a whole-screen snow-falling effect? The methods i can ...
0
votes
1answer
92 views

TiledMap resizing and aspect ratio with LibGDX

I'm making a game and I don't know how to resize my TiledMap when the window is bigger but keeping its squared shape. Here is a screen: When I change window size, here's what happens: I want ...