Tag Info

New answers tagged

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 a good nights rest, I have worked out the solution. By moving the problem logic : for (int intlc = 0; intlc < Items.Count; intlc++) { if (Items[intlc] != null) { if (Items[intlc].invhover) { if (ms.LeftButton == ButtonState.Pressed && ...


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