Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Thanks! The cones are a series of raycasts that we shoot out from each enemy's origin. So we created a Ray object that:

  1. Shoots from origin of Enemy objects
  2. Checks for Object collisions (if any)
  3. Returns the first object hit
  4. Does an additional collision check to determine which side of the object Sprite it hits
  5. sets the draw distance of the ray to the point on the side its colliding on. (and call draw_triangle() on each pair of consecutive rays)
  6. If the object is the player, changes the enemy state so it attempts to chase the player, instead of patrolling an area

I hope that answers the question, but if you want to take a look, the source code is available on github: https://github.com/nKowalchyk/StealthWrench

Awesome, very helpful! Thanks!