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
0
votes
2 answers

Java Slick: Keyboard Input

I'm doing my own input window with slick, user will need to type something into this. But when I type any letter I get more than one. I assume it depends on CPU, my current bypass is to sleep thread for 100 ms whenever I type. Is there any other way…
ashur
  • 4,177
  • 14
  • 53
  • 85
0
votes
1 answer

ClassNotFound Exception when running applet in browser

So I'm trying to run a little applet I made using Slick 2D on my website. I've wrote the following HTML and put it on a new page on my site
Nile
  • 25
  • 2
  • 11
0
votes
2 answers

java game - slick - collision handling

How can I manage collisions in slick ? I created map and every tile which is wall have option blocked = true; How to implement collision, that if I hit wall, I can move trough it? Also if I reach edge of map, block movement. package…
Ing. Michal Hudak
  • 5,338
  • 11
  • 60
  • 91
0
votes
2 answers

Java for loop - (i * 16) evaluating to 0 for all values of i

Probably missing something basic, but I have a for-loop in my program that's supposed to iterate over an array (lines[]) and draw them onscreen (using LWJGL/Slick). Instead of the lines being shown on separate lines (at (i*16 + 7, 5)), they all…
0
votes
2 answers

JavaNullPointer for image

I have this code for my player class: public class Player { private static Image front; int posX = 400; int posY = 300; public void player() throws SlickException{ init(null, null); render(null, null, null); update(null, null,…
user1650305
0
votes
1 answer

Collision Detection in Slick 2D for Java

I'm new to Java Game Development, as well as Slick 2D, and I'm making a platforming game like Mario or Sonic. Anyways, I'm having trouble with collision detection. I have the code set up, but my player keeps going through the map. I am using Tiled…
Swoldier
  • 155
  • 5
  • 19
0
votes
1 answer

How to prevent the player from entering "blocked tiles" - java

I'm using Slick2d to create a game in java it i have run into a problem. I have no idea how to prevent the user from entering "blocked tiles". Does anyone have any tips on how to do this? Edit: It's not the actual checking if there is a collision…
0
votes
1 answer

Try to add VBO in Slick2D

I'm trying to add VBO in slick2D. All I find on the web is how to initialize VBO in a 3D context. Anyone knows how to do it in 2D ? My actual test (make 4 square in slick context) make this (i add corrds in black) : (source: canardpc.com) . Below…
Cyril ALFARO
  • 1,616
  • 17
  • 35
0
votes
1 answer

Slick2D Easiest Way Of Positioning Images Using GameContainer.setDisplayMode(GameContainer.getScreenWidth(), GameContainer.getScreenHight(), true);

I'm making a game in slick2D and i wanted the game to adjust resolutions acording to the screen being used, so when i initialize my AppGameContainer i call it as the following shows AppGameContainer appgc; try{ appgc = new…
Josh Jackson
  • 119
  • 1
  • 2
  • 9
0
votes
2 answers

Referencing indexed Arrays

Possible Duplicate: Checking against indexed arrays So i have my code, every time the mouse is pressed it draws a new particle at mouseX and mouseY and stores the position in an array so it can update until told to stop when it reaches the bottom…
user1610541
  • 111
  • 1
  • 11
0
votes
1 answer

Stopping image movement

okay, so i have my image move straight down along the y axis whenever i click the mouse, my only problem is i don't know how to get it to stop when it hits the bottom of the screen, can someone please help? import java.awt.Point; import…
user1610541
  • 111
  • 1
  • 11
0
votes
1 answer

How to make a resource loader that will work with Slick2D

so i have made a 2D game using slick however the only resource loader that i have ever made is for plain java and it went like this : import java.awt.Image; import java.awt.Toolkit; public class ResourceLoader { static ResourceLoader rl = new…
Josh Jackson
  • 119
  • 1
  • 2
  • 9
0
votes
2 answers

Why is my image rotating off center?

I'm using Java/Slick 2D to play with graphics and using the mouse to rotate an image. Something strange happens though: the image doesn't necessarily face the mouse. At 45 degrees from the normal line it does, but the further you get, the further…
rphello101
  • 1,671
  • 5
  • 31
  • 59
0
votes
1 answer

Java arrays - Keep getting NullPointerExcpetion

So I'm trying to make a game where I spawn 20 enemies. The enemies are supposed to be loaded into an array of enemies, and then the game is meant to draw them out in a for loop, the only issue is that I keep getting a NullPointerException when I try…
Michael Curry
  • 991
  • 8
  • 20
0
votes
1 answer

Make Nifty GUI ScreenController swallow input

In my Slick2D game, I'm extending NiftyOverlayBasicGameState, using Nifty GUI overlays, and specifying a PlainSlickInputSystem. For most overlaid screens I'd like Nifty GUI to ignore all input and pass it through to the GameState. For one particular…
DeejUK
  • 12,891
  • 19
  • 89
  • 169