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

learn more… | top users | synonyms (1)

0
votes
1answer
16 views

How do I create a scalable Slick2D game?

I'm trying to make my Slick2D game maximizable and minizable. This code is the most relevant my searching has turned up. What is it? How should I implement it or use it? (I read the web but I didnt ...
-1
votes
1answer
35 views

Slick2D: Resizing the Window

I am using Slick2D, and I wanted to know which is the best way to resize, maximize, minimize the window, For example, Resizing all the images or scaling them, or Slick2D has an integrated method, Any ...
0
votes
1answer
16 views

lwjgl slick textures and glTexParameter

How to make textures fill all area as it is specified? I'm getting small gaps if the texture is smaller than area example: gl_quads setup like these: -1f, 1f, 0, -0.98f, 1f, 0, -0.98f, -1f, 0, ...
0
votes
1answer
27 views

Slick2D: Animation not being parsed from spritesheet correctly

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so: spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192); ...
1
vote
1answer
43 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. ...
0
votes
0answers
30 views

How can I draw a part of a texture in slick2d?

I know the method for drawing a region of a texture in slick2d: image.draw(x, y, srcX, srcY, srcX2, srcY2); But I have no idea how the texture coordinates work. To draw a region of x:16, y:16, ...
0
votes
2answers
76 views

Slick2D: constructor vs. init method

What is the difference between the constructor of a BasicGameState and the init method? It appears that they are both called at the same time when the BasicGameState is registered in StateBasedGame, ...
0
votes
0answers
50 views

LWJGL Rotating is moving

I am trying to rotate my QUAD even just a little bit. I have read pages like http://www.java-gaming.org/topics/lwjgl-tutorial-series-moving-and-rotating-triangle/30679/view.html In my render() ...
1
vote
1answer
39 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
64 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?
0
votes
1answer
143 views

2D Tiled Map - Small tiles or big tiles with pixel-precise movement

I am using Java - LWJGL - Slick2D . I have tried to do a proper collision detection with 32 x 32 tile size but failed three times. I just cant get it to work! I found a youtube video that was using ...
0
votes
2answers
102 views

How can I move a created Image in Slick2D?

I want a image to follow the mouse, and I use Image class of Slick 2D: public void init(GameContainer gameContainer, StateBasedGame stateBasedGame) throws SlickException { mouseImage = new ...
2
votes
1answer
160 views

How do game developers make their game available for most of the resolutions?

I'm developing a game with Java using Slick2D and I want to make a game that could target all the recommended resolutions, as you can see in almost every game you could have an option of changing the ...
1
vote
1answer
152 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
106 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 ...
0
votes
1answer
231 views

LWJGL font not rendering, even with depth test and texture_2D

I'm running into an odd little problem here. I'm attempting to render a basic console over my LWJGL-based application, which should be easy enough through a decorator pattern of renderers (as in, one ...
0
votes
2answers
186 views

Slick2D - Entities and rendering

I have been trying to create my very first game for quite a while, followed some tutorials and stuff, but I am stuck at creating my entity system. I have made a class that extends the Entity class and ...
0
votes
1answer
186 views

Java Slick2D - Problem using ScalableGame class

I am having a problem adjusting the size of the screen while using the ScalableGame class from the Slick2D library. I would like the background and objects (images and graphic shapes) to adjust to ...
1
vote
1answer
141 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 ...
0
votes
1answer
82 views

Streaming resources

I'm writing a game using the Slick2D library. I recently added a loading screen using deferred loading. I use the Music class to load OGG files to be used as music. These take an excessive amount of ...
0
votes
0answers
162 views

Java Slick2D rotating Shapes

I'm having a problem with rotating a Shape in Slick2D for Java I have a code in screen render which works properly: Shape box = new Rectangle(100,100,32,32); box = box.transform( ...
0
votes
3answers
360 views

Tile Map World Background

I am making a 2D top-down game in Java using the Slick2D library. However, this question applies to all ways of making games of this nature. My question is: How would I do a background for the world. ...
0
votes
0answers
56 views

Slick - create new texture from part of existing texture

Say I have the following image: I want to resize this texture, so I can have resizable buttons with a texture. Now, as you can't repeat a certain area of an image in OpenGL, I have to create a new ...
2
votes
1answer
42 views

What measurement units are used in the return value of the getWidth method in the UnicodeFont class supplied by Slick2D?

I'm working on a small component for a game that essentially wraps the provided String so that it fits within the width of the provided rectangle. The rectangle is provided by the Slick2D library as ...
1
vote
0answers
58 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
209 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 ...
0
votes
0answers
79 views

Nifty-gui and Slick2D, how do I set it up?

I'm trying to set up Nifty in Slick2D. I'm new to Slick2D and Nifty but I have some experience with Java. Following the guide: ...
4
votes
1answer
367 views

How do I draw a full resolution texture to a window of the same resolution?

My image is 1280x800, and my screen size is 1280x800. It should draw perfectly. I'm creating a quad the size of the screen, and setting the texture to fit the quad. But right now it draws a square ...
1
vote
1answer
1k 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
1answer
119 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:
-2
votes
3answers
518 views

LWJGL vs Slick2D vs OpenGL. What is the difference?

I was wondering what the difference was between LWJGL, Slick2D, and OpenGL. If I'm not mistaken LWJGL is a library and it has the methods and such, but what are the other two for and how do they use ...
0
votes
1answer
364 views

Slick2D and Nifty GUI

I am currently trying to combine both slick2d and nifty to work together. I've had some amount of success - I can now actually run my test and it won't crash. As far as I can tell, it will also ...
1
vote
0answers
114 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 ...
5
votes
3answers
192 views

Serialization of objects problem

i have a problem with serialization (saving and loading game variabiles), when i save evreything seems to be saving correctly but when i try to load it only detects first 3 objects i saved and the ...
1
vote
3answers
320 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
votes
1answer
284 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
vote
0answers
115 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
2answers
119 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); ...
0
votes
1answer
116 views

How can I compute the average color of a texture?

I'm making a mini-map system for my tile based game, and I thought the best way to accomplish this would be the following: At the beginning of the game, I calculate the predominant color of every ...
0
votes
1answer
89 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 ...
3
votes
1answer
255 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 ...
0
votes
0answers
35 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
1answer
186 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
1answer
111 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 ...
-2
votes
1answer
119 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
111 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
71 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
133 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?
0
votes
1answer
104 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 ...
-2
votes
1answer
129 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; ...