Created
July 18, 2016 00:28
-
-
Save davidmilligan/57487c15882a096415c07a59d19b8087 to your computer and use it in GitHub Desktop.
poke.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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