Log In  

Cart #recursive_shadowcasting-0 | 2020-02-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

What's a roguelike without some lighting? #7DRL is fast approaching so I thought I'd re-familiarise myself with pico8. I've ported shadowcasting before but someone on this forum has already done that for me. Unfortunately it's not in cart format where I can see it in action. So let's fix that.

I did some small changes:

  • "cast" gets used for a lot of things so I called it fov instead
  • Recursive shadowcasting calculates within a square, which looks ugly. I've added a distance check to slice off those hard corners.

Here's the url of the original post: https://www.lexaloffle.com/bbs/?pid=28780

Obviously I'm not looking at pico8's map, just one I've generated. But one could modify it to taste. I'm also being quite wasteful because I only need to iterate through the keys in "visible", but I wanted to be certain there were no bugs and this proves the point.

P#73376 2020-02-23 16:03 ( Edited 2020-02-24 10:39)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-12-05 02:43:49 | 0.009s | Q:13