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

Slick2D - TextFields not working

First, I have searched and found many problems and solutions for this and NONE of them worked. In my game I have multiple states, one of them has 1 text field (which is working) and another has 2 text fields (where none of them is working) and I…
Pali
  • 1,337
  • 1
  • 14
  • 40
2
votes
1 answer

Java/Slick2D Camera not following character

For some reason when i make my map bigger then 15 x 25 the camera gets all buggy, at the top part of the map the camera jumps showing the bottom of the map, and at the bottom it jumps to the top. Here's the code for it: public int getXOffset(){ …
2
votes
3 answers

Programming Menu for Game, Mouse detection method not working

Here is the code for my method that is supposed to detect whether or not a mouse click is within a rectangle that I defined. private boolean mouseOver(int mx,int my,int x, int y, int width, int height){ if((x < mx && mx < x + width)&&(y <…
2
votes
1 answer

Multiline TextField Slick2d

I'm trying to make a quiz game using Slick2d library, and I need a multiline TextField in order to show the question. I have searched a lot this on the web, and in every forum I enter most of the people say that Slick2ds TextField only allows single…
2
votes
0 answers

Weird bug with collision detection

So, I have been making my MiniLD game and now I face with another problem. I am making a pong clone using slick2d, and when the ball hits my paddle in a certain range, it just goes through it. Here is the code I have (I can't use the intersects()…
pta2002
  • 185
  • 1
  • 3
  • 12
2
votes
1 answer

How do I render a portion of the last character glyph using Slick2D

I am currently using Slick to render a custom chat in a game. What I want to do, is I want to be able to create a custom "fading" effect for the chat, which smoothly fades from the right to the left. I'm not too great on explaining things in text,…
user3830679
2
votes
1 answer

Java Slick 2D Drawing With Keyboard

I have pasted the main state underneath. Everytime i move my keyboard the object moves but it is refreshing the page. How do i make it so that the object does not refresh and it looks like the image trails and it eventually draws. package…
2
votes
1 answer

ERROR!! AppGameContainer java.lang.ClassNotFoundException

this is my code: import org.newdawn.slick.*; import org.newdawn.slick.state.*; public class Game extends StateBasedGame{ public static final String gamename = "Ham Blaster!"; public static final int menu = 0; public static final int…
Daprofeta
  • 21
  • 4
2
votes
1 answer

NullPointerException when using drawImage (With Slick2d)

Have a bit of basic code put into the beginning of a game and have run into a bit of a hang with this nasty NullPointerException for no apparent reason. Loader.java (main class) public class Loader extends StateBasedGame { public static final int…
2
votes
2 answers

Rendering an ArrayList, sorted by its object's y position

Solved (scroll down) I'm currently working on a small game in Java using the game library Slick2d. The game itself is 2D, but you can move to the background or foreground. My problem I'm currently trying to make something like a render order, which…
a duck
  • 69
  • 6
2
votes
1 answer

Slick2D: getTileProperty returns true when it shouldn't

I'm trying to implement some collision detection to a test game i've been making. I've used TiledMap to create the map and set a property on one of the tiles to blocked=true This tile is then drawn on layer 0. I then check to see if the tile exists…
Ceri Turner
  • 830
  • 2
  • 12
  • 36
2
votes
1 answer

Moving a sprite to the left or down is faster than moving it to the right or up

I am making a basic game with Slick2D and LWGJL but I am having a wierd issue that when i'm moving my player(an image) to the left/down it is slower than moving to the right/up. Input input = gc.getInput(); if(input.isKeyDown(Input.KEY_W)){ …
Joe Tannoury
  • 145
  • 10
2
votes
0 answers

Slick2D Alpha Lighting Issues

I'm writing an Alpha Map Lighting system, and I've been successful to some degree. Here is my code: g.clearAlphaMap(); g.setDrawMode(Graphics.MODE_ALPHA_MAP); GL11.glEnable(SGL.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE,…
Quinn Finney
  • 523
  • 1
  • 6
  • 14
2
votes
1 answer

Calling a method with Graphics g as perimeter

i am using slick2D to create a simple java game. Unfortunately my java skills are simpler than simple. This game will be a memory game, since i thought it would be simple to make. One of the problems i have is that i have a NormalMode class, and a…
MrPork
  • 75
  • 6
2
votes
1 answer

Jumping with quadratic equation -JAVA

Motion.java package util; import org.newdawn.slick.Input; public class Motion { static double origin,speed; static double playerX=100,playerY=520, calcY; static boolean jump=false; static int x=0; public static void…
user1953222
  • 110
  • 1
  • 7