Closed Stan-Stani closed 8 years ago
Yes, intX just indicates how many bytes you need. In my opinion this is bad, since the range (e.g. bytes 3-5) already tells you that and often you get floating-point data and not an integer.
Yes. Just read the 3 bytes, divide the by 5 and you've got the x coordinate. (0|0) is top-left, with gr being the game_radius from the init-packet, (2_gr | 2_gr) is bottom-right.
There are generally no negative values, so everything is unsigned.
I'm unsure of what the intX data types mean. Are they just indicating how big the number potentially is by indicating the number of bytes? E.G. int8 would be one byte, int16 is 2 bytes, etc?
I'm asking because I'm trying to derive my snake's coordinates from the "s" packet when it spawns. I also don't know what "value / 5" means. Does it literally mean the x value is the given value divided by five? Could someone give me the layout of the game coords? Is negative y up? Is negative x left? I probably have to derive the bounds from the setup packet, right?
Also, is the first byte of the coordinates indicating the sign? Is 0 negative?
Thanks!