Hot answers tagged

2

Depends how your engine works. Your player could be responsible for checking for ropes, or your ropes could be responsible for checking for the player. Either way, I think both your player and your rope are going to need to know that they're attached, so whichever way you choose, you're going to need to have an 'attach' function in both classes.


1

You could let a point travel on a circle in discreet steps and adjust the radius for each step, that would make it look jagged and irregular. Something like this might work for you: /** * * @param px The center X of the shape * @param py The center Y of the shape * @param numberOfNodes How many dents the shape can have. * @param minRadius Radius of ...


1

libGDX Json converts Enums to strings and therefore cannot serialize / de-serialize Map keys to anything but strings. To fix this, either... Use strings for keys in Maps (ObjectMap, HashMap ect.). Use GSON, which can serialize Enum Map Keys just fine. Write lots of special serialization / de-serialization code using a class that implements Json....


1

I think there is a minor typo in your code, see SpriteSheet class public BufferedImage grabImage(int col, int row, int width, int height) { BufferedImage img = image.getSubimage((col * 32) - 32, (row * 32) -32, width, height); //return image; typo here! return img; } what actually happens: you crop a sub image (named img) from your ...


1

for(int i=0; i< (tiles.length); i++) { colours[i*4+ 0] = 0xff00ff; colours[i*4+ 1] = 0x0000ff; colours[i*4+ 2] = 0xffff00; colours[i*4+ 3] = 0xffffff; } The For-Loop at the start is generating groups of four colour entries based on how many tiles you have. It's a little convoluted to read at a glance and given choice I'...


1

Today there exists a ready-to-use wrapper on github: https://github.com/code-disaster/steamworks4j This could be what you are looking for!


Only top voted, non community-wiki answers of a minimum length are eligible