I'm trying to implement this tutorial by permadi into Love2d https://permadi.com/1996/05/ray-casting ... -contents/.
Right now I'm on part 7 and attempting to implement the detection of intersections with horizontal gridlines. I've drawn the map grid and the player's first ray and it appears to work for certain angles, but while rotating it reaches a point when the game crashes with the "Attempt to index a nil value" error message.
Also, at 15 degrees, the detection does not work at all and the ray stops before it even reaches a wall. I've sat here for a day but I can't find any way to prevent these two errors. How do I fix it?
Trying to make a Raycaster. Issues with angles and list indexing
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Sun May 03, 2020 9:06 pm
Trying to make a Raycaster. Issues with angles and list indexing
- Attachments
-
- main.love
- (1.52 KiB) Downloaded 132 times
Re: Trying to make a Raycaster. Issues with angles and list indexing
Hi, welcome to the forums.
The game crashes when one coordinate becomes negative.
The game crashes when one coordinate becomes negative.
Who is online
Users browsing this forum: Google [Bot] and 3 guests