Radius and blocked line of sight on a grid.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Sharkinmytea
Prole
Posts: 11
Joined: Wed Sep 30, 2015 6:03 pm

Radius and blocked line of sight on a grid.

Post by Sharkinmytea »

Hi, I'm in the making of a rogue like game and I bumped into two problems.
The first one is my attack system.
It's turn by turn based and I'm having difficulties to create a solution to solve my line of sight problem.
Image

Basically, there is the player and there is the wall. I want the squares behind the wall to be unable to receive damage since the ''fire breath'' started from the player.
Does anyone have a good way of doing that?
Hey, i'm not a native english speaker, so if you think the word I used is not the one I meant, please tell me :)
User avatar
DeltaF1
Citizen
Posts: 64
Joined: Mon Apr 27, 2015 4:12 pm
Location: The Bottom of the Stack
Contact:

Re: Radius and blocked line of sight on a grid.

Post by DeltaF1 »

There are some really good articles on this, that I can't seem to find again >.<

Basically you raycast from the player to find the squares affected by the breath, but there's some other stuff you can do to get rid of irregularities, like flood filling tiny patches where the player might have seen through a wall or something.

Here are some of the articles I found with a cursory Google search, but I'll post here if I find the ones I was thinking of.
http://www.adammil.net/blog/v125_Roguel ... ithms.html
http://www.roguebasin.com/index.php?tit ... dowcasting
User avatar
Sharkinmytea
Prole
Posts: 11
Joined: Wed Sep 30, 2015 6:03 pm

Re: Radius and blocked line of sight on a grid.

Post by Sharkinmytea »

Thanks, with the information you gave me, i searched a little bit more and found exactly what I needed there:viewtopic.php?f=5&p=159707
Hey, i'm not a native english speaker, so if you think the word I used is not the one I meant, please tell me :)
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot] and 8 guests