Skip to content

Instantly share code, notes, and snippets.

@davidmilligan
Created July 18, 2016 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidmilligan/57487c15882a096415c07a59d19b8087 to your computer and use it in GitHub Desktop.
Save davidmilligan/57487c15882a096415c07a59d19b8087 to your computer and use it in GitHub Desktop.
poke.lua
-- Don't Click Me!
task.create(function()
while true do
msleep(math.random(1000,10000))
local x = math.random(display.width)
local y = math.random(display.height)
display.circle(x,y,24,COLOR.BLACK,COLOR.BLACK)
display.circle(x,y,20,COLOR.RED,COLOR.RED)
half_circle(x,y,20,COLOR.LIGHT_GRAY)
display.rect(x-20,y-2,40,4,COLOR.BLACK,COLOR.BLACK)
display.circle(x,y,10,COLOR.BLACK,COLOR.BLACK)
display.circle(x,y,6,COLOR.LIGHT_GRAY,COLOR.LIGHT_GRAY)
end
end)
function half_circle(cx,cy,r,color)
local r2 = r * r
for y=0,r,1 do
for x=-r,r,1 do
if x*x+y*y <= r2 then
display.pixel(cx+x,cy+y,color)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment