The Slick2D graphic engine and utility collection is meant to make the development of games using LWJGL easier.
-2
votes
1answer
77 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 ...
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 ...
3
votes
0answers
94 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 ...
-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 ...
2
votes
2answers
428 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)
...
3
votes
3answers
99 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);
...
0
votes
0answers
65 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:
...
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)) ...
0
votes
1answer
54 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
4answers
262 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:
if (player1.getX()+5 < 974 && player1.getX()-5 > 0) {
...
0
votes
2answers
73 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 ...
1
vote
3answers
996 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 ...
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
0answers
127 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 ...
5
votes
4answers
604 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 ...
0
votes
0answers
710 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, ...
1
vote
2answers
388 views
Collision Problems in Pacman Clone
I am working on a Pacman clone. I am using Java for the project. I have been having problems with collisions, and allowing the player to pass through objects. Note that the tile size (and player) is ...
-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
vote
1answer
115 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 ...
2
votes
5answers
529 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 ...
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 ...
1
vote
2answers
660 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 ...
0
votes
0answers
93 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 ...
3
votes
1answer
203 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
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 ...
2
votes
1answer
102 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 ...
-1
votes
1answer
221 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 ...
0
votes
3answers
512 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 ...
4
votes
4answers
384 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 ...
3
votes
2answers
357 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 ...
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) ...
-5
votes
1answer
64 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();
...
-3
votes
1answer
88 views
How to reference or connect a variable to another class without stack overflow? [closed]
I really need to re-arrange all my functions. I created a class. All my var, booleans, int, doubles and other things. I created every new variable so they can reference it and so they don't have an ...
-6
votes
1answer
97 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 ...
-3
votes
1answer
73 views
Why does my text is shown below an image? [closed]
My text is below an Image but my other text is above the image. I can't find out why. It just have an if statement.
if(renderText==false)
{
g.drawString("heelo", 300, 600);
}
Even ...
-2
votes
1answer
363 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 ...
-6
votes
1answer
310 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
536 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
219 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 += ...
3
votes
3answers
2k 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
1answer
798 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 ...
4
votes
2answers
1k views
Move 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 ...
-5
votes
2answers
141 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
139 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
564 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
327 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
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
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));
}
...
-1
votes
1answer
298 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 ...


