Type: Number
Default value: 5000
Overview
Time, in milliseconds, after which an object changes its direction. (This property is needed, if
ai_type
Examples
Decrease the time, in milliseconds, after which an object changes its direction (i.e. look to the right side an then look to the left side)
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 = "guard"}) enemy.switchDirectionTime = 2000 -- the object will quicker change its direction