Questions tagged [slick]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

Rotating an image in Slick2D in place in a tiled map?

I just finished writing a parser for TMX data (Tiled maps), and the way Tiled handles rotated tiles is by using three bit flags for flipping an image horizontally, vertically, and diagonally, to allow ...
1
vote
1answer
51 views

Playing one song after another results in horrible grinding noise; how can I fix this?

I'm currently working on a game using slick2d java framework and I want to set it up so that the intro to a piece of music will play once, then the main body of the piece loops infinitely. I've got: <...
2
votes
1answer
54 views

Z axis in slick2D

Firstly, I'm very new to slick2d, java, and coding in general, so if I apologise for any very obvious or basic errors that I've made. I'm developing a JRPG type thing in slick 2d and the battle ...
0
votes
1answer
40 views

How to create post-processing effects in Slick2D?

As I get closer and closer to the end of the feature development for my game and the beginning of the graphical overhaul, I keep thinking of ideas for graphical effects that would make my game even ...
0
votes
0answers
6 views

Slick2D - Update method interrupted while dragging window

I am currently making a project using Java and Slick2D (yes I know there is no support for it anymore, but it is an old project I wish to complete, and it serves me fine so far). There is only one ...
4
votes
1answer
179 views

Wind-blown fire particle effect from scratch

I want to create an effect of fire and be able to give it a variable amount of "wind" to make it blow to the side. I don't want the particles to just curve off to the side, but to flow through the air ...
0
votes
1answer
138 views

Issue with OpenGL texture rendering

I am developing a game in Java using LWJGL2 and Slick, and I am encountering an issue when rendering a graphic. Instead of filling the quad with the texture, it appears to be partly repeating it. The ...
1
vote
1answer
171 views

Character getting stuck when colliding from the top

when my character goes onto a box that I am trying to make him collide with he gets stuck. The way I have it configured is that at the end of every frame, the characters x and y values are stored in ...
1
vote
1answer
197 views

Slick 2D Image move along with shape

I am trying to move my image along with the shape so I can make the collider with the shape (some kind of space shooter) but my image does not move along with the circle I make for it. It dissapears ...
1
vote
1answer
159 views

How to run JarSplice from the command line? [closed]

I've tried java -jar jarsplice.jar --help and "" /? which just launches the UI. I'd like my game to automatically be packaged ...
0
votes
2answers
126 views

Running Slick2d outside of the IDE

I am looking for advice how to solve an exception I am getting, I've looked around and seen people get the same error but most people whom had it seems to run on old graphics drivers and once they ...
0
votes
2answers
72 views

How do I pass my objects to the update method?

I've had formal education in Java for around half a year now, and as a hobby I would like to attempt game development. I've downloaded the Slick2d library to help with this. I've run into a problem ...
0
votes
1answer
246 views

How do i eject bullet shells from a gun? Java/slick2d

So, here is my problem: I am working on a top down 2d shooter in Java and have a character, which can move and rotate/fire to the mouse direction. Shooting guns etc. works fine but now i am trying to ...
0
votes
2answers
223 views

Failed to initialise the LWJGL display

I added the fix of adding this line "Dorg.lwjgl.opengl.Display.allowSoftwareOpenGL=true" to vm arguments, updated my drivers but nothing is working......my error message still remain same has shown in ...
0
votes
1answer
623 views

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

I am a beginner in Slick2D. I use jarspliceJarSplice to output Slick2D game. But, but it is export all thingexports everything into one jar. I want to export one jar with the res andand native ...
1
vote
1answer
119 views

TiledMap render uses 15% of my 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 ...
1
vote
1answer
113 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. ...
2
votes
1answer
324 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
207 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 ...
5
votes
1answer
407 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
521 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
180 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
122 views

Slick & LWJGL Flickering Problem

I have an flickering problem with rendering tiles. Rendering Method. ...
-1
votes
1answer
663 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
834 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 ...
3
votes
1answer
175 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. ...
1
vote
2answers
749 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. ...
1
vote
1answer
272 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
102 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
392 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
303 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
288 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 ...
-1
votes
1answer
477 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 ...
3
votes
3answers
520 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
176 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
67 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 ...
2
votes
1answer
555 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
139 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 ...
4
votes
1answer
250 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
316 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 ...
3
votes
1answer
421 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
97 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
316 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
2answers
1k 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
536 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
129 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 ...
6
votes
3answers
1k 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
380 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
1answer
188 views

Why does my rectangle move faster in one direction than in the opposite?

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
197 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 ...