Drawing script:
local points = {}
function onCreate()
end
function onUpdate(dt)
local touches = castle.getTouches()
for _, touch in ipairs(touches) do
if touch.pressed then
table.insert(points, {x = touch.x, y = touch.y})
end
end
end
function onDraw()
castle.draw.setColor(0, 0.4, 1)
for _, p in ipairs(points) do
castle.draw.circle("fill", p.x, p.y, 0.15)
end
end