The Land Of Light and Shadows (Part 3)

Index

Attached Files

The following files have been attached to this tutorial:

.capx

part-3-simple-with-layers.capx

Download now 192 KB
.capx

part-3-simple.capx

Download now 179 KB
.capx

part-3-very-simple.capx

Download now 179 KB
.capx

ball-shadow.capx

Download now 428 KB
.capx

line-of-site-full-grid.capx

Download now 310 KB
.capx

line-of-site-cone.capx

Download now 243 KB
.capx

cast-light-arc-01.capx

Download now 248 KB
.capx

cast-light-arc-reducing-length.capx

Download now 248 KB
.capx

cast-forwards-3.capx

Download now 318 KB
.capx

fog-test-01.capx

Download now 532 KB
.capx

cut-up-light-length.capx

Download now 318 KB

Stats

2,865 visits, 9,429 views

Tools

Method 3 - Light in an arc

Have a look at "Cast light arc 01" - This shows the last method I have been using to cast light/shadows. Run the program and move the mouse/sprite over the arc of red "light".

All this is doing is creating a long thin sprite "my light beam" and moving it through a set number of degrees. When this light beam touches an obstacle that particular light beam is destroyed.

A rather obvious problem is we are now left with a triangular shadow coming from the obstacle to the light source.

A simple solution to this is to reduce the light beams length on striking an object.

(see cast arc light reducing length.capx)

Note that I have each light beam set to fade out - there are other ways to do this but this is simple and it works.

To incorporate this method into a game then the light you would need to move these beams onto another layer and set the blend as previously discussed. The arc start point would need to be placed where the player is and the arc angle would need to take the players angle into account.

(Cast forwards 3.capx)

Well I guess that will do. Please leave a message with any question, comments or suggestions.

Have fun.

RPW

edit 6th April, 2014.

Added a couple more capx for you to have a look at - one cuts up the light into sections to get around the problem of long walls and the other is the fog test (see below). Both could do with tidying up and commenting...

.CAPX

part-3-simple-with-layers.capx

Download now 192 KB
.CAPX

part-3-simple.capx

Download now 179 KB
.CAPX

part-3-very-simple.capx

Download now 179 KB
.CAPX

ball-shadow.capx

Download now 428 KB
.CAPX

line-of-site-full-grid.capx

Download now 310 KB
.CAPX

line-of-site-cone.capx

Download now 243 KB
.CAPX

cast-light-arc-01.capx

Download now 248 KB
.CAPX

cast-light-arc-reducing-length.capx

Download now 248 KB
.CAPX

cast-forwards-3.capx

Download now 318 KB
.CAPX

fog-test-01.capx

Download now 532 KB
.CAPX

cut-up-light-length.capx

Download now 318 KB
  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!