So I was making a raycaster in Python via pygame and the first render render was a bit square-ish not a circle btw all lights are circles for my sake
hers is the move obj code i use and sahpe code:
def add_new_shape_light(x: int, y: int, radius: int, colour: Tuple[int, int, int]) -> None:
new_light = Shape("circle", x, y, colour, random.randint(1, 100) / 100, radius)
allcurentshapes.append(new_light)
for angle in range(360):
new_ray = RaycastLine(move_object(angle, x, y, 100)[0], move_object(angle, x, y, 5)[1], len(allraycasts), 255, angle)
allraycasts.append(new_ray)
new_ray.FindWereHitAndMoveToFind()```
# and
def move_object(angle: float, x: float, y: float, increment: float) -> Tuple[float, float]:
radians = math.radians(angle)
delta_x = increment * math.cos(radians)
delta_y = increment * math.sin(radians)
return x + delta_x, y + delta_y```
i wanted a circle light ray render but git a squaresh-ish
[What i get](https://i.sstatic.net/TMsT86tJ.png)ish
New contributor
Pankaj Maini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.