The Slick2D graphic engine and utility collection is meant to make the development of games using LWJGL easier.

learn more… | top users | synonyms (1)

1
vote
2answers
130 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
2answers
1k views

How do I set a single pixel of an image in Slick2D?

I would like to set an individual pixel in Slick (i.e Image.setPixel(x, y, r, b, g)) but I can't figure out how. There is an Image.setPixel function but it doesn't take x and y coordinates. Any ...
1
vote
4answers
201 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
382 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
454 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
1answer
147 views

how do I add development build number each time I compile and play?

I wanted each time I play my game, it will show in the console how many times you compiled or run the game. How do I do that?
1
vote
1answer
341 views

Texture switching with a entity system

I'm using thinking of using an entity system in my game. So far I've been using Artemis with success. However, I have a question about texture switching. I read that switching textures too often is ...
1
vote
1answer
923 views

How do I get the width of a string as it would be displayed on screen?

What is the best and easiest way to get the width of a String using Slick2D? I'm working on the achievement interface menu in my game that displays some images. On each image I need to draw a string ...
1
vote
1answer
64 views

Slick2D: Initializing graphics object before game loop

I'm using the Slick2D Java game library and I want to set the scale of the graphics object that gets passed to the render method in my game loop. I'd like to do this outside the render method, so ...
1
vote
1answer
184 views

How to only render part of an image in lwjgl/openGL

I'm making a mining/building game in java using slick2D and I want to make it so you can only see a few blocks in any direction while you are underground. The best example I could find of what I want ...
1
vote
2answers
2k 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
1answer
904 views

Java 2D Tile Collision

I have been working on a way to do collision detection forever, and just can't figure it out. Here's my simple 2D array: for (int x = 0; x < 16; x++) { for (int y = 0; y < 16; y++) { ...
1
vote
1answer
83 views

Variable Visibility Class Interaction

I have a very general question about how game classes interact with eachother in a growing RPG game project I'm working on. (Writing it in java/Slick2D, not that is matters because the question is ...
1
vote
1answer
2k views

Vector movement in space type game (Mouse rotation)

I'm having an issue with my movement in my 'game' prototype. It's basically not working and admittedly my knowledge with vectors is lacking. The issue I'm running into is that the ship won't move in ...
1
vote
2answers
1k views

how should I network my turn based game?

I'm writing a very basic turn based strategy game which allows a player to select units and attack enemy units on their turn. The game is written in Java using the slick2d library and I plan to use ...
1
vote
2answers
1k views

Adding a short delay between bullets

I'm having some trouble simulating bullets in my 2D shooter. I want similar mechanics to Megaman, where the user can hold down the shoot button and a continues stream of bullets are fired but with a ...
1
vote
2answers
590 views

Collision Problems in Pacman Clone

I am working on a Pacman clone. I am using Java for the project. I have been having problems with collisions, and allowing the player to pass through objects. Note that the tile size (and player) is ...
1
vote
2answers
1k views

Slick 2D first trial error

I followed some advices to learn Slick2D and when I started doing the "SimpleGame" I got my first error. Does anyone have any idea of what is it and how to fix? Sun Dec 26 23:09:12 GMT-03:00 2010 ...
1
vote
1answer
57 views

How can I check for key releases between keyReleased callbacks?

Slick2D's Input class has a isKeyPressed() method that returns a boolean value according to whether the specified key has been pressed. I want to check if a key has been released in the same fashion. ...
1
vote
1answer
110 views

Get Tile Location On Screen (Java Slick and Tiled2D)

I want to create a rectangle around each tile that's blocked value = true. How can I find the X and Y (on screen) coords of the each individual Tile?
1
vote
1answer
190 views

How can I improve the performance of texture switching without resorting to atlasing?

I'd like to use texture images that are not a sprite sheet or other form of texture atlas, mainly because I'll be consistently adding and swapping textures while I figure out the direction my game ...
1
vote
1answer
2k views

How do I detect and handle collisions using a tile property with Slick2D?

I am trying to set up collision detection in Slick2D based on a tilemap. I currently have two layers on the maps I'm using, a background layer, and a collision layer. The collision layer has a tile ...
1
vote
3answers
342 views

Why does my collision implementation cause my player to “bounce” when a collision occurs?

I have a player polygon and I check to see if it's colliding with my tiled map with this method: public static boolean playerCollisionWith() { for(int i = 0; i < Blockmap.entities.size(); i++) ...
1
vote
2answers
198 views

Inputting Only Alphabetical Input - Slick2D

I'm trying to obtain the user input for when they enter their own name. However I would prefer to have it Alphabetically. This is what I'm doing at the moment: if (input.isKeyDown(Input.KEY_A)) ...
1
vote
1answer
192 views

Putting a Java/Slick game on your website?

I've made a simple little 2D game in Java using Slick and I want to embed it in my website. I'm just a little confused as to how to go about it, I'm guessing I need to export it as a WAR file? Sorry ...
1
vote
1answer
274 views

Fixing a collision detection bug in Slick2D

My game has a bug with collision detection. If you go against the wall and tap forward/back sometimes the game thinks the speed you travelled at is 0 and the game doesn't know how to get you out of ...
1
vote
1answer
154 views

Rotate an image in a scaled context

Here is my working piece of code to rotate an image toward a point (in my case, the mouse cursor). float dx = newx - ploc.x; float dy = newy - ploc.y; float angle = (float) ...
1
vote
1answer
413 views

How to I get a rotated sprite to move left or right?

Using Java/Slick 2D, I'm using the mouse to rotate a sprite on the screen and the directional keys (in this case, WASD) to move the spite. Forwards and backwards is easy, just position += ...
1
vote
2answers
2k views

Creating maps and tileset for a 2d java game

I'm not a completly beginner to java, so I decided to write a map loader and a tileset loader myself instead of using a tilemap editor like Tiled. I'm using Slick & LWJGL for my game. The plan ...
1
vote
1answer
228 views

Invert colors Java rendering

I am making a 2d platformer in java using the slick2d engine. I only use 2 colors: black and white. I want to implement a feature were i invert the colors of certain entities. However i can't find a ...
1
vote
1answer
2k views

How do I play background music in Slick/LWJGL?

I'm trying to play music in the background for my opening menu, but cant seem to find a tutorial specifically on how to play a music file. Does anyone know how this can be accomplished?
1
vote
5answers
1k views

Collision detection - player gets stuck in platform when jumping

So I'm having some problems with my collision detection with my platformer. Take the image below as an example. When I'm running right I am unable to go through the platform, but when I hold my ...
1
vote
2answers
2k views

Dynamically load images inside jar

I'm using Slick2d for a game, and while it runs fine in Eclipse, i'm trying to figure out how to make it work when exported to a runnable .jar. I have it set up to where I load every image located in ...
1
vote
1answer
254 views

Slick2D drawString with coordinates from bottom-left corner

For OpenGL text drawing I use Slick2D library. Default Slick2D 0:0 coordinates are at upper-left corner. But in my project I use bottom-left corner for 0:0. Is it real to configure Slick2D with ...
1
vote
3answers
2k views

How do I load tmx files with Slick2d?

I just started using Slick2D and learned how simple it is to load in a tilemap and display it. I tried atleast a dozen different tmx files from numerous examples to see if it was the actual file that ...
1
vote
1answer
690 views

Using Slick2D/LWJGL to brighten an Image

Using the Slick2D Library for Java, I want to know if there is a way to brighten an instance of org.newdawn.slick.Image. I'm willing to use other image-manipulation libraries if need be.
1
vote
0answers
43 views

Slick2D v LibGDX: [closed]

Okay. You might have seen some of these posts on forums here and there, but I wanted to ask this here mainly because everyone here is focused on game-dev and there seems to be quite a few Java ...
1
vote
1answer
63 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 ...
1
vote
0answers
32 views

java slick2d - gettileproperty returns true when it shouldn't

I'm trying to implement some collision detection to a test game i've been making. I've used TiledMap to create the map and set a property on one of the tiles to blocked=true This tile is then drawn on ...
1
vote
1answer
141 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 ...
1
vote
0answers
75 views

Slick2d font rendering makes all other drawings vanish

I'm converting a java game to lwjgl and slick-utils. I've followed the slick2d examples for font loading/rendering but I found that the font shows as a solid box of color unless I add the following ...
1
vote
1answer
348 views

Including slick2d or slick-util in maven build?

I'm converting a project to lwjgl and trying to use slick-util as well. There's no slick-util maven repo anywhere (nor slick2d itself anymore). I've included local dependancies before using ...
1
vote
1answer
130 views

(Java + Slick) How to rotate the Graphics (g) around the X-Axis?

I already tried it by using GL11.glRotatef(45, 1, 0, 0), but the result looks like this:
1
vote
1answer
198 views

Slick2D : translate -> scale -> translate doesn't return to the old position

I am trying to implement zoom using Slick2D library. As I understand, to zoom something on non (0,0) coordinates, we need: translate so the target point is in (0,0) apply scale factor translate the ...
1
vote
0answers
130 views

Steering behaviour [closed]

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
323 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 ...
1
vote
1answer
3k views

Rotation of images in Slick2D

I have have a rotation problem in the Slick2d library, the image is just not rotating (ie I set a rotation but no result is shown). Here is the rotation code: if (input.IsKeyDown(Input.KEY_LEFT)) { ...
0
votes
5answers
406 views

Limiting a player's movement to the screen's dimensions

I have a player, that I can control using WASD. And I don't want him to leave the screen. So I've tried the following: if (player1.getX()+5 < 974 && player1.getX()-5 > 0) { ...
0
votes
1answer
122 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
2answers
806 views

deciding user movement path - slick 2D

i'm going to describe what need to be done... "there are circular areas marked in a map, large areas a person can easily move in to them and out of them" what i'm trying to do is deciding weather the ...