3
width = 16, height = 16,
7
local dirs = {'left', 'right', 'up', 'down', ''}
8
self.queue:push_right(dirs[math.random(1,5)])
11
onUpdate = function(self)
12
local keys = {the.keys:allJustPressed()}
14
self.queue:push_right(keys[1])
16
local inst = self.queue:pop_left()
17
if inst == 'left' then
18
self.x = self.x - self.width
19
elseif inst == 'right' then
20
self.x = self.x + self.width
21
elseif inst == 'up' then
22
self.y = self.y - self.height
23
elseif inst == 'down' then
24
self.y = self.y + self.height
b'\\ No newline at end of file'