Java is both a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.
-5
votes
0answers
68 views
How to make a picture to grow like grass garden [closed]
I m new in to the Java
Please could someone give some tips of method to use to make a image of grass growing ?
Like day by day ?
Thanks
-1
votes
0answers
72 views
Best Gamedev book for jmonkey engine [closed]
I want to start using the Jmonkey Engine to make a game but I want to learn some theory first. I am NOT interested in marketing or creating a story. I basically want to know which book would tell me ...
-3
votes
0answers
38 views
Using Multiplayer and Rendering on a single thread [closed]
I have a rendering thread which does all my rendering of the game, is it possible to connect to a server at the same time on the same thread as the render? Would it overload, would it slow it down? Or ...
1
vote
2answers
412 views
Why are my game ticks longer than expected?
I was working on my game, adding stuff to it, when I noticed my ticks were in the low 50's when I had set it to do a constant 60. This is my run method.
public void run() {
init();
long ...
1
vote
1answer
77 views
LibGDX Cross Platform Networking
Backstory:
I've been developing a game with LibGDX for the past two years, and I've seen it refactored more times than I remember.
I jumped on the iOS iKVM port as soon as it was released.
But I've ...
3
votes
0answers
94 views
Dynamic “Light Level” System based on alpha levels
My team and I have been working on a game in Java using the Slick2D engine and there are a few things I have questions on. As of right now, the code that I've written basically takes a cosine function ...
-1
votes
0answers
41 views
Strange Resource not found error [closed]
I'm getting this error when I try to run my application:
java.lang.RuntimeException: Resource not found: /res/images/
at ...
0
votes
0answers
32 views
Getting direction of mouse from the middle - slick2d [duplicate]
I need to find the direction of the mouse from the centerpoint, i need it to return a direction e.g. north, south, northwest, southeast and so on
how would one go about doing that in java
ps. to ...
2
votes
2answers
101 views
Java Tetris - Matrix Rotations
I'm building Tetris in Java and am trying to use linear algebra to rotate a piece composed of 4 tiles.
My friend was explaining the way to do it is:
He said:
"To clarify, you do need to rotate ...
3
votes
3answers
258 views
Tetris - Rotations using Linear Algebra (Rotation Matrices)
I'm making Tetris in Java and am at the point of rotations... Originally I was hardcoding each rotation:
if (direction.equals("right")) {
if (shape.equals("Bar")) {
if ...
1
vote
1answer
46 views
LibGdx: How do I combine 2 GestureListener objects from 2 seperate classes into 1 GestureDetector
I'm trying to make 2 separate classes, 1 a VirtualJoystick class and 1 a VirtualButton class. I want to implement a GestureListener class in each, it just seems like good code to do so, but when I go ...
-3
votes
0answers
35 views
Using an OpenGL wrapper in Swing? [closed]
I'm building a custom OpenGL wrapper in Java. But I was wondering how do I link OpenGL commands to a Swing window? Thanks in advanced!
1
vote
2answers
72 views
Calling opengl32.DLL from java?
I don't like LWJGL in some cases, so I prefer to use Swing. The thing is that Swing doesn't have OpenGL. I have tried JOGL and it's a mess to install, needs external jars, and I have yet to get it ...
-1
votes
0answers
94 views
Logic in an Object Oriented Architecture [closed]
Good evening.
Recently I've been thinking of making a simple TBS game in Java for fun and I was wondering if my logic is correct.
Basically, I have the following classes:
public abstract class ...
-1
votes
0answers
59 views
LWJGL - Switching from 3D to 2D to render text with NO external librarys [closed]
I want to render 2D quads on my screen by switching to a 2D scene then switching back to 3D.
I dont want to use any external librarys besides LWJGL.
This is what I got so far:
private static void ...
2
votes
1answer
74 views
MVC with looping view
For our school project we'd like to develop a game using the MVC pattern. We're all moderate new java programmers and absolutely new in game development.
With our current view (containing only menu) ...
0
votes
0answers
30 views
Library for asynchronous client to client messaging [closed]
I am currently developing an online game where two players can play against each other (something like Who Wants to Be a Millionaire?). And I would like to implement an asynchronous service so those ...
1
vote
0answers
49 views
How to put OpenGL in a state for drawing blended, colored, nontextured polys?
Using OpenGL1.1 (sadly) I'm trying to draw a cube, which is colored and alpha blended. It is instead showing up as opaque black. Even without including alpha in the color it still shows up as opaque ...
0
votes
1answer
62 views
Slick2d Particles loading xml returning null [closed]
I've made a particle class that creates a particle of Slick2d library, but the XML file doesn't want to load , it keeps giving me null error. I gave it the path as I do for everything but it refuses ...
-1
votes
1answer
88 views
Class equality in JAVA [closed]
I want to equalize two object like this:
public abstract class Shape{...} // There is an abstract shape class
public class Circle extends Shape {
int radius;
...
}
...
-2
votes
0answers
67 views
How can I create a board with Java GUI? [closed]
I am trying to create a Battleship game with MVC pattern. I have never used GUI libraries before. So can you please guide me how can I create a board with Java GUI?
-2
votes
1answer
119 views
Usage of triangulators - Slick2d [closed]
So i need detailed examples how to use one of Slick2ds many triangulators to create a polygon with a hole. Could someone show me code examles of how to use it.
-2
votes
1answer
86 views
How to properly limit movement based on collision [closed]
I have a confusing problem on my hands. I've managed to get tile-based collision working, and I'm using the following code in my update loop to restrict my character's movement.
for (Block b ...
-5
votes
1answer
54 views
Writing and reading from an XML file with Slick2D [closed]
I was wondering how you would go about writing and the reading from an XML file using the Java library Slick2D.
I have googled for the last couple of days and have found nothing succinct and simple ...
0
votes
1answer
66 views
Hiding pixels inside a Shape
I have a player wich is a png image and I want a part of him to be able to go behind things, so I need to know how to hide pixels that are inside of a shape
-2
votes
2answers
88 views
How can I display an image for a predetermined amount of time?
I want to display an image, then return to the previous after one second when a certain key is pressed. I'm using Slick2d and Java. How can I accomplish this?
-1
votes
1answer
60 views
Refering to an object from an array in Java [closed]
In my game, the whole thing is based off of grids. So the map is a dual dimensional array of 32 (32 x 32 grid map). Now what I want to be able to do is to grab a grid and be able to access it and ...
0
votes
1answer
59 views
Java Slick2d particles error [closed]
When i run the game particles crash the game, im not sure what am i doing wrong because the program doesnt tell me. But i know particles are causing this , if i remove the code in update code at ...
5
votes
4answers
558 views
How to save and restore Bullet Physics state?
I'm looking for information on how to save the runtime state of rigid bodies with Bullet Physics. Most of my world consists of static objects, but I have a few dynamic and kinematic objects as well. I ...
0
votes
0answers
53 views
Rotation method for camera class [closed]
I am in the process of writing a camera class for my game but I'm stuck on how to add a method for rotating the camera.
Here's my code so far.
package Game;
import org.newdawn.slick.Graphics;
...
-2
votes
1answer
63 views
Entity moving Up and Down but not Left and Right [closed]
I am trying to create an entity class for my game but I'm having difficulty with the movement, I can get the sprite moving along the Y-Axis but not along the X-Axis.
Here's my code:-
package Game;
...
-5
votes
2answers
83 views
animation runs only onces [closed]
I found this tutorial on sprite sheets that works great.
Managing sprite sheets for animation
I am not sure how I could modify it, so that it loops through just once. My thought was to add an if ...
2
votes
1answer
71 views
Low FPS on Java drawing in BufferStrategy
I ran into a very strange problem while using BufferStrategy, I've tried searching for an answer but all I have found are non-relevant threads and discussions. So here is my query.
for (int i = 0; i ...
5
votes
2answers
334 views
Java 2D game programming: Different approaches to make a game loop
I am new to Java game programming, but the more I read the more I'm confused, because I've seen several different approaches to make a game loop:
1. The standard approach, that uses the Timer class ...
4
votes
4answers
205 views
Storing data for a pokemon like game
The game I'm developing is close to Pokemon. How should I store the data? I am currently thinking of text files where I save the map and have a corresponding textfile for the trainers and their teams ...
0
votes
0answers
69 views
fire multiple events in InputListener
I have two Actors on my stage in libgdx and and both have a InputListener. I override the touchDown method and it works fine. My Problem is that when I press my Actor Z and a second later Actor Y only ...
3
votes
2answers
160 views
Distortion Effect
I'm trying to make a distortion effect for a space game. The idea is that the effect has a central point, and all nearby objects appear to swirl into that point. I've made a preliminary version and it ...
1
vote
1answer
234 views
Managing sprite sheets for animation [closed]
I am trying to use a sprite sheet for animation but I'm having some trouble with my implementation. The three key things that I require my code to do are:
Play through a set of images once, for ...
1
vote
4answers
109 views
Java Slick2d collision feedback [closed]
I'm trying to build a collision response ( it uses vectors2f from slick2d ) so that enemies don't overlap on each other so basicly what I'm doing right now is, I loop trough all enemies in array ...
1
vote
1answer
186 views
Sidescrolling troubles [closed]
I'm making a sidescroller using java and Lwjgl. But I'm having some trouble getting the screen to actually ... well... sidescroll. The world is randomly generated and drawn in blocks. Like so:
...
0
votes
2answers
66 views
change bullets java
i need some help with java. i am creating a game where i have a player and he shoot bullets. u can also change u types of bullet.
bullets are just fillOval. and change types of bullets is different ...
1
vote
1answer
171 views
How do I export my Blender model to OGRE XML format for jMonkeyEngine 3?
I'm an amateur software engineer with several simple 2D-game projects under my belt. I'v recently turned my attention towards creating a basic 3D game, nothing too fancy, just to get a grip on things.
...
-1
votes
1answer
70 views
How should I store resources generated at runtime? [closed]
I in my game I generate some images at runtime depending upon the size of the text that will go over it. Right now I am storing these in a hashmap using a string resembling the text. The question is, ...
1
vote
1answer
85 views
Making different kinds of items [closed]
I want to create 2 items on the screen. Each item will be a differently colored rectangle.
item1 = green rect
item2 = blue rect
If the user gets the 1st item, it will print bullet1, which is the 1st ...
-1
votes
1answer
94 views
Creating 2D game engine, image = null error [closed]
When ever I run this, I get the error
Exception in thread "main" java.lang.IllegalArgumentException: input == null!
I tried many different solutions including moving parts of the code around and ...
1
vote
1answer
72 views
Java Slick2d Delta ( time )
In Java slick2d , i started printing out Delta which is supposed to be the time and it prints out is 16 or 17 forever, so how does this help me if i want to tell an object when it needs to do ...
-4
votes
1answer
111 views
I need help generating terrain for a 2D circle [closed]
How would you go about generating terrain for a circle. To be specific i am using a 5x5 .PNG as the thing or object that will fill the circle. At the moment i am having problems making the terrain ...
3
votes
3answers
99 views
How do I undo changing the color of an image in Slick2d?
This code colors the enemy red:
enemies.get(i).image.setColor(0,1,0,0,1);
enemies.get(i).image.setColor(1,1,0,0,1);
enemies.get(i).image.setColor(2,1,0,0,1);
enemies.get(i).image.setColor(3,1,0,0,1);
...
0
votes
0answers
65 views
Why does Slick import Tiled object rectangles without width, height, and name tags?
I tried using Tiled rectangle objects as walls with Slick's TiledMapPlus class, but as I soon realized that each GroupObject would return 0 for width and height. The code I used looks like this:
...
4
votes
2answers
176 views
3D models on 2D tilemap perspective when scrolling
I am creating a small top-down game, where the player traverses a 2D tilemap, with an illusion of depth provided by 3D models for things like buildings or trees.
Having gotten to the point where I ...
