The Slick2D graphic engine and utility collection is meant to make the development of games using LWJGL easier.
1
vote
2answers
73 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)) ...
1
vote
1answer
114 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 ...
1
vote
1answer
178 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 ...
1
vote
1answer
102 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) ...
1
vote
1answer
218 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 += ...
1
vote
2answers
827 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
143 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
5answers
850 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 ...
1
vote
2answers
579 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 ...
1
vote
1answer
188 views
Slick2D drawString with coordinates from bottom-left corner
For OpenGL text drawing I use Slick2D library. Default Slick2D 0:0 coordinates are at upper-left corner. But in my project I use bottom-left corner for 0:0. Is it real to configure Slick2D with ...
1
vote
3answers
991 views
How do I load tmx files with Slick2d?
I just started using Slick2D and learned how simple it is to load in a tilemap and display it. I tried atleast a dozen different tmx files from numerous examples to see if it was the actual file that ...
1
vote
2answers
618 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 ...
1
vote
1answer
494 views
Using Slick2D/LWJGL to brighten an Image
Using the Slick2D Library for Java, I want to know if there is a way to brighten an instance of org.newdawn.slick.Image. I'm willing to use other image-manipulation libraries if need be.
1
vote
1answer
1k views
Rotation of images in Slick2D
I have have a rotation problem in the Slick2d library, the image is just not rotating (ie I set a rotation but no result is shown). Here is the rotation code:
if (input.IsKeyDown(Input.KEY_LEFT)) {
...
0
votes
2answers
927 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 ...
0
votes
2answers
695 views
deciding user movement path - slick 2D
i'm going to describe what need to be done... "there are circular areas marked in a map, large areas a person can easily move in to them and out of them" what i'm trying to do is deciding weather the ...
0
votes
2answers
561 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
1answer
666 views
How to implement HUD
I'm wondering how one could implement an HUD in LWJGL. I've seen tutorials on this, but they don't seem to work. I know the basic structure goes like this:
init3d();
// 3d code
init2d();
// HUD
To ...
0
votes
1answer
94 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
1answer
290 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 ...
0
votes
1answer
1k views
Resource not found: testdata/alphamap.png
I started a tutorial for java's slick 2d library, called SlickBlocks which is essentally a tetris clone. The problem is I have followed and typed in the code examples to the dot, yet when I run it I ...
0
votes
1answer
52 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. ...
0
votes
2answers
72 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 ...
0
votes
1answer
170 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 ...
0
votes
2answers
120 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 ...
0
votes
3answers
505 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 ...
0
votes
1answer
518 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 ...
0
votes
1answer
425 views
how to get the current location in the map surface - slick 2D
@Override
public void mouseMoved(int oldx, int oldy, int newx, int newy) {
super.mouseMoved(oldx, oldy, newx, newy);
}
we can get the mouse location in this method via newx, newy . i want to know ...
0
votes
1answer
312 views
How do I get the current location when using slick 2D library?
I'm developing a map kind of simple game using slick 2D library, and I want to get the current location of the user. When the user runs into a special location (ex: hole) to indicate that is ...
0
votes
0answers
23 views
How can I find the pixel color of a given position in a SlickUtils 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
0answers
64 views
Why does Slick import Tiled object rectangles without width, height, and name tags?
I tried using Tiled rectangle objects as walls with Slick's TiledMapPlus class, but as I soon realized that each GroupObject would return 0 for width and height. The code I used looks like this:
...
0
votes
0answers
125 views
Slick 2D jar creation
I recently finished making my game using Slick2D, and now I'm trying to create a jar file to play the game. I looked on the Slick forums, and saw that JarSplice was the recommended program. So I used ...
0
votes
0answers
693 views
Issues playing audio with Slick 2D [closed]
Started trying to learn Slick 2D a few days ago and have enjoyed it so far. The only problem is I can't seem to be able to get audio to play. I have tried going through the documentation examples, ...
0
votes
0answers
92 views
How do I separate codes with classes? [closed]
I have this main class:
package javagame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import ...
0
votes
0answers
29 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 ...
0
votes
2answers
322 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 ...
0
votes
1answer
964 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
838 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 ...
0
votes
0answers
537 views
Slick 2d scrolling off screen
I have something scrolling in and out of the screen. Now when it goes off screen, I want it to scroll into the screen at another location. What I do is I grab the last pixels at the screens edge using ...
0
votes
0answers
311 views
ParticleSystem in Slick2d (with MarteEngine)
First of all, sorry if this sounds very newbie-ish. I'm stuck at making a ParticleSystem I made using Pedigree to work in my game. It's basically an explosion that I want to display whenever an enemy ...
-1
votes
1answer
75 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, ...
-1
votes
1answer
296 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 ...
-1
votes
1answer
216 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 ...
-1
votes
0answers
41 views
Strange Resource not found error [closed]
I'm getting this error when I try to run my application:
java.lang.RuntimeException: Resource not found: /res/images/
at ...
-1
votes
1answer
307 views
Slick2D and Clipping
How would I go about using clipping in Slick2D?
I want to have an infinitely large world, however I'm not very good with clipping and it's my only problem. I don't have anything drawn outside of the ...
-2
votes
1answer
151 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 ...
-2
votes
1answer
360 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 ...
-2
votes
2answers
90 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 ...
-2
votes
1answer
74 views
Slick game adding enemies towards the player [closed]
I'm beginner in java games, and this is my first time using Slick!
I followed the thenewboston tutorials to code my game.
My game is about a princess lost in a maze, on her way she finds bugs coming ...
-2
votes
1answer
138 views
Why do I have an error when adding states in slick? [closed]
When I was going to create another state I had an error.
This is my code:
public static final int play2 = 3;
and
public Game(String gamename){
this.addState(new mission(play2));
}
...

