Slick2D is an easy to use set of tools and utilites wrapped around LWJGL OpenGL bindings to make 2D Java game development easier.
3
votes
3answers
162 views
How to choose cell to put entity in in an uniform grid used for broad phase collision detection?
I'm trying to implement the broad phase of my collision detection algorithm. My game is an arcade game with lot of moving entities in an open space with relatively equivalent sizes.
Regarding the ...
3
votes
3answers
106 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);
...
3
votes
2answers
474 views
Slick2D Isometric TiledMap Rendering Problem
I created a Tiled Map using the Tiled Map Editor. In the Editor it looks like this:
Desired State
In my java program it looks like this:
Actual State
My java code is:
public class Game extends ...
3
votes
1answer
732 views
How a “Collision System” should be implemented?
My game is written using a entity system approach using Artemis Framework. Right know my collision detection is called from the Movement System but i'm wondering if it's a proper way to do collision ...
3
votes
0answers
101 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 ...
2
votes
2answers
208 views
16-bit PNGs in Slick2D
I'm working on a project and I'm using some 3rd party sprites just to get it off the ground; recently I've come into a hitch. Slick2D doesn't seem to want to load my images. That is, it will warn me ...
2
votes
1answer
80 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) ...
1
vote
2answers
103 views
Java looking in wrong directory for XML [closed]
I found this suggestion on a Stack Exchange site to print out what the current directory is:
File file = new File(".");
for(String fileNames : file.list())
System.out.println(fileNames);
...
1
vote
4answers
114 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
83 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 ...
1
vote
2answers
138 views
Removing the titlebar while using slick2d?
I recently started using slick2D in my gaming programs and a problem I have is not having the ability to remove the border/titlebar. I usually do this to create my own cutom look/ interface but if I ...
1
vote
2answers
768 views
How to add text box in slick2d?
I wanted to let the player rename the character of my game. So I thought that making a text box and when he clicks the ok button, the text inside the text box will make it to a string and render it on ...
1
vote
0answers
75 views
Steering behaviour
So I found this steering behaviour code in a book but i dont really understand the last part of the code what exactly is he doing because im unfamiliar with c++. Why would you need to ...
1
vote
0answers
105 views
Why won't my Box2d bodies collide? [closed]
I'm doing something wrong when trying to get bodies to collide using jBox2d & Slick2d. Here is have just my basic init, update, and render methods. Render and update seem to work fine for drawing ...
0
votes
1answer
62 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 ...
0
votes
1answer
57 views
Follow behavior with randomization factor
I'm trying to make enemy follow player as in picture below, the code below is code for following player with steering behavior ( i'm not sure it steering works tho but it does follow player ), how ...
0
votes
1answer
68 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
0
votes
1answer
175 views
Interpolating a player between two 2D points?
I would like a player to be able to move in a direction smoothly, whilst sticking to a fixed grid. Much like in Pokemon, how the player can move, but when the key is pressed and released quickly, they ...
0
votes
2answers
68 views
Checking bounds of a quad
I want to know how would I tell if a quad touches another quad in my game built in Slick2D. I have a class that I named "Bounds" which has 4 "Point" objects which just store an X and a Y value and a ...
0
votes
1answer
193 views
Box2D and Slick2D: Graphics bug [closed]
The bug
The physics ground represented by a horizontal line. The object is stationary, and seems to be pretending that the ground is lower. This is because the center of the Shape is incorrectly ...
0
votes
1answer
70 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 ...
0
votes
1answer
457 views
SpriteSheet in slick2d or lwjgl
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
public class SpriteSheet {
private String path;
public final int SIZE;
public int[] pixels;
...
0
votes
1answer
274 views
Does using LWJGL and Slick2D yield promise for the future of my project? [closed]
I've been looking around the net for months now in an attempt to find the most appropriate tool for my needs. I haven't had a lot of time to devote to the creation of systems that could possibly ...
0
votes
0answers
24 views
Move towards fails Slick2d
Vector2f move = new Vector2f(0, 0);
float mAngle = (float) Math.atan2(target.getY() - position.getY(), target.getX() - position.getX());
move.x = (float) Math.cos(mAngle) * speed;
...
0
votes
0answers
34 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 ...
0
votes
0answers
58 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;
...
0
votes
2answers
129 views
How to translate from Slick2d coordinates to jBox2d
I read through this question to try and get a grasp on the topic, but I can't figure out how to apply this to my Slick2d window.
I'm trying to do something as simple as place an edge on the bottom of ...
0
votes
0answers
136 views
Slick 2D jar creation
I recently finished making my game using Slick2D, and now I'm trying to create a jar file to play the game. I looked on the Slick forums, and saw that JarSplice was the recommended program. So I used ...
0
votes
0answers
257 views
Slick2d/Nifty-gui input [closed]
I'm trying to get input from slick2d into nifty gui. Ive searched online, and I've seen a few examples, but I can't seem to get it working right.
i've tried the example on here but I can't seem to ...
0
votes
0answers
40 views
External classes positions don't work?
I have an external class which reads the user's mouse clicks. I gave a position where the user have to click, and when the user clicks on that position, it would turn my boolean "mouse" to true. But ...
0
votes
1answer
403 views
How handle nifty initialization in a Slick2D state based game?
I'm using Slick2D and Nifty GUI. I decided to use a state based approach for my game and since i want to use Nifty GUI, i use the classes NiftyStateBasedGame for the main and ...
0
votes
1answer
82 views
Is there any map maker for javaME game?
For the past two weeks I was trying to make a map maker for my java ME 2D RPG game. I failed because i get errors using slick TWL and the forum for this is inactive.
So I just wondered is there ...
-1
votes
1answer
60 views
Slick2D and TileD [closed]
I've been learning Java for a while, and with my aims of being a game developer later in life, I've came across Slick2D+lwjgl and following tutorials and making some little things. However; I don't ...
-1
votes
1answer
63 views
Slick2D ingoring aplha channel?
When I use the draw method inside a image, it completely ingores the alpha channel and fills it in with white. Is there a way I can draw it where the alpha is see through like it's suppost to be? I ...
-2
votes
1answer
93 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 ...
-2
votes
1answer
68 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;
...
-2
votes
2answers
96 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?
-2
votes
1answer
422 views
How to change screen resolution in slick2d?
I released my game for testing for both windows and mac. I'm using mac as my development workspace. My friends uses windows and the window was to big. I created a 1000*1500 Screen window. I can change ...
-2
votes
1answer
124 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.
-3
votes
1answer
388 views
Slick2D TileD Map Editor Properties [closed]
So I used the following post to help me render my isometric map in Slick2D:
Slick2D Isometric TiledMap Rendering Problem
Big thanks and credit to arminb for the code supplied and for the fix to be ...
-3
votes
1answer
190 views
Java2D Collision Detection
I've been wrapping my head around Java2D collision detection. I am working with Slick library and trying to figure a simple clean code to check if a collision has occurred.
The idea is fairly simple, ...
-5
votes
1answer
56 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 ...
