slick2d

Camera for 2d game

怎甘沉沦 提交于 2019-12-08 03:40:03
问题 I'm currently making an awesome (in my mind) zombie game and I need to know a good way to make a camera. I am using the Slick2d library along with MarteEngine for java. I'm kinda new to java and jumped straight into a library before really getting deep into swing and such so this is probably a lack of graphics knowledge. I read on a tutorial that you can't actually move the window of the game on the map so instead you need to move the map and objects to make it seem like the camera is moving.

Camera for 2d game

寵の児 提交于 2019-12-07 02:41:27
I'm currently making an awesome (in my mind) zombie game and I need to know a good way to make a camera. I am using the Slick2d library along with MarteEngine for java. I'm kinda new to java and jumped straight into a library before really getting deep into swing and such so this is probably a lack of graphics knowledge. I read on a tutorial that you can't actually move the window of the game on the map so instead you need to move the map and objects to make it seem like the camera is moving. If I was to do it this way it seems like it would be very resource intensive. I would have to loop

Rotate image to 'point' to mouse position

旧城冷巷雨未停 提交于 2019-12-06 12:13:13
问题 I have a gun image on top of a tank image. I want the gun to point towards the mouse position so the mouse can be used to aim. The original gun image will be pointing upwards. I'm using Slick2D and it's image class has a rotate function that takes an angle. How would I go about doing this? 回答1: You can find the location of the user's mouse by asking an Input object. This is done by asking the GameContainer for the input. Input userInput = gameContainer.getInput(); float mouseX = userInput

Slick TextField not working

北城以北 提交于 2019-12-05 16:12:04
I have a problem when using Slick2D's TextField. When using Slick's 'BasicGame' the TextField works fine - I am able to click on it, type words, and System.out.println the text fields contents. However, when using the same code on a 'BasicGameState', the TextField is un-clickable and doesn't respond to any input. So: Working code: package Help; import java.awt.Font; import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.BasicGame; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.SlickException; import org.newdawn.slick.UnicodeFont

Slick2d | Entity collision detection

六月ゝ 毕业季﹏ 提交于 2019-12-03 20:25:22
问题 The problem: I know this has been asked for many times, but I didnt find any good answers. So I have got some entities for my game, now what is the best way for checking collisions? Links: The game (finished) Code explanation: I've got a list of entities in my world class: List<Entity> entities = new ArrayList<Entity>(); // The list in the World class I update them with this code (only if inside the view range): public void update(GameContainer gc, int delta) { for (int i = 0; i < entities

Slick2D vs Straight LWJGL

给你一囗甜甜゛ 提交于 2019-12-03 04:18:40
I've been delving into game programming with Slick2D, and I've began to wonder if in the long run, knowing LWJGL would be more helpful. On one hand, Slick2D is fast and simple, but it seems LWJGL is more adaptable in the sense that it has both 2D and 3D capabilities. For someone who is intermediate in java, and wants to make games, would it be worth the additional effort to learn LWJGL right off the bat? I don't think the two are really related. I mean, I know Slick is built on top of LWGJL, but that's not what I'm getting at here. Slick exists to take advantage of the hardware graphics and

Slick2D Rectangle Collision Detection

淺唱寂寞╮ 提交于 2019-12-02 14:28:01
问题 I'm having an issue showing that one rectangle has collided with another. So my question is, how can I get the intersect method to check for collision? Or are there any other ways to handle collision in this situation? I'm creating a turn-based combat game (similar to Final Fantasy or Legend of Dragoon) where the player's character is on the right side of the screen and the enemy is on the left side. The player and enemy each take turns attacking. So when the player attacks, the sprite

Slick2D Rectangle Collision Detection

橙三吉。 提交于 2019-12-02 07:15:39
I'm having an issue showing that one rectangle has collided with another. So my question is, how can I get the intersect method to check for collision? Or are there any other ways to handle collision in this situation? I'm creating a turn-based combat game (similar to Final Fantasy or Legend of Dragoon) where the player's character is on the right side of the screen and the enemy is on the left side. The player and enemy each take turns attacking. So when the player attacks, the sprite animation moves across the screen from right to left until it stops in front of the enemy, attacks, and

Exception in thread “main” java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

馋奶兔 提交于 2019-12-01 17:16:50
I'm building the basic Slick game example explained here: http://slick.cokeandcode.com/wiki/doku.php?id=01_-_a_basic_slick_game , and I'm running into some problems. Specifically, the game compiles just fine, but when I try to run it, Java complains: Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1856) at java.lang.Runtime.loadLibrary0(Runtime.java:845) at java.lang.System.loadLibrary(System.java:1084) at org.lwjgl.Sys$1.run(Sys.java:75) at java.security.AccessController.doPrivileged(Native Method)

xml FileNotFoundException using slick2D library in java

自古美人都是妖i 提交于 2019-11-29 15:33:22
private ConfigurableEmitter emitter; File xmlFile = new File("ressources/emitter.xml"); emitter = ParticleIO.loadEmitter(xmlFile); If I launch the project in eclipse, everything will works fine, but after I export my project and use JarSplice to create a .jar file, when I launch the jar file using the command prompt, the program will crash launching a FileNotFoundException, saying it cannot find the path specified. java.io.FileNotFoundException: ressources\emitter.xml (The system cannot find the path specified) The surprising thing is that just before opening the xml file, I open a .png file