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

learn more… | top users | synonyms (1)

1
vote
4answers
174 views

Java Slick2d collision feedback [closed]

I'm trying to build a collision response ( it uses vectors2f from slick2d ) so that enemies don't overlap on each other so basicly what I'm doing right now is, I loop trough all enemies in array ...
1
vote
1answer
290 views

Java Slick2d Delta ( time )

In Java slick2d , i started printing out Delta which is supposed to be the time and it prints out is 16 or 17 forever, so how does this help me if i want to tell an object when it needs to do ...
3
votes
3answers
162 views

How do I undo changing the color of an image in Slick2d?

This code colors the enemy red: enemies.get(i).image.setColor(0,1,0,0,1); enemies.get(i).image.setColor(1,1,0,0,1); enemies.get(i).image.setColor(2,1,0,0,1); enemies.get(i).image.setColor(3,1,0,0,1); ...
1
vote
2answers
164 views

Inputting Only Alphabetical Input - Slick2D

I'm trying to obtain the user input for when they enter their own name. However I would prefer to have it Alphabetically. This is what I'm doing at the moment: if (input.isKeyDown(Input.KEY_A)) ...
0
votes
1answer
140 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. ...
1
vote
2answers
394 views

Removing the titlebar while using slick2d?

I recently started using slick2D in my gaming programs and a problem I have is not having the ability to remove the border/titlebar. I usually do this to create my own cutom look/ interface but if I ...
0
votes
1answer
599 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 ...
1
vote
0answers
276 views

Why won't my Box2d bodies collide? [closed]

I'm doing something wrong when trying to get bodies to collide using jBox2d & Slick2d. Here is have just my basic init, update, and render methods. Render and update seem to work fine for drawing ...
0
votes
2answers
338 views

How to translate from Slick2d coordinates to jBox2d

I read through this question to try and get a grasp on the topic, but I can't figure out how to apply this to my Slick2d window. I'm trying to do something as simple as place an edge on the bottom of ...
-1
votes
1answer
98 views

Slick2D ingoring aplha channel?

When I use the draw method inside a image, it completely ingores the alpha channel and fills it in with white. Is there a way I can draw it where the alpha is see through like it's suppost to be? I ...
-3
votes
1answer
1k views

Java2D Collision Detection

I've been wrapping my head around Java2D collision detection. I am working with Slick library and trying to figure a simple clean code to check if a collision has occurred. The idea is fairly simple, ...
0
votes
2answers
83 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
5answers
391 views

Limiting a player's movement to the screen's dimensions

I have a player, that I can control using WASD. And I don't want him to leave the screen. So I've tried the following: if (player1.getX()+5 < 974 && player1.getX()-5 > 0) { ...
0
votes
1answer
398 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
122 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 ...
-3
votes
1answer
940 views

Slick2D TileD Map Editor Properties [closed]

So I used the following post to help me render my isometric map in Slick2D: Slick2D Isometric TiledMap Rendering Problem Big thanks and credit to arminb for the code supplied and for the fix to be ...
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; ...
4
votes
2answers
773 views

Slick2D Isometric TiledMap Rendering Problem

I created a Tiled Map using the Tiled Map Editor. In the Editor it looks like this: Desired State In my java program it looks like this: Actual State My java code is: public class Game extends ...
5
votes
4answers
1k views

Should each Entity have its own update and render methods?

First, the questions: Should each Entity (which are classes like Character, Tree, Enemy) have its own update() and render() methods? If that's the case, then should I use Interfaces like ...
0
votes
1answer
511 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 ...
-1
votes
1answer
83 views

Why are only some of my objects being rendered?

Every time I create a new asteroid the previous one is no longer rendered? I did some debugging and printed out the size of Array-List 'Small' and when a new asteroid is created it doesn't go down, ...
2
votes
2answers
323 views

16-bit PNGs in Slick2D

I'm working on a project and I'm using some 3rd party sprites just to get it off the ground; recently I've come into a hitch. Slick2D doesn't seem to want to load my images. That is, it will warn me ...
1
vote
1answer
181 views

Putting a Java/Slick game on your website?

I've made a simple little 2D game in Java using Slick and I want to embed it in my website. I'm just a little confused as to how to go about it, I'm guessing I need to export it as a WAR file? Sorry ...
-2
votes
1answer
794 views

How to change screen resolution in slick2d?

I released my game for testing for both windows and mac. I'm using mac as my development workspace. My friends uses windows and the window was to big. I created a 1000*1500 Screen window. I can change ...
1
vote
2answers
2k views

How to add text box in slick2d?

I wanted to let the player rename the character of my game. So I thought that making a text box and when he clicks the ok button, the text inside the text box will make it to a string and render it on ...
0
votes
1answer
636 views

How handle nifty initialization in a Slick2D state based game?

I'm using Slick2D and Nifty GUI. I decided to use a state based approach for my game and since i want to use Nifty GUI, i use the classes NiftyStateBasedGame for the main and ...
0
votes
1answer
104 views

Is there any map maker for javaME game? [closed]

For the past two weeks I was trying to make a map maker for my java ME 2D RPG game. I failed because i get errors using slick TWL and the forum for this is inactive. So I just wondered is there ...
3
votes
3answers
288 views

How to choose cell to put entity in in an uniform grid used for broad phase collision detection?

I'm trying to implement the broad phase of my collision detection algorithm. My game is an arcade game with lot of moving entities in an open space with relatively equivalent sizes. Regarding the ...
3
votes
1answer
1k views

How a “Collision System” should be implemented?

My game is written using a entity system approach using Artemis Framework. Right know my collision detection is called from the Movement System but i'm wondering if it's a proper way to do collision ...
0
votes
0answers
31 views

How do I convert mouse co-ordinates in Slick2d java? [duplicate]

Possible Duplicate: Java Slick2d - How to translate mouse coordinates to world coordinates I'm really new in Java and I really want to how do I convert the mouse clicks to co-ordinates in ...
3
votes
1answer
410 views

How can I set the rotation of a shape to the same as my image?

The way you set rotations of images is different from setting shape rotations. So how can I make the shape have the same rotation as my image? This is how my image rotates: ...
1
vote
1answer
252 views

Fixing a collision detection bug in Slick2D

My game has a bug with collision detection. If you go against the wall and tap forward/back sometimes the game thinks the speed you travelled at is 0 and the game doesn't know how to get you out of ...
2
votes
1answer
125 views

How to decide face side of sprite

I am just starting game-dev with slick2D and marte engine. When I move my sprite left and right, I am doing walk animation but when the key is released how can I decide in which side the sprite face ...
3
votes
2answers
946 views

How do you set the movement speed of a sprite?

I'm using Slick 2D/Java to play around with graphics. Getting an image to move is easy: Input input = gc.getInput(); if(input.isKeyDown(sprite.up)){ sprite.y--; }else if ...
4
votes
4answers
464 views

Can a high FPS negatively affect how a program runs?

Yeah I know this is a broad question and will get down rated, I'm just hoping for some answer before it gets closed. Anyway, I'm using Slick 2D/Java to play around with graphics. I'm having some ...
1
vote
1answer
148 views

Rotate an image in a scaled context

Here is my working piece of code to rotate an image toward a point (in my case, the mouse cursor). float dx = newx - ploc.x; float dy = newy - ploc.y; float angle = (float) ...
-5
votes
1answer
71 views

Help, i cant reference my vars! [closed]

I have a sub-class(let's call it sub) and it contains all the function of an object in my game. In my main class(Let's call it main), i connect my sub to main. (Example sub Code: s = new sub(); ...
-6
votes
1answer
127 views

Is it the class that slows down the game? [closed]

My framerate lastime exceeds 1000 now the highest is 15. I have thousands lines of code in one class(I was still fresh last time and did not think of putting it in another class) Is it the class that ...
-2
votes
2answers
641 views

How do I make time?

I wanted to output a text for a certain amount of time. One way is to use threads. Are there any other ways? I can't use threads for slick2d. This is my code when I use threads for slick: package ...
0
votes
1answer
208 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 ...
-6
votes
1answer
668 views

How to remove the FPS text on slick2d?

How do I remove the frame rate text on the upper left corner?
1
vote
1answer
811 views

Java 2D Tile Collision

I have been working on a way to do collision detection forever, and just can't figure it out. Here's my simple 2D array: for (int x = 0; x < 16; x++) { for (int y = 0; y < 16; y++) { ...
1
vote
1answer
374 views

How to I get a rotated sprite to move left or right?

Using Java/Slick 2D, I'm using the mouse to rotate a sprite on the screen and the directional keys (in this case, WASD) to move the spite. Forwards and backwards is easy, just position += ...
-5
votes
2answers
165 views

How to stop reducing life? [closed]

CODE Input input = gc.getInput(); int xpos = Mouse.getX(); int ypos = Mouse.getY(); emu = "Enemy Life : " + enemyLife; Life = "Your Life Is" + life; ...
1
vote
1answer
146 views

how do I add development build number each time I compile and play?

I wanted each time I play my game, it will show in the console how many times you compiled or run the game. How do I do that?
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
2answers
480 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 ...
-2
votes
2answers
92 views

How to use outside int to be used in my class? [closed]

I wanted my character's life to be the same as the other game state. My other game state is different the from my original state. I wanted to link my int to my new game state to make it the same. How ...
4
votes
2answers
3k views

How can I move a sprite in the direction it is facing?

I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction ...
-1
votes
1answer
428 views

Resource not found?

When I write in my terminal, java -jar myJar.jar, it gives me an error "Resource Not found res/playNow.png" When I run it in eclipse, it does not give me any errors about this image. My folder in my ...