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
1 answer

Stopping the animation after you let go of a key

What I have right now is an animation that starts when I press space: if(input.isKeyDown(Input.KEY_SPACE)) player = movingRightSwingingSword; However when I stop clicking space my animation continues. until I move my player, how do I make it so it…
Michael Zeuner
  • 1,736
  • 3
  • 15
  • 23
0
votes
3 answers

java Slick 2D how to set color

I'm getting crazy trying to draw a very simple rect and a text in order to just understand how it works with the slick 2d java library. This is what I try: g.setColor(Color.green); g.fillRect(50, 50, 50…
Daepp
  • 21
  • 1
  • 4
0
votes
2 answers

Can't create runnable LWJGL jar with JarSplice

I created a runnable JAR with Eclipse for a small SLick2D game. No matter what settings I tried, I always received some sort of error, whether it be UnsatisfiedLinkError, or some class not being found. I tried JARSplice, but that didn't work…
Shane
  • 25
  • 5
0
votes
1 answer

java slick cannot load tmx tilemaps

I just started using Slick2D and learned how simple it is to load in a tilemap and display it. I tried atleast a dozen different tmx files from numerous examples to see if it was the actual file that was corrupted. Everytime I get this…
mbreen
  • 558
  • 3
  • 9
  • 20
0
votes
1 answer

Tiled Java & Parallax

Does anyone know how the provisional support for parallax layers in the GitHub Java version of Tiled works properly? It compiles, and it executes fine. However, if I set a layer to viewplane distance 0.00 (the minimum) and the eye-viewplace distance…
DeejUK
  • 12,891
  • 19
  • 89
  • 169
0
votes
1 answer

Java | Slick2D - How to use Objects in TiLeD?

Hello I'm creating a game and I have a few ways to make trainers stand (because it's a Pokemon game) but then I have to code their positions every time as entities for each new map I make. Is there a way to make an object in TiLeD and then make Java…
user1217946
0
votes
1 answer

Slick2d shape contains another shape

I'm playing around with the Slick 2d Java game engine. I am trying to write some render logic where if a circle is within a square it is coloured green. Otherwise it is coloured red. You can see what I am trying to achieve in this image: My problem…
Ben J
  • 5,811
  • 2
  • 28
  • 32
0
votes
2 answers

Java Slick2d - How to translate mouse coordinates to world coordinates

I am translating in my main class' render. How do I get the mouse position based on the translation? public void render(GameContainer gc, Graphics g) throws SlickException { float centerX = 800/2; float centerY = 600/2; …
Corey
  • 73
  • 4
  • 13
0
votes
1 answer

Java Slick2d - Loading tiles from spritesheet throwing exception

Block Class public class Block { public enum BlockType { Dirt, Grass, Selection } BlockType Type; Vector2f Position; Image texture; boolean breakable; public Block(BlockType Type, Vector2f Position, Image texture, boolean breakable)…
Corey
  • 73
  • 4
  • 13
-1
votes
1 answer

How to change the coordinates of an object with the press of a key?

I have to create a small 2D Java tile game for schoolwork and I would like to know how can I move an object with the press of a button. More specifically, I have an item with ' i ' and ' j ' coordinates in a matrix. After I press ENTER on my…
-1
votes
1 answer

How do I get the color of each pixel of an animation/image object in java?

Working on a Pac-man game for my grade 12 computer science class. I have game.java file the runs the code through the main method, while I have a Play.java file that runs the actual game. This is what's inside the Play.java file: package…
Bert Hanz
  • 417
  • 1
  • 7
  • 16
-1
votes
1 answer

Running code on the main thread from a child thread

I'm making a simple 2 player multiplayer game using Slick2D in Java. I am using java sockets to create a server and client object. They work fine, however the messaging system is handles in different threads(not to block the main thread). Everything…
user2466076
  • 95
  • 1
  • 12
-1
votes
2 answers

Java 2D Game Key Input (Best Practice?)

I'm brand new to game development and have chosen to start working on a 2D top-down scroller game. I'm using the Slick2D library for this game. My question is about best practices for taking multiple direction input for sprite movement (UP + RIGHT…
pocket86
  • 33
  • 6
-1
votes
1 answer

Image weirdness with slick2d graphics translation

I am making a game and I noticed whenever I use the graphics.translate function and after the translate this happens to the images. Before Translation After Translation I was wondering if there is anyway to fix that or anyone else has the same…
user2580555
  • 329
  • 2
  • 4
  • 13
-1
votes
1 answer

How to load custom TrueTypeFonts in Slick2D

People are having a lot of problems loading custom fonts into Slick2D to draw strings with the graphics tool, so here is how I did it.
Plumetone
  • 101
  • 1
  • 9