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

How to export slick2d game into a jar with the res and native folder

I am a beginner in Slick2D. I use jarsplice to output Slick2D game. But it is export all thing into one jar. I want to export one jar with the res and native folder .... So I can easily modify ...
0
votes
1answer
41 views

TliedMap render use 15%cpu

I am a beginner in Slick2D. I used TiledMap render in my game,but I do not know why it use 15%cpu and how to fix it. I used map is 1024*768. This is a part of my code. Thanks for any help public ...
1
vote
1answer
21 views

My displayed Tiled map is rendered with different tile indexes than in the editor in Slick2D. Why?

The first picture is what I have in the editor and the second one is what I got when I rendered my map. @Override public void init(GameContainer container) throws SlickException { ...
2
votes
1answer
70 views

Anti-Aliasing Problem

So, I was annoyed by how the HUD for my GameState was very pixel-ated and I wanted to change that through the use of anti-aliasing. However, it works with a small exception: It adds all these lines ...
0
votes
1answer
80 views

How does one structure a Player GUI

I am using Java and the Slick2D library. I've been testing around with ways to develop a Player Graphical User Interface (GUI) (to show armour, items picked up, weapons equipped, etc). The one ...
1
vote
0answers
56 views

Slick2D fails to load small textures

I'm trying to load a small 32x32 png texture using Slick2D, however it doesn't seem to render correctly. What's odd is that larger textures do load correctly. The 32x32 texture I'm trying to load: ...
0
votes
0answers
21 views

LWJGL + Slick2D

Okay, so I know collision detection. I have made plenty of games in Java (without LWJGL or Slick2D) that use Side-Scrolling Tile Maps and collision detection, but the player seems to be glitching ...
5
votes
1answer
106 views

On a 2D generated terrain what is the easiest way to pick tiles for the shoreline?

If I have a two-dimensional array with ones and zeros for water and land respectively how do I choose what shoreline tile to use according to the water and land tiles surrounding it? The shoreline can ...
1
vote
2answers
79 views

How do I calculate the tangent to a point on a circle?

I have a line that is from the center of a circle to a point on it's edge that is changing constantly (radius is drawn to a point orbiting a circle) I want to make a line tangential to the circle ...
0
votes
1answer
41 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
50 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
34 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
63 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
114 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
45 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
48 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
65 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
39 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
41 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
76 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
126 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
41 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
59 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
64 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
16 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
72 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
2answers
67 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
98 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
36 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
37 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
74 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
67 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
108 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
109 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
43 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
85 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
119 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
154 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
39 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
90 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
958 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
82 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
26 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
39 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
66 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
64 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
109 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
293 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
86 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
54 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), ...