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

learn more… | top users | synonyms (1)

0
votes
1answer
105 views

Why does my character move up forever when he jumps with this code?

I've been doing some stupid stuff in Slick2D+LWJGL and I've run into a problem. I press the UP arrow and my character continues to go up until I let go :/ Here's the code: if ...
0
votes
2answers
102 views

Slick2D: constructor vs. init method

What is the difference between the constructor of a BasicGameState and the init method? It appears that they are both called at the same time when the BasicGameState is registered in StateBasedGame, ...
0
votes
1answer
94 views

Follow behavior with randomization factor

I'm trying to make enemy follow player as in picture below, the code below is code for following player with steering behavior ( i'm not sure it steering works tho but it does follow player ), how ...
0
votes
2answers
84 views

Checking bounds of a quad

I want to know how would I tell if a quad touches another quad in my game built in Slick2D. I have a class that I named "Bounds" which has 4 "Point" objects which just store an X and a Y value and a ...
0
votes
2answers
1k views

How do I create a Loading Scene in SLick?

I actually wanted just a fake loading scene. For a fake loading scene, how do I make a time variable or a time Method? I'm still a fresh java programmer!
0
votes
1answer
1k views

How to implement HUD

I'm wondering how one could implement an HUD in LWJGL. I've seen tutorials on this, but they don't seem to work. I know the basic structure goes like this: init3d(); // 3d code init2d(); // HUD To ...
0
votes
1answer
64 views

LWJGL/Java - Implementing a writeable text box?

I would like to create a writeable text box where a user can input text into it. A nice "send" button that the person could click to send the text to the server would also be nice. I currently haven ...
0
votes
3answers
379 views

Tile Map World Background

I am making a 2D top-down game in Java using the Slick2D library. However, this question applies to all ways of making games of this nature. My question is: How would I do a background for the world. ...
0
votes
1answer
145 views

How can I compute the average color of a texture?

I'm making a mini-map system for my tile based game, and I thought the best way to accomplish this would be the following: At the beginning of the game, I calculate the predominant color of every ...
0
votes
1answer
71 views

Hiding pixels inside a Shape

I have a player wich is a png image and I want a part of him to be able to go behind things, so I need to know how to hide pixels that are inside of a shape
0
votes
1answer
794 views

Interpolating a player between two 2D points?

I would like a player to be able to move in a direction smoothly, whilst sticking to a fixed grid. Much like in Pokemon, how the player can move, but when the key is pressed and released quickly, they ...
0
votes
1answer
461 views

Box2D and Slick2D: Graphics bug [closed]

The bug The physics ground represented by a horizontal line. The object is stationary, and seems to be pretending that the ground is lower. This is because the center of the Shape is incorrectly ...
0
votes
2answers
2k views

SpriteSheet in slick2d or lwjgl

import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO; public class SpriteSheet { private String path; public final int SIZE; public int[] pixels; ...
0
votes
1answer
105 views

Menu selection wont stay on selected option

My Menu has a START and a QUIT option. I'm using a controller's D-PAD for selection. The game begins with START highlighted. When I push the down button on the D-PAD, it highlights the QUIT option. ...
0
votes
1answer
518 views

Java - Finding distance between player and tile in array

What is the best way performance wise to do this? When I click a tile I want it to get the distance and if I am close enough I can interact with the tile. One way would be to find the tile by doing ...
0
votes
1answer
2k views

Resource not found: testdata/alphamap.png

I started a tutorial for java's slick 2d library, called SlickBlocks which is essentally a tetris clone. The problem is I have followed and typed in the code examples to the dot, yet when I run it I ...
0
votes
1answer
58 views

Slick and Timers?

I'm making a game where I need events to happen in a precise amount of time. Explanation : I want that event A happens at 12000ms, and event B happens every 10000ms. So "if"s should looks like this. ...
0
votes
2answers
268 views

Slick2D - Entities and rendering

I have been trying to create my very first game for quite a while, followed some tutorials and stuff, but I am stuck at creating my entity system. I have made a class that extends the Entity class and ...
0
votes
1answer
88 views

Streaming resources

I'm writing a game using the Slick2D library. I recently added a loading screen using deferred loading. I use the Music class to load OGG files to be used as music. These take an excessive amount of ...
0
votes
1answer
519 views

Slick2D and Nifty GUI

I am currently trying to combine both slick2d and nifty to work together. I've had some amount of success - I can now actually run my test and it won't crash. As far as I can tell, it will also ...
0
votes
1answer
125 views

Slick2d Particles loading xml returning null [closed]

I've made a particle class that creates a particle of Slick2d library, but the XML file doesn't want to load , it keeps giving me null error. I gave it the path as I do for everything but it refuses ...
0
votes
1answer
167 views

How do I pass textures into a fragment shader in Slick?

I've written a shader that uses three different textures, tex0, tex1, and tex2. I can load it into Slick and successfully display it, but I can't figure out how to set the three different textures. ...
0
votes
2answers
151 views

Images not rendering in Slick

I have built a game that uses the Slick framework. The maps are tmx files and were built using TileD. The game iterates through a list of players and maps - once a game with a player and map is ...
0
votes
1answer
576 views

Does using LWJGL and Slick2D yield promise for the future of my project? [closed]

I've been looking around the net for months now in an attempt to find the most appropriate tool for my needs. I haven't had a lot of time to devote to the creation of systems that could possibly ...
0
votes
1answer
214 views

MarteEngine Tile Collision [closed]

I need to add collision to my tile map using MarteEngine. MarteEngine is built of of slick2D. Here's my tile generation code: Code: public void render(GameContainer gc, StateBasedGame game, Graphics ...
0
votes
2answers
537 views

Can't get sprite to rotate correctly? [closed]

I'm attempting to play with graphics using Java/Slick 2d. I'm trying to get my sprite to rotate to wherever the mouse is on the screen and then move accordingly. I figured the best way to do this was ...
0
votes
2answers
163 views

Unable to access jar. Why?

I was making a game in java and exported it as jar file. Then after that, I opeed jar splice. I added the libaries and exported jar. I added the natives then i made a main class. I created a fat jar ...
0
votes
3answers
970 views

How do you make bullets move at an angle in different angles using delta

I'm having trouble making my bullets move at a steady pace using delta. I have the formula I used outside of slick2d, but it doesn't take delta into account. My bullets fly fast. How do I make them go ...
0
votes
1answer
910 views

Slick2D: Changing an Image's colour to Color.white

I am working on a game where we would like the enemies to flash white when hit by a bullet. Ideally, we would like to use the same mechanism to render an Image in any colour. Our Images are all png ...
0
votes
1answer
509 views

how to get the current location in the map surface - slick 2D

@Override public void mouseMoved(int oldx, int oldy, int newx, int newy) { super.mouseMoved(oldx, oldy, newx, newy); } we can get the mouse location in this method via newx, newy . i want to know ...
0
votes
1answer
360 views

How do I get the current location when using slick 2D library?

I'm developing a map kind of simple game using slick 2D library, and I want to get the current location of the user. When the user runs into a special location (ex: hole) to indicate that is ...
0
votes
1answer
25 views

How can I make an soundsystem with slick?

My Question would be , how can I develop an easy-to-use Soundsystem under slick-util? Under the function a.playAsSoundEffect(1, 1, true, x, y, z); it allready works to create a static ...
0
votes
0answers
19 views

Collision detection in slick [closed]

I tried to play a little around with slick in Java. My map which I created in tiled looks like this I only have those two different tiles and the black ones got the "blocked" property. The black ...
0
votes
0answers
18 views

Slick2D changing image's color with drawFlash and using alpha

I have an image, where I have a round soft white feathered ball in the center of it. I plan to use it for my lighting in my 2D game. I could not find any proper way to drawing lighting with many ...
0
votes
0answers
27 views

Slick2D/LWJGL Drawing coloured lights problem

I am using the Slick2D engine. I've followed this snippet for creating light sources. I have followed step step, added what is actually important for me, and tested it and the lighting effects ...
0
votes
0answers
18 views

Drawing jbox2d shapes in slick2d

How would be the best way to go about drawing polygons in slick after forces where applied to them via jbox2d? There seems to be no way to get the vertices of a body defined in jbox2d...
0
votes
1answer
74 views

How to achieve a Gaussian Blur effect for shadows in LWJGL/Slick2D?

I am currently trying to implement shadows into my game, and after a lot of searching in the interwebs I came to the conclusion that drawing hard edged shadows to a low resolution pass combined with a ...
0
votes
0answers
25 views

Moving a tiled map in a jframe

I rendered a tiled map, with the help of slick2d, in my JFrame in Java. I can move my main character, but it is just that the character itself moves. I would like to do it that, if the player moves, ...
0
votes
1answer
94 views

Using Single Image for Map in 2D Platformer

I'm fairly new to game development, and have been messing around with Slick2D. Currently, my map consists of objects that are represented as rectangles. If I wanted to use am image simlar to: How ...
0
votes
0answers
53 views

Cube projection composed of smaller cubes not lining up

I am trying to make a cube projection composed of other cubes, similar to a Rubik's cube but completely static. I can get one cube to work, but when I join multiple, they don't line up. I am using ...
0
votes
1answer
43 views

java slick2d - key press being ignored

I have the following in my update funtion. The first input for key_enter when textPos!=2 works fine, but the one when textPos==2 doesn't work. The key up and down work fine though. The ...
0
votes
1answer
24 views

lwjgl slick textures and glTexParameter

How to make textures fill all area as it is specified? I'm getting small gaps if the texture is smaller than area example: gl_quads setup like these: -1f, 1f, 0, -0.98f, 1f, 0, -0.98f, -1f, 0, ...
0
votes
1answer
50 views

Slick2D: Animation not being parsed from spritesheet correctly

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so: spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192); ...
0
votes
0answers
60 views

How can I draw a part of a texture in slick2d?

I know the method for drawing a region of a texture in slick2d: image.draw(x, y, srcX, srcY, srcX2, srcY2); But I have no idea how the texture coordinates work. To draw a region of x:16, y:16, ...
0
votes
0answers
78 views

LWJGL Rotating is moving

I am trying to rotate my QUAD even just a little bit. I have read pages like http://www.java-gaming.org/topics/lwjgl-tutorial-series-moving-and-rotating-triangle/30679/view.html In my render() ...
0
votes
1answer
182 views

2D Tiled Map - Small tiles or big tiles with pixel-precise movement

I am using Java - LWJGL - Slick2D . I have tried to do a proper collision detection with 32 x 32 tile size but failed three times. I just cant get it to work! I found a youtube video that was using ...
0
votes
2answers
165 views

How can I move a created Image in Slick2D?

I want a image to follow the mouse, and I use Image class of Slick 2D: public void init(GameContainer gameContainer, StateBasedGame stateBasedGame) throws SlickException { mouseImage = new ...
0
votes
1answer
364 views

LWJGL font not rendering, even with depth test and texture_2D

I'm running into an odd little problem here. I'm attempting to render a basic console over my LWJGL-based application, which should be easy enough through a decorator pattern of renderers (as in, one ...
0
votes
1answer
250 views

Java Slick2D - Problem using ScalableGame class

I am having a problem adjusting the size of the screen while using the ScalableGame class from the Slick2D library. I would like the background and objects (images and graphic shapes) to adjust to ...
0
votes
0answers
233 views

Java Slick2D rotating Shapes

I'm having a problem with rotating a Shape in Slick2D for Java I have a code in screen render which works properly: Shape box = new Rectangle(100,100,32,32); box = box.transform( ...