Type: Function
Overview
Describes the default behavior of artificial intelligence on collision with the player.
Examples
Change default ai functionality on collision with the player
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"}) -- change default ai functionality on collision with the player function enemy:defaultActionOnAiCollisionWithPlayer(event) print("I caught you " .. event.other.type) -- will print debug text in output end