I have a problem missile which has a speed of 2,000 such collisions randomly disappear when you do not know why?
thank you very much
Develop games in your browser. Powerful, performant & highly capable.
This is a quite common mistake, and has been explained many times before, but here goes......
You need to understand that, with a speed of 2000 pixels per second, the bullet will be travelling at over 33 pixels per tick - 2000/60.
That means that the bullet will travel over 33 pixels when the program performs a collision check, which happens each tick.
As the solid border is only 30 pixels wide, it is obvious that at some ticks, the bullet will have travelled right through the border in 1 tick, therefore looking like it moves through the boundary.
The quick answer is to either slow the bullet or increase the size of the borders.
super thank you