Tagged Questions
1
vote
0answers
23 views
Slick2D v LibGDX: [on hold]
Okay. You might have seen some of these posts on forums here and there, but I wanted to ask this here mainly because everyone here is focused on game-dev and there seems to be quite a few Java ...
0
votes
0answers
15 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
23 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
15 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
60 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
1answer
56 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
23 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, ...
1
vote
1answer
59 views
Java Slick2d Animation not working
Hello everyone I am trying to make a simple 2d game using java and the slick2d library. this is my first time doing it and i need some help.
Right now I am trying to make the Animations for the ...
0
votes
1answer
52 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.
...
4
votes
1answer
79 views
Why is my Slick2D spritesheet animation cut off when it loops?
I am loading a SpriteSheet with Slick2D and using the Animation function in the render method to display it.
The spritesheet loads perfectly, but when the animation loops, it does so moved down a few ...
0
votes
1answer
93 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
52 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
40 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
104 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 ...
1
vote
0answers
31 views
java 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 ...
-1
votes
1answer
103 views
Slick2D: Resizing the Window
I am using Slick2D, and I wanted to know which is the best way to resize, maximize, minimize the window, For example, Resizing all the images or scaling them, or Slick2D has an integrated method, Any ...
0
votes
1answer
48 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);
...
1
vote
1answer
56 views
How can I check for key releases between keyReleased callbacks?
Slick2D's Input class has a isKeyPressed() method that returns a boolean value according to whether the specified key has been pressed. I want to check if a key has been released in the same fashion.
...
0
votes
0answers
57 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
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
0answers
73 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() ...
1
vote
1answer
60 views
Slick2D: Initializing graphics object before game loop
I'm using the Slick2D Java game library and I want to set the scale of the graphics object that gets passed to the render method in my game loop. I'd like to do this outside the render method, so ...
1
vote
1answer
101 views
Get Tile Location On Screen (Java Slick and Tiled2D)
I want to create a rectangle around each tile that's blocked value = true. How can I find the X and Y (on screen) coords of the each individual Tile?
0
votes
1answer
180 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
157 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 ...
1
vote
1answer
134 views
Random lines away from images in java2d opengl game
Working on a java game that uses some pngs images for icons/textures. A few images ( fewer than 5, out of dozens ) are showing some odd parallel "artifact" lines. They move with the image, are ...
0
votes
1answer
348 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
2answers
260 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
242 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 ...
1
vote
1answer
181 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
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
0answers
226 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( ...
0
votes
3answers
378 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
0answers
60 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
1answer
45 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
0answers
71 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
1answer
332 views
Including slick2d or slick-util in maven build?
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
...
4
votes
1answer
711 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
1answer
130 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:
5
votes
3answers
211 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
3answers
341 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:
public static boolean playerCollisionWith() {
for(int i = 0; i < Blockmap.entities.size(); i++) ...
-1
votes
1answer
322 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
0answers
128 views
Steering behaviour [closed]
So I found this steering behaviour code in a book but i dont really understand the last part of the code what exactly is he doing because im unfamiliar with c++. Why would you need to ...
1
vote
2answers
129 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:
File file = new File(".");
for(String fileNames : file.list())
System.out.println(fileNames);
...
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 ...
3
votes
1answer
275 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
1answer
243 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
1answer
123 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
1answer
128 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.
for (Block b ...
-5
votes
1answer
134 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 ...