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
25 views

Slick2d - state change problem

In my slick-based game, I have 4 states - introState, gameState, pauseState and menuState. From the gameState, I want player to go to either menuState or pauseState. To do that, I did this in ...
-3
votes
0answers
39 views

What is the use of “ translate (float x, float y) ” in slick2d? [on hold]

How does the translate method works in slick?
0
votes
0answers
31 views

Slick 2D - how to substract two vectors?

I have two vectors:- Vector2f enemyVec = new Vector2f(enemyX, enemyY); Vector2f playerVec = new Vector2f(playerX, playerY); According to docs, I can use the "sub" method to substract two vectors ...
0
votes
1answer
51 views

Collision bug with gravity in slick2D

I have fixed some of the previous problem. The collision when running into a corner(a wall on two sides) however is still not working. When the player runs into a corner he just falls down and out of ...
0
votes
1answer
52 views

Fade into splash screen on game load

I'm using Slick2D and LWJGL for my StateBasedGame and I was wondering if there was a way to enter into my splashscreen on application load using a transition? I tried using: this.enterState(SPLASH, ...
-3
votes
1answer
35 views

How can I perfectly center an image in a window using Slick2d?

Dividing the window's width by two to position it in the middle of the x-axis did not work. What else can I do?
0
votes
1answer
63 views

lwjgl and slick util text over textured quad

So, I load a TrueTypeFont like this: private TrueTypeFont trueTypeFont; try { InputStream inputStream = ResourceLoader.getResourceAsStream("assets/fonts/main.ttf"); Font ...
0
votes
1answer
45 views

How can I make an soundsystem with slick?

My Question would be , how can I develop an easy-to-use Soundsystem under slick-util? Under the function a.playAsSoundEffect(1, 1, true, x, y, z); it allready works to create a static ...
1
vote
0answers
193 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 ...
0
votes
0answers
26 views

Slick2D changing image's color with drawFlash and using alpha

I have an image, where I have a round soft white feathered ball in the center of it. I plan to use it for my lighting in my 2D game. I could not find any proper way to drawing lighting with many ...
0
votes
0answers
55 views

Slick2D/LWJGL Drawing coloured lights problem

I am using the Slick2D engine. I've followed this snippet for creating light sources. I have followed step step, added what is actually important for me, and tested it and the lighting effects ...
0
votes
0answers
22 views

Drawing jbox2d shapes in slick2d

How would be the best way to go about drawing polygons in slick after forces where applied to them via jbox2d? There seems to be no way to get the vertices of a body defined in jbox2d...
0
votes
1answer
95 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
159 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 ...
0
votes
1answer
54 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, ...
1
vote
1answer
104 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
73 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. ...
4
votes
1answer
91 views

Why is my Slick2D spritesheet animation cut off when it loops?

I am loading a SpriteSheet with Slick2D and using the Animation function in the render method to display it. The spritesheet loads perfectly, but when the animation loops, it does so moved down a few ...
2
votes
1answer
156 views

In Slick2D, how can I generate a 2D platformer map from an image?

I'm fairly new to game development. I've been messing around with Slick2D. My map consists of rectangular objects. I want to use an image to represent my map, similar to this: How could I generate ...
0
votes
0answers
61 views

Cube projection composed of smaller cubes not lining up

I am trying to make a cube projection composed of other cubes, similar to a Rubik's cube but completely static. I can get one cube to work, but when I join multiple, they don't line up. I am using ...
0
votes
1answer
68 views

java slick2d - key press being ignored

I have the following in my update funtion. The first input for key_enter when textPos!=2 works fine, but the one when textPos==2 doesn't work. The key up and down work fine though. The ...
0
votes
1answer
109 views

Why does my character move up forever when he jumps with this code?

I've been doing some stupid stuff in Slick2D+LWJGL and I've run into a problem. I press the UP arrow and my character continues to go up until I let go :/ Here's the code: if ...
1
vote
0answers
62 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
votes
1answer
187 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
27 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
74 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
66 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
88 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
120 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
106 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
77 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
122 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
201 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
217 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
183 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
218 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
160 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
votes
1answer
444 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
324 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
299 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
201 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
89 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
272 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
395 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
69 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
49 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
82 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
451 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 ...
4
votes
1answer
1k 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
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 ...