GameMaker (2.0 - 2.2.x)
Icon

Collision Arc with L.o.S.

Nocturne Games

You must be logged in to obtain assets

Description

Ever wanted to check to see if there is a collision within an arc of a circle or create a "cone of vision" for AI? Well, you can, and easily, with this asset! You do not even need to change anything, just add the scripts and call them like any other GML function!

This asset contains two sets of scripts:

  • Set One: This set contains the basic collision_arc script that functions exactly the same as the GML collision_ functions, as well as an additional collision_arc_draw script that permits you to draw the defined collision arc to the screen in multiple different ways.

  • Set Two: This set contains the advanced collision_arc_instance scripts. These scripts are designed to help create an AI "cone of vision", and as such require you to call a set up script in the Create Event of the instance to use them, before calling the general collision_arc_instance script in the Step Event. The idea here is that the scripts will not only check for an instance within the collision arc, but they will also check to see if the instance can be "seen" or not by checking to see if there is a line of sight between the calling instance and the "seen" instance. This line of sight will be checked against the "wall" object of your choice, or even a tile layer that you give (or both, so you can use the tile layer for "walls" and then use instances for additional obstacles). These instance scripts also have draw scripts, getter scripts and setter scripts, making them incredibly easy to use..

Both sets of scripts have a "fast" option which can be enabled or disabled to use better precision or not, and all scripts have been highly optimised and contain extensive comments. There is an additional collision_arc_instance_draw_batch script too, which permits you to batch all arc draw calls and so maintain texture swap overhead as low as possible. All of this is illustrated in the Demo that comes with the scripts.

More info

End User Licence Agreement (EULA).

Age Rating: None

Version

GMS2 - Version 1.0.1. Published April 15, 2017

  • Minor bug fix for when no "blocker" object or tilelayer is set.
  • ca_set_tilelayer script fixed to accept a setting of -1 correctly
  • Improved Demo room with more options
Privacy Policy
Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait