I made a rudimentary raycaster that can be used for more continuous collision
Syntax:
this.cast(slope,y-intercept,target,step size)
To calculate y-intercept:
this.y-(this.x*(slope));
To get slope from rotation:
slope=Math.tan(this.rotation/180*Math.PI)
The function will return the distance between the raycasts
If the raycast does not hit the target, it will return 0
Raycast11-2-2022_12-15-17.wick (3.0 KB)