Questions tagged [slick]
The Slick2D graphic engine and utility collection is meant to make the development of games using LWJGL easier.
241
questions
1
vote
1
answer
651
views
How to only render part of an image in lwjgl/openGL
I'm making a mining/building game in java using slick2D and I want to make it so you can only see a few blocks in any direction while you are underground. The best example I could find of what I want ...
0
votes
1
answer
144
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 ...
1
vote
0
answers
1k
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:
...
0
votes
3
answers
1k
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. ...
1
vote
0
answers
148
views
Slick - create new texture from part of existing texture
Say I have the following image:
I want to resize this texture, so I can have resizable buttons with a texture.
Now, as you can't repeat a certain area of an image in OpenGL, I have to create a new ...
2
votes
1
answer
129
views
What measurement units are used in the return value of the getWidth method in the UnicodeFont class supplied by Slick2D?
I'm working on a small component for a game that essentially wraps the provided String so that it fits within the width of the provided rectangle. The rectangle is provided by the Slick2D library as ...
1
vote
0
answers
265
views
Slick2d font rendering makes all other drawings vanish
I'm converting a java game to lwjgl and slick-utils. I've followed the slick2d examples for font loading/rendering but I found that the font shows as a solid box of color unless I add the following ...
1
vote
1
answer
2k
views
Including slick2d or slick-util in maven build? [closed]
I'm converting a project to lwjgl and trying to use slick-util as well. There's no slick-util maven repo anywhere (nor slick2d itself anymore). I've included local dependancies before using
...
8
votes
1
answer
9k
views
How do I draw a full resolution texture to a window of the same resolution?
My image is 1280x800, and my screen size is 1280x800. It should draw perfectly. I'm creating a quad the size of the screen, and setting the texture to fit the quad. But right now it draws a square ...
1
vote
1
answer
10k
views
How do I detect and handle collisions using a tile property with Slick2D?
I am trying to set up collision detection in Slick2D based on a tilemap. I currently have two layers on the maps I'm using, a background layer, and a collision layer. The collision layer has a tile ...
1
vote
1
answer
201
views
(Java + Slick) How to rotate the Graphics (g) around the X-Axis?
I already tried it by using GL11.glRotatef(45, 1, 0, 0), but the result looks like this:
-4
votes
4
answers
5k
views
LWJGL vs Slick2D vs OpenGL. What is the difference?
I was wondering what the difference was between LWJGL, Slick2D, and OpenGL.
If I'm not mistaken LWJGL is a library and it has the methods and such, but what are the other two for and how do they use ...
0
votes
1
answer
1k
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 ...
1
vote
1
answer
801
views
Slick2D : translate -> scale -> translate doesn't return to the old position
I am trying to implement zoom using Slick2D library.
As I understand, to zoom something on non (0,0) coordinates, we need:
translate so the target point is in (0,0)
apply scale factor
translate the ...
5
votes
3
answers
590
views
Serialization of objects problem
i have a problem with serialization (saving and loading game variabiles), when i save evreything seems to be saving correctly but when i try to load it only detects first 3 objects i saved and the ...
1
vote
3
answers
492
views
Why does my collision implementation cause my player to "bounce" when a collision occurs?
I have a player polygon and I check to see if it's colliding with my tiled map with this method:
...
-1
votes
1
answer
932
views
Slick2D and TileD [closed]
I've been learning Java for a while, and with my aims of being a game developer later in life, I've came across Slick2D+lwjgl and following tutorials and making some little things. However; I don't ...
1
vote
2
answers
187
views
Java looking in wrong directory for XML [closed]
I found this suggestion on a Stack Exchange site to print out what the current directory is:
...
0
votes
1
answer
3k
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
1
answer
133
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 ...
3
votes
1
answer
557
views
Dynamic "Light Level" System based on alpha levels
My team and I have been working on a game in Java using the Slick2D engine and there are a few things I have questions on. As of right now, the code that I've written basically takes a cosine function ...
2
votes
1
answer
1k
views
MVC with looping view
For our school project we'd like to develop a game using the MVC pattern. We're all moderate new java programmers and absolutely new in game development.
With our current view (containing only menu) ...
0
votes
1
answer
259
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 ...
-2
votes
1
answer
467
views
How to properly limit movement based on collision [closed]
I have a confusing problem on my hands. I've managed to get tile-based collision working, and I'm using the following code in my update loop to restrict my character's movement.
...
-5
votes
1
answer
335
views
Writing and reading from an XML file with Slick2D [closed]
I was wondering how you would go about writing and the reading from an XML file using the Java library Slick2D.
I have googled for the last couple of days and have found nothing succinct and simple ...
0
votes
1
answer
81
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
-2
votes
2
answers
652
views
How can I display an image for a predetermined amount of time?
I want to display an image, then return to the previous after one second when a certain key is pressed. I'm using Slick2d and Java. How can I accomplish this?
0
votes
1
answer
204
views
Java Slick2d particles error [closed]
When i run the game particles crash the game, im not sure what am i doing wrong because the program doesnt tell me. But i know particles are causing this , if i remove the code in update code at ...
-2
votes
1
answer
832
views
Entity moving Up and Down but not Left and Right [closed]
I am trying to create an entity class for my game but I'm having difficulty with the movement, I can get the sprite moving along the Y-Axis but not along the X-Axis.
Here's my code:-
...
1
vote
4
answers
637
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 ...
2
votes
1
answer
2k
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
3
answers
487
views
How do I undo changing the color of an image in Slick2d?
This code colors the enemy red:
...
1
vote
2
answers
2k
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:
...
0
votes
1
answer
707
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
2
answers
1k
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 ...
1
vote
1
answer
3k
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
0
answers
1k
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
2
answers
935
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
1
answer
203
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
1
answer
5k
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
2
answers
212
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
5
answers
4k
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:
...
0
votes
1
answer
970
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
2
answers
477
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
1
answer
2k
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
2
answers
4k
views
4
votes
2
answers
2k
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:
...
5
votes
4
answers
4k
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 "Renderable" ...
0
votes
1
answer
1k
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
1
answer
112
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, ...