Questions tagged [slick2d]

Slick2D is a wrapper around the LWJGL OpenGL library for Java.

Slick2D is a simple, Java-based 2D game development library. You can read more about it on the Slick2D homepage.

The goal of Slick2D is to provide Java game developers with a library that handles gaming sub-systems, so the developer can focus on building their games. Library features include:

  • Hardware-accelerated graphics via a OpenGL
  • Complex audio rendering via OpenAL
  • Input handling for keyboards, mice, and gamepads/controllers
  • Several 2D game primitives, such as sprites, images, 2D tile maps
  • Geometry helper classes that facilitates collision detection
  • Path finding helper classes for path planning and route calculations

Slick2D is multi-platform, with desktop support for Windows, Mac OS X, and Linux. At the time of this writing, an Android Edition (SlickAE for Android development) has been discussed, but not released.

Note: The other slick tag is related to a Scala data access library, which is unrelated to this tag.

726 questions
2
votes
0 answers

Small lag spikes using Display.sync, LWJGL

I recently started using LWJGL to get into game programming in Java from C#, and I have a basis for the game I am making set up and working, but there is a small problem with lag. The game runs at a constant 60 fps but every few seconds all of the…
tcoy
  • 179
  • 1
  • 3
  • 11
2
votes
2 answers

Vertical Healthbar

Right now I'm working on a game and I'm implementing a health bar. I got stuck making the right formula. This is my code of the Hud you see in the image: public class CharacterHUD { private Image image; private Player player; private…
Timon de Groot
  • 7,255
  • 4
  • 23
  • 38
2
votes
1 answer

xml FileNotFoundException using slick2D library in java

private ConfigurableEmitter emitter; File xmlFile = new File("ressources/emitter.xml"); emitter = ParticleIO.loadEmitter(xmlFile); If I launch the project in eclipse, everything will works fine, but after I export my project and use JarSplice to…
Theriotgames Riot
  • 333
  • 3
  • 6
  • 14
2
votes
1 answer

Java - Tiled Map Objects

I'm trying to make a basic 2D game using Slick2D with the Tiled Map Editor. I have figured out how to do basic collision detection using TileProperties but I'm not sure how Objects work with the map editor. I'm trying to do two things (if they're…
Rayexar
  • 33
  • 1
  • 5
2
votes
3 answers

Finding if my mouse is inside a rectangle in Java

I'm starting to develop a game and I need to be able to see if my mouse is inside a rectangle, I've tried using .contains for a rectangle but i can't seem to get it to work, i'll paste my code below, any help would be greatly appreciated! :) public…
Angus Allman
  • 511
  • 1
  • 6
  • 10
2
votes
0 answers

Java Slick2D: Is it possible to turn a slick Image into a bufferedImage

Is it possible to turn a slick2D image back into a buffered image?
Bevilacqua
  • 465
  • 3
  • 8
  • 19
2
votes
2 answers

Slick2d | Shooting with same speed

The problem: I succesfully implemented a shooting mechanism into my little game, but there is a problem. The speed of the bullets are faster if my cursor is further from the player, and slower if the cursor is closer to the player. So my question…
HUNeater
  • 166
  • 3
  • 16
2
votes
2 answers

Java StateBased Game - Run outside of eclipse

I have created a game using LWJGL and Slick2d. I tried exporting my game as a runnable JAR, but when I double click the JAR nothing happens. Is there any way to find out why it isn't working or another way to run my program outside of Eclipse? If…
Gratin
  • 113
  • 3
  • 15
2
votes
1 answer

Java slick statebased game - state returns null point error

I am trying to use java slick to create a basic state based game. The 3 of my stages work fine, but for some reason the other 5 cause a null point exception when I call the get state method. All states are initialized and added to the game in the…
ben steer
  • 197
  • 1
  • 10
2
votes
1 answer

Putting my Java Slick game onto a website

I have made a GUI in Java using State Based Game, as it extends StateBasedGame and not JApplet its not a true applet, I want to put it on a website and am unsure on how to do this, I have been told that the following code allows me to make this into…
Rahul Khosla
  • 349
  • 9
  • 21
2
votes
0 answers

Java slick, html cant find AppletLoader

I have made a java game using slick state based game, as my game extends StatBasedGame it is not a true applet because it doesnt extend JApplet, so to solve that problem there is a method build in with slick which can be used in html. I had found…
mamta rani
  • 133
  • 1
  • 2
  • 7
2
votes
2 answers

Is there a way of placing a video in my Java game main menu

I have made a simple Java game, when I load the game a start-up menu pops up with a simple play button and a close button, if I press the start button Java changes to another class which takes the user to the game, if I press close the game shuts…
Rahul Khosla
  • 349
  • 9
  • 21
2
votes
0 answers

Java game in slick fps extremely high

I am creating game in Java using Slick, but there is a problem when I upload and run it on my www as an applet. The FPS are extremely high, even when I put some limit on it in my code. MainWindow.setTargetFrameRate(60); When I run the game on my…
Modziek
  • 61
  • 4
2
votes
1 answer

Java LWJGL blinking states

I have a problem, that when i hit the Return key, in the state INTRO (as default) it have to switch to GAME state. It does, but when it does, it blinks between INTRO and GAME State. The Text blinks, and the bar at the bottom blinks. I'd try to print…
Kevin Jensen Petersen
  • 423
  • 2
  • 22
  • 43
2
votes
1 answer

One Slick texture is blurry, one not

I want to bind two different textures to a cube using the Texture class of Slick. The problem is that the first Texture I bind to the cube is shown correct, namely pixelwise but the other one I bind to the sides of the cube is blurred, as if I…
skappler
  • 722
  • 1
  • 10
  • 26