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
0answers
43 views

Problem with Pixels In The Game

So, in the game that I am developing, there is an issue with the pixels for the different objects. This is a problem as it makes the game a little awkward. Essentially, the pixels for a house in the ...
0
votes
0answers
14 views

Slick2D Simple StateBasedGame not working

I recently started trying to work with outside Java libraries like Slick2D. This is my first time doing so, so I basically have no clue what I am doing. I tried making a simple StateBasedGame that ...
0
votes
1answer
22 views

Slick & LWJGL Flickering Problem

I have an flickering problem with rendering tiles. Rendering Method. int tileSize = TileManager.tileSize; for(int y = 0 ; y < mapHeight ; y++){ for(int x = 0 ; x < mapWidth ; ...
0
votes
0answers
17 views

How to hook up mouse listener in Slick2D

I'm trying to code a "Button"-class in java using the Slick2D-GameEngine. Does anyone who is familiar with this engine know where and how exactly to hook up this class to the GameContainer's ...
-1
votes
1answer
36 views

Java Move towards point

Ive made this 'game' where you can fire an aibility (a fire ball for instance) from the player towards the mouse (to the point where the mouse was at the time of casting/fireing/shooting the ball), ...
0
votes
1answer
76 views

Good Resources for Random World Generation [closed]

Is there a good reference or tutorials available for adding world generation into a 2D game? I've gotten to the point where I have most of the resources available to add world generation but I don't ...
2
votes
1answer
26 views

Slick2D Networking Crash

This is my first post, so I apologize if it's been put in the wrong place or something. Anyways, here's my problem: I've run into an issue with running my client-side code in one of my game-states. ...
0
votes
1answer
28 views

Drawing from an ArrayList drawing same image repeatedly (Slick2D)

This is the game I'm working on. I isolated the problem into this class. public class Runa extends BasicGame { int startTime, tracker; public ArrayList<Circle> circ = new ...
0
votes
0answers
38 views

Rhythm game timing not accurate enough (CPU workaround?)

I had an idea that I would 'play' my rhythm game first and have the times at which I hit the key output to the console, so I could use those values minus the hard coded in time it takes an object to ...
0
votes
0answers
35 views

Problem with Collision Detection

So I am adding collision detection into my game but whenever I start the game I get a rendering crash saying that there is a 'Game.update() failure - check the game code.' I have repeatedly tried to ...
1
vote
1answer
24 views

Error When Loading a .tmx TILED map through the TiledMap class

So I made a map using the TILED application and I have it as a .tmx for reasons, but whenever I use the TildMap class in the Slick2D library to render the map on the screen, it gives me an error. Here ...
0
votes
1answer
72 views

Is It Better To Generate A Pre-Generated Map or A Randomly Generated Map When Using Tile Properties? [closed]

So I am contemplating whether or not to add a Pre-Generated Map or a randomly generated map into my game. But I also need to add Tile properties into the map (i.e. so that water tiles aren't being ...
1
vote
2answers
116 views

How to make a “Camera” in Java

I need some help with getting my camera to work in java for a game that I am making. The problem is is that I've never made a camera in a game before and this is my first time trying to make one in a ...
0
votes
1answer
26 views

Stopping Animations For Player In Java Using Slick2D

I have a problem with stopping animations for a player in Slick2D. I have tried many solutions to the problem and have looked up a couple of resources but I am still stumped by the fact that it is not ...
0
votes
1answer
53 views

Java 2d topdown collision

Im making a game and Im working on the collision. First Ill tell you what I want (Ill put in pictures), then Ill leave the code. What I want: I want the player to stop exactly before its collision ...
0
votes
0answers
44 views

Framebuffer texture shows as blank white when rendered after TrueTypeFont

I have a working framebuffer class. However, when I render out the framebuffer after rendering text with Slick2D's true type font class, it is completely white. Below is all of the classes that are ...
0
votes
0answers
13 views

Is it possible to draw outlines of images in Slick2d?

Im making a game and I've woundered if there is a way to draw an outline to an image with the slick drawing API, because Im using pixelart so it's kindof nasty to draw the outline within the sprite ...
-1
votes
1answer
57 views

Java map creation

So Im making a topdown 2d rpg in slick2d and lwjgl 2, and I wanna make a map, but not just random map, something like this: The blue stuff is water and rivers, the gray in the middle is "the ...
0
votes
1answer
38 views

Java Slick2d image depth/layering

Im making a topdown 2d game, and I've made a decent entity system so far. But I want to do the following with it: I want to have drawing depth, so if a , for instance, tree is above another tree then ...
2
votes
1answer
83 views

Slick2d fullscreen with black bars

NOTE: I am moving this question here from Stack Overflow because I feel it belongs better on this forum. I am deleting the original question from Stack Overflow. I'm working on a game in Slick2D and ...
2
votes
1answer
28 views

Slick2D How to add a method from a diffrent class to a method

I am trying to get keyboard input in a separate class so everything doesn't look as messy. I get the following error message Exception in thread "main" java.lang.NullPointerException at ...
2
votes
1answer
27 views

Java Slick2D how to draw text with a centered alingment

I've made a button class that can be drawn and clicked on. How can I write the text of that button (using the slick drawing API, g.drawString()) with a Centered alingment (so that the text is exactly ...
1
vote
1answer
66 views

Java heart based health mechanic

so I've made a basic game in java w/ LWJGL 2 and Slick. Right now Im working on the hud and health system. I'm kindof trying to get a minecraft like health system, 15 hearts for health,but I want the ...
1
vote
1answer
43 views

Java game LWJGL input doesnt work properly

Im making a game in LWJGL 2 and Slick2d. Im trying to add an item to my inventory by releasing a key (the inventory system works properly, the part where I have to see if the button was RELEASED is ...
1
vote
1answer
83 views

Java LWJGL inventory using ArrayList

I'm making a game in Java with LWJGL 2.9.3 and Slick2D, and I'm working on creating an inventory. I managed to set it up almost completely, but I ran into a problem. When I'm rendering the slots, only ...
1
vote
1answer
68 views

Java Slick2d lighting using Raycasting

I am trying to make a top down view game in java using the Slick2d library, for lighting I wanted to do something like this : http://www.redblobgames.com/articles/visibility/. I was wondering if there ...
1
vote
1answer
38 views

Java delaying commands in a method with time (Sys.getTime)

LWJGL 2.9.3 and Slick2D Hello, so Im making this game and its going quite well, but I cant figure this out: Ive got a 2d tile based map (wich is stored in a 2d array) and each tile has a coresponding ...
2
votes
1answer
68 views

How do I stop off-screen tiles of a 2D tilemap from being rendered?

I am seeing lag because I render all tiles in my map at once. How can I exclude off-screen tiles from being rendered? My tiles are 32×32 and my player is always in the centre of the screen. Here is ...
1
vote
1answer
92 views

Getting the tile over wich the mouse cursor is

Im making a tilebased game, I have the rendering, the main engine, everything setup nicely (btw Im using LWJGL and Slick). Now this is more of a math question. How do I get the tile the mouse is on, ...
1
vote
2answers
106 views

Random white lines appearing while translating rendering slick 2d images

Hmm I'm getting this weird problem that i think may be a bug with slick but when ever i translate an image in slick 2d for some reason a weird white line appears on the left side of every image like ...
0
votes
0answers
31 views

Java LWJGL and Slick2D collision with 2d array based map

So I've been making this game recently in java w/ LWJGL (2) and Slick2d. I've done some stuff like the map; it's a simple 2d array it goes through it and based on what id it is its gonna draw that ...
0
votes
0answers
64 views

How to get set up with java, eclipse, and slick 2d?

I have some experience in Java and other languages. I want to make games in java, and through my digging around it seems the LWJGL library is the way to go. I am trying to use Slick2D ...
6
votes
3answers
949 views

How do I accept only one directional input per update?

I'm coding "Snake" as my first game and I'm facing the logical fail when pressing multiple keys simultaneously eg. { up, right}; {up, left}; {down, right}, etc. Snake is able to go back and forth and ...
0
votes
2answers
69 views

Most efficient way to mass render tiles in java slick2D [duplicate]

So I am trying to make a tile based game, it is rendering about 40 tiles on the screen at once. I get about 40 FPS on an okay computer. When I tell it to not render the FPS jumps to around 400 so I ...
0
votes
0answers
25 views

Slick2d - How to change one pixel color with another from Image?

How would I replace one color throughout an entire image with another color in runtime? For example, replacing all red with green from an image. The only way I can think of is to loop through each ...
0
votes
0answers
33 views

Slick2D Java Applet

I created small game in Java using Slick2d library. I wanted put my game into webpage as java applet like here. I added my site to java exception site list. When i try to run page it is wrote: "An ...
0
votes
1answer
55 views

Rectangle moves faster to the left than to the right

I am using Slick2d to create a top-down game, however an rectangle than I am drawing to the display is moving faster to the left than to the right, and faster up than down. I am updating frames like ...
0
votes
2answers
51 views

LWJGL True Type Fonts - Calculate width and height of box

I want to center some text on the screen. At the moment I divide the display height and width by two, and then render. But I also need the height and width of the textbox, so I can subtract it from ...
0
votes
0answers
96 views

Slick2D doesn't render hexagonal TiledMap from Tiled Map Editor properly

I'm new to Slick2D and Tiled so I might be missing something crucial although I've done my research and came up with nothing. I'm trying to create a hexagonal grid using Tiled Map Editor (v. 0.12.3) ...
2
votes
2answers
264 views

Swing GUI for games (performance) [closed]

I'm developing a game in Slick2D and I'm trying to make GUI. I've already tried TWL library, but it seems to me a bit complicated and it doesn't cover what I need. In my own implementation of GUI ...
1
vote
1answer
73 views

Drawing text with Slick

I've been trying to draw a text to the display using Slick. However, when ever I draw the TrueTypeFont to the screen, it draws it reversed upside down and also, it makes the whole display turn black. ...
0
votes
0answers
49 views

How to Move Image Based on Rotation Java Slick2D?

I am trying to rotate image based on rotation. I am unable to do so. Here is my code Vector2f direction = new Vector2f((float)Math.cos(Math.abs(imgIcon.getRotation()) - anglecorrection), ...
0
votes
0answers
61 views

Slick2d - apply shader

I have a problem. I'm trying to apply a shader to the whole screen. Since I haven't used shaders before I don't know how to pass the texture to the shader. Everything else works... So here are the ...
1
vote
1answer
107 views

How to map texture to shape in Slick 2D

I need to map texture to shape. Texture: This is a example of shapes I need to map texture to: Notice that each piece in mesh has exactly 4 point to map texture. Logic is pretty straight ...
0
votes
0answers
144 views

Java Slick2D rotating a Shape using transform(Transform.createRotateTransform())

I have spent most of the day trying to debug this tiny piece of code, and I can't for the life of me figure it out. I'm making a pong game for the Mini Ludum Dare currently going on. I am programming ...
1
vote
1answer
62 views

Slick2D crashes on Image.getGraphics() on some machines

On some machines, creating a new Image and calling getGraphics() on it causes lwjgl to enter into some kind of faulty state that crashes when swapping buffers. Any idea what causes this and how to ...
1
vote
1answer
85 views

How to distort graphics in a wave-like way?

I saw a certain graphics distortion effect on multiple games over time and am interested in doing it in 2D. It is like a wave-like texture distortion, I am not entirely sure what it is called ...
0
votes
0answers
25 views

How to display armor/equipment on a character? [duplicate]

I've been working on an Online 2D RPG mostly for fun and for getting a basic understanding of Socket Communication, packets, and just basic game development. Like most RPGs there is some kind of ...
1
vote
1answer
100 views

Use Slick2D for standard application instead of game

I was wondering how well Slick2D would work when used for a custom rendered GUI in a standard application? A standard application not being a game. More like a text editor or 2D level editor that ...
0
votes
0answers
262 views

How import and draw a tiledmap with slick2d

How I can import and draw a tilemap with different layers? I have the next code and send me error if the tilemap have more than one layer. public class Map { private TiledMap map = null; ...