# Projection functions¶

Example:

```# Produces line projection
# ....................
# ....................
# .@*******#..........
# ....................
# ....................
rlfl.project_beam(map_number, p, p1)

# Produces line to ball projection
# Note: ball spells are usually a combination
#       of beam and ball.
# ........***...........
# .......*****..........
# .@....*******.........
# .......*****..........
# ........***...........
rlfl.project_ball(map_number, p, p1, 3)

# ........***...........
# .......*...*..........
# .@....*.....*.........
# .......*...*..........
# ........***...........
rlfl.project_ball(map_number, p, p1, 3, rlfl.PROJECT_SHEL)

# ......*******.........
# ......*******.........
# .@....*******.........
# ......*******.........
# ......*******.........
rlfl.project_ball(map_number, p, p1, 3, rlfl.PROJECT_SQUARE)

# ......*******.........
# ......*.....*.........
# .@....*.....*.........
# ......*.....*.........
# ......*******.........
rlfl.project_ball(map_number, p, p1, 3, rlfl.PROJECT_SQUARE|rlfl.PROJECT_SHEL)

# .........*............
# ........***...........
# .@.....*****..........
# ........***...........
# .........*............
rlfl.project_ball(map_number, p, p1, 2, rlfl.PROJECT_DIAMOND)

# .........*............
# ........*.*...........
# .@.....*...*..........
# ........*.*...........
# .........*............
rlfl.project_ball(map_number, p, p1, 2, rlfl.PROJECT_DIAMOND|rlfl.PROJECT_SHEL)

# Produces breath projection
# .........***.......
# .....********......
# .D********@**......
# .....********......
# .........***.......
rlfl.project_cone(map_number, p, p1, 3)

# 3 Enemys (or walls) marked with rlfl.CELL_REFL
#.....R.....#........
#....*.*...*.........
#...*...*.*..........
#..R.....R...........
#...*................
#....@...............
#....................
rlfl.project_beam(map_number, p, p1, rlfl.MAX_RANGE, rlfl.PROJECT_REFL)
```

## Projection flags¶

rlfl.PROJECT_THRU

Causes the projection to ignore walls

rlfl.PROJECT_STOP

Causes projection to stop on first cell marked rlfl.CELL_OCUP

rlfl.PROJECT_PASS

Causes projection not to stop at target

rlfl.PROJECT_SHEL

Causes empty ball projection.

rlfl.PROJECT_SQUARE

Causes a square shaped projection.

rlfl.PROJECT_DIAMOND

Causes a diamond shaped projection.

rlfl.PROJECT_REFL

Causes projection to bounce of cells marked CELL_REFL.

## Function list¶

rlfl.project_beam(map_number, source, target[, range, flags])

Return a beam projection as a set on tuples (x, y).

range defaults to max range.

rlfl.project_ball(map_number, source, target, radius[, range, flags])

Return a ball shaped projection as a set on tuples (x, y).

range defaults to max range.

rlfl.project_cone(map_number, source, target, radius[, range, flags])

Return a cone shaped projection as a set on tuples (x, y).

range defaults to max range.