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).

Changes in 1.0.1

  • 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

Version 1.0.1. Published April 15, 2017

Age Rating: 4+

Privacy Policy

Average Rating

This asset hasn't received enough reviews yet.

Your review

You can only review assets you've bought.

No reviews yet

No reviews have been left for this asset - be the first!

Package contents

Total size 32.9 KB

assetpackage.yy 10.6 KB objects paths rooms scripts
ca_get_blocker ca_get_facing ca_get_fast ca_get_fov ca_get_range ca_get_tilelayer ca_set_blocker ca_set_facing ca_set_fast ca_set_fov ca_set_range ca_set_tilelayer collision_arc collision_arc_draw collision_arc_instance collision_arc_instance_draw collision_arc_instance_draw_batch collision_arc_instance_init collision_line_tile READ_ME_FIRST
sprites tilesets

What is the issue?

Back to Top