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

learn more… | top users | synonyms (1)

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
522 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
302 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
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 ...
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 ...
4
votes
4answers
501 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
154 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
73 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
139 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
850 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
215 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
902 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
957 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
453 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
178 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
148 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
582 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
94 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
5k 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
557 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 ...
0
votes
2answers
167 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 ...
-1
votes
1answer
339 views

How to make an Image still when at position at Slick 2D?

I wanted to have a build functions. When I press for example 2, the image will appear with my character. The question is, how do I stop it from following my character //build //I created many ...
2
votes
1answer
930 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
2answers
139 views

How do I add Destroy with radius on Java Slick2d? [closed]

For Example, There is a tree(image) and i want to destroy it. I want my character only destroy it (For example the character must be facing the tree to destroy it and there must be a range were you ...
1
vote
2answers
2k views

Creating maps and tileset for a 2d java game

I'm not a completly beginner to java, so I decided to write a map loader and a tileset loader myself instead of using a tilemap editor like Tiled. I'm using Slick & LWJGL for my game. The plan ...
1
vote
1answer
84 views

Variable Visibility Class Interaction

I have a very general question about how game classes interact with eachother in a growing RPG game project I'm working on. (Writing it in java/Slick2D, not that is matters because the question is ...
0
votes
1answer
106 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
3answers
1k 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 ...
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 ...
2
votes
1answer
1k 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 ...
1
vote
1answer
241 views

Invert colors Java rendering

I am making a 2d platformer in java using the slick2d engine. I only use 2 colors: black and white. I want to implement a feature were i invert the colors of certain entities. However i can't find a ...
1
vote
1answer
2k views

Vector movement in space type game (Mouse rotation)

I'm having an issue with my movement in my 'game' prototype. It's basically not working and admittedly my knowledge with vectors is lacking. The issue I'm running into is that the ship won't move in ...
2
votes
3answers
165 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 ...
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?
1
vote
1answer
3k views

How do I play background music in Slick/LWJGL?

I'm trying to play music in the background for my opening menu, but cant seem to find a tutorial specifically on how to play a music file. Does anyone know how this can be accomplished?
0
votes
1answer
953 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 ...
2
votes
2answers
400 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 ...
0
votes
1answer
567 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 ...
1
vote
5answers
2k views

Collision detection - player gets stuck in platform when jumping

So I'm having some problems with my collision detection with my platformer. Take the image below as an example. When I'm running right I am unable to go through the platform, but when I hold my ...
0
votes
1answer
2k views

Slick2D - Cannot instantiate the type Image

I am getting this strange error and I cannot for the life of me figure out why: Cannot instantiate the type Image CODE: import java.awt.Image; import org.newdawn.slick.GameContainer; import ...
1
vote
1answer
355 views

Texture switching with a entity system

I'm using thinking of using an entity system in my game. So far I've been using Artemis with success. However, I have a question about texture switching. I read that switching textures too often is ...
1
vote
2answers
1k views

how should I network my turn based game?

I'm writing a very basic turn based strategy game which allows a player to select units and attack enemy units on their turn. The game is written in Java using the slick2d library and I plan to use ...
-2
votes
1answer
184 views

Issues with networking in my Java game, Client crashes when I try and read from the server input

A buddy and I have been programming a code game over the last 2 weeks, it is intended to be a multiplayer game with the ability to have 2 players play against each other. I am running into an issue ...
1
vote
2answers
2k views

Pass information between states in slick 2d?

I am making simple game in java using Slick 2d. My question is how many ways of passing information between states are available in Slick 2d. I am having a Hero class that holds all the hero stats and ...
1
vote
2answers
2k views

Dynamically load images inside jar

I'm using Slick2d for a game, and while it runs fine in Eclipse, i'm trying to figure out how to make it work when exported to a runnable .jar. I have it set up to where I load every image located in ...
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
3answers
4k 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 ...
1
vote
2answers
1k views

Adding a short delay between bullets

I'm having some trouble simulating bullets in my 2D shooter. I want similar mechanics to Megaman, where the user can hold down the shoot button and a continues stream of bullets are fired but with a ...