Type: Function
Overview
Describes the default behavior of artificial intelligence on visual contact with objects.
Examples
Change default ai functionality on visual contact with objects
local newAI = require('classes.SimpleAI').newAI -- enemy instance local enemy = newAI({group = mainGroup, img = "snailWalk1.png", x = halfW-50, y = display.contentHeight-500, ai_type = "patrol"}) -- сhange default ai functionality on visual contact with objects function enemy:defaultActionOnVisualContactWithObjects(event) print("I see you " .. event.other.type) -- will print debug text in output end