Matthias Bay
Matthias Bay
The G packet is 7 bytes long (last index is 6, but index starts at 0), the g packet is 9 bytes long.
Be careful! In the 's' packet the position is an int24, but multiplied by 5. So if the position in the 's' packet is 144685, the snake actually has the...
What client are you using for testing? Does the sudden-movement happen on client side only or also on server side?
I don't understand this line: `conn.snake.body.x += Math.round(Math.cos(conn.snake.direction.angle * 1.44 * Math.PI / 180) * 170);` - You probably don't have to round here - What is the measurement of...
That's boring :( so the snake can only go to the right? I meant the measurement, so does it go from 0 to 360 or to 2*PI or something else?
@GrumpyOet make a code for what?
I don't speak JS, but this is the general idea: `deltaAngle = mamu * deltaTime * snake.scang * snake.spang` (`deltaTime` is the time in ms since the last iteration /...
`snake.scang = 0.13 + 0.87 * Math.pow((7-snake.sc)/6 , 2)` `snake.spang = Math.min(snake.speed/spangdv, 1)` `snake.sc = Math.min(6, 1 + (parts.size-2)/106.0)`
You only need opposite code when you modify before/after sending, like you have x in your code, but you send data=10*x, then you have to read it with x=data/10. So...
Okay, take a look at the direction-packet ('e'): You make an Uint8Array sized 7 and write 8 bytes in it. That doesn't work. You set the first two bytes to...