1
local dirs = {'left', 'right', 'up', 'down'}
3
NotPlayer = Fill:extend {
5
width = 16, height = 16,
8
self.direction = dirs[math.random(1,4)]
10
doMove = function(self)
11
if math.random(1,4) == 1 then -- change direction ~25%
12
self.direction = dirs[math.random(1,4)]
15
if self.direction == 'left' then
16
self.x = self.x - self.width
17
elseif self.direction == 'right' then
18
self.x = self.x + self.width
19
elseif self.direction == 'up' then
20
self.y = self.y - self.height
21
elseif self.direction == 'down' then
22
self.y = self.y + self.height
b'\\ No newline at end of file'