HOME | DD

Computer-Turret — AS3 Line Of Sight

Published: 2010-02-08 12:08:21 +0000 UTC; Views: 2657; Favourites: 4; Downloads: 48
Redirect to original
Description No real objective, just a plaftormer engine combined with the new engine Rob started. Rob came up with the idea of kind of tracing a circle around the character with a bunch of points, and then stopping them when they hit the wall. With that we could fill in the area with a gradient and mask the floor with it.
Makes a pretty cool line of sight engine.
[edit] Forgot to mention that the maze is draw dynamically using data from an array[/edit]

Arrow Keys to move and jump. Avoid the red circle that randomly floats around the maze as it will put you back at the start.
No there is no exit.
Related content
Comments: 6

KiraCou [2011-11-25 23:40:01 +0000 UTC]

hey, it looks very nice... i would like to take a look in your code, i have the idea on how it works... but i'm new developing games and i would like to implement a feature like that in this game... ^^

👍: 0 ⏩: 0

MOGIsb29 [2011-08-26 22:04:06 +0000 UTC]

WOW.. what a cool maze

👍: 0 ⏩: 0

Legogo [2010-03-28 15:55:36 +0000 UTC]

Very interesting.

Maybe you can go further into the detail of this engine ?
You create a shape around the character to apply a mask ?
Is it based on "lineTo"s on every 360° ?

👍: 0 ⏩: 1

Computer-Turret In reply to Legogo [2010-03-28 21:38:05 +0000 UTC]

Basically yes that is what we did. For better performance (less cpu usage) it actually checks every 2 degrees rather than every 1 degree.
It takes a point, and moves out from the character until it hits a wall and then draws a line. Then it's just drawing in a gradient fill and making it a mask.
I'll send you the fla in a note if you want to look at the source.

👍: 0 ⏩: 0

wonderwhy-ER [2010-02-11 12:33:28 +0000 UTC]

Nice

👍: 0 ⏩: 0

collinbollin [2010-02-09 01:56:48 +0000 UTC]

wow dtaled ad an obgective and it'ed be fun!(well actly it already it!)

👍: 0 ⏩: 0