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

learn more… | top users | synonyms (1)

10
votes
3answers
10k views

How can I make OpenGL textures scale without becoming blurry?

I'm using OpenGL through LWJGL. I have a 16x16 textured quad rendering at 16x16. When I change it's scale amount, the quad grows, then becomes blurrier as it gets larger. How can I make it scale ...
7
votes
3answers
3k views

Rendering only what is on the screen

I am fairly new to this world, so bear with me. I have a grid of blocks in a top-down, 2d game written using Slick. The best way to think of it is the Pokemon world. Right now, I am rendering all ...
7
votes
2answers
3k views

How do I handle collision detection so fast objects are not allowed to pass through walls?

I'm creating a 2d sidescrolling shooter, and I'm having a little trouble with collision detection for the bullets. Everything including the bullets are objects with their own polygons / update ...
5
votes
3answers
233 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 ...
5
votes
4answers
2k 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 ...
5
votes
4answers
338 views

What version of Java should I target for applets?

I recently deployed an applet that seems to require Java 6 Update 24. I assume the reason for this requirement is the matching JDK version I used to create the applet (I am new to Java). The fact ...
4
votes
2answers
6k 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 ...
4
votes
4answers
511 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 ...
4
votes
2answers
2k views

How to get smooth transition within slick?

When a player clicks start, my app immediately switches to the first level. My question is how do I incorporate a smooth transition within Slick?
4
votes
1answer
2k 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 ...
4
votes
2answers
1k 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 ...
4
votes
1answer
2k views

Distributing cross-platform .jar containing natives for LWJGL?

I'm making a game in Java using Slick2d, which depends on LWJGL. I can get everything to work in my development environment, but when I export it to a .jar, it needs the natives placed in the same ...
4
votes
1answer
1k views

Create the right pom.xml for LWJGL and Slick Project (Maven)

can somebody tell me whats wrong with my pom.xml file? At this point i get this error if i start my *.jar file: C:\Users\Michael\git\freezing-robot\target>java -jar ...
4
votes
3answers
2k views

2D basic map system

i'm currently coding a 2D game in Java, and I would like to have some clues on how-to build this system : the screen is moving on a grander map, for instance, the screen represent 800*600 units on a ...
4
votes
1answer
116 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 ...
3
votes
3answers
377 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
2answers
1k 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 ...
3
votes
3answers
234 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); ...
3
votes
1answer
566 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: ...
3
votes
1answer
1k views

With Slick, how to change the resolution during gameplay?

I am developing a tile-based strategy game using Java and the Slick API. So far so good, but I've come to a standstill on my options menu. I have plans for the user to be able to change the ...
3
votes
1answer
317 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 ...
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 ...
3
votes
3answers
5k views

How to render axometric/isometric tiles that are a 2d array in logic, but inclined 45º visually?

I am making a tile-based strategy game which i plan to have 2.5D visuals in an axometric/isometric fashion. Right now i'm programming it's logic and rendering it as a literal 2-dimensional array ...
3
votes
2answers
2k views

How do you structure a 2D level format with collisions etc. in Java (Slick 2D)?

I am developing a game in Java. 2D Fighter, Kind of like the 2d flash game Raze(http://armorgames.com/play/5395/raze). I currently am using the Slick 2D game library and am researching how to ...
3
votes
1answer
784 views

Is there any way to get the HWND from a window in LWJGL?

I've started some experimentation in Java and LWJGL (via Slick), and it seems very solid. However, I have some legacy code that requires a HWND integer as a parameter. I'm not sure how I'd be able to ...
3
votes
4answers
3k views

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 where my mouse actually is after I scroll the screen public void render(GameContainer gc, Graphics g) throws SlickException ...
3
votes
1answer
1k views

How do I implement smooth movement in a Box2D platform game?

I have implemented a character in JBox2D which moves with the help of a wheel rotating at the bottom of it. The movement is the best result I've had 'till now but it's a little glitchy when the ...
2
votes
3answers
490 views

For the handling of buildings on a tile-based strategy game, what aproach should I use?

On a tile-based game of the strategy genre, which allows the player to place buildings over the terrain tiles, there are multiple approaches that can be taken for handling such situation. The ones ...
2
votes
2answers
405 views

Are my programming methods for java games sufficient

so I'm making a 2d Java game with the slick2d and MarteEngine libraries. This is the biggest project since I made checkers for my Java class. I am still pretty new to programming concepts and using ...
2
votes
5answers
893 views

Add delay between player jumps

I'm developing a platformer game and have implemented jumping for the player. The player is able to jump, but holding the up arrow causes the player to continuously jump. What would be the best way to ...
2
votes
1answer
977 views

How do I make my Slick2D game fullscreen?

How do I make my game fullscreen? It's always in windowed mode. I'm using Eclipse on a Mac.
2
votes
1answer
51 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 ...
2
votes
2answers
425 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 ...
2
votes
1answer
133 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 ...
2
votes
1answer
2k views

Using Nifty GUI with Slick2D

As seen here NiftyGUI has it's own GameState classes, I want to know if for adding UI to one state of my game I need to make that state NiftyOverlayGameState or still a BasicGameState but to add a ...
2
votes
1answer
913 views

How do I get the alpha level at a specific pixel with Slick 2D?

I know that there is the Texture.getTextureData() method, and that it returns a byte[], but I have no idea how I could use this data to find the color data at a specific pixel.
2
votes
1answer
222 views

In Slick2D, how can I generate a 2D platformer map from an image?

I'm fairly new to game development. I've been messing around with Slick2D. My map consists of rectangular objects. I want to use an image to represent my map, similar to this: How could I generate ...
2
votes
1answer
2k views

How can I accomplish Pokemon-style movement over tiles in java?

I'm talking about where if you press a directional key once you walk over to the adjacent tile and can't do any other actions during the walk. I can get my character to move one tile width, but my ...
2
votes
3answers
2k views

C# 2D Game Library?

I'm looking for a C# 2D game library based on something like OpenTK which wraps OpenGL for C# Basically something like Slick2D (2D game library for Java) which is based on LWJGL which is an OpenGL ...
2
votes
2answers
630 views

Slick & NiftyGUI. Nifty initialize exception

I found my self into trouble when trying to run a Slick game with a Nifty Game State. This is the code: @Override protected void initGameAndGUI(GameContainer container, StateBasedGame game) ...
2
votes
1answer
896 views

Slick2D, Nifty GUI listeners problem

I'm trying to get Nifty GUI to work with Slick2D. So far everything is going great, except that I can't seem to figure out how to properly interact with the GUI. I'm trying the example in the nifty ...
2
votes
1answer
190 views

How do game developers make their game available for most of the resolutions?

I'm developing a game with Java using Slick2D and I want to make a game that could target all the recommended resolutions, as you can see in almost every game you could have an option of changing the ...
2
votes
1answer
312 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) ...
2
votes
3answers
175 views

Positioning entities in adjacent maps

Say I have a 2D tile based game engine (I don't, but I will soon). I was wondering how I would manage drawing adjacent maps. That is, imagine we have a map that is 50 by 50 tiles wide. Then next to ...
2
votes
2answers
434 views

Snake game - collision detection causing new position of apple to be rendered multiple times

I have a collision method implemented through the use of slick2d. When ever the snake collides with the apple, it causes the apple to be rendered in multiple places before the snake moves further ...
2
votes
1answer
75 views

Changing DisplayMode seems not to update Input&Graphic Dimension

I'm writing a small game using Slick and Nifty-GUI. At the program startup I set the DisplayMode using the following lines: AppGameContainer app = new ... app.setDisplayMode( 800, 600, false ); ...
2
votes
2answers
1k views

What is the most efficient way to add and remove Slick2D sprites?

I'm making a game in Java with Slick2D and I want to create planes which shoots: int maxBullets = 40; static int bullet = 0; Missile missile[] = new Missile[maxBullets]; I want to create/move my ...
2
votes
1answer
758 views

Slick2D Tile Based 'Fog of War' Blurring Problem

I'm working on my first Java Game and I have run into a little problem I'm hoping to get some help with. I'm using Slick2D displaying a tile based map, and I'd like to know how I can created a ...
2
votes
2answers
628 views

How to load chunks of 2d map segments when player reaches a certain point?

In my 2d platformer (made with Java and Slick2d), random maps are made by combining different segments together and displaying them one after the other. My problem is that I can't load too many ...
1
vote
3answers
1k views

How to efficiently manage animations and/or textures (resources) in a game?

I am using Java, particularly the Slick2D library. Seeing as this is my first game, I have no idea how I should manage the Animations and the textures in the game in a way to be both memory efficient ...