Tag Info

New answers tagged

-1

I think you are using TiledMap library, I dont know of any tutorial specific to your requirement, but here is a basic code, experiment with it , and play around using properties, and you learn even more by experimenting, (no matter you have just started to look upon slick)... http://slick.ninjacave.com/javadoc/org/newdawn/slick/tiled/TiledMap.html This is ...


1

I figured out the problem myself! After printing the coordinates of the mouse to the console I realized that where just something missing with my Input. Sure enough, I added GameContainer to the constructor of minigun and set input to equal GameContainer.getInput();. It works perfectly now :D public Minigun(GameContainer container){ try { ...


0

After experimenting with my code for like 3 hours, I found the solution myself:- Before going to a different state, use the input.clearKeyPressedRecord() to clear all previously recorded key-Presses, or else even after changing a state, previously stored keyPress event will cause problems. So instead of doing this, public void changeState(GameContainer ...


0

Edit: just realised this is pretty old. Anyways, I did something similar to this in a TD game so hopefully the same would apply here. In my TileMap class I have a method called getTileCoord(int mouseX, int mouseY) and for your game it would be translated to something like this: int tileX = (int) (mouseX - camX) / tileWidth; int tileY = (int) (mouseY - ...



Top 50 recent answers are included