Lua scripts - a simple "target" display for zapper

This commit is contained in:
adelikat 2010-03-12 17:40:03 +00:00
parent c1590b3a1b
commit 2393cfca49
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
--Zapper display
--written by adelikat
--Purpose: To show the target of the zapper on screen
-- Primary use is for fullscreen where the mouse cursor is disabled
local zap --get zapper.read() values
local color = "white" --color of outside bull's eye circles
while true do
zap = zapper.read()
--Red if firing
if (zap.click == 1) then
color = "red"
else
color = "white"
end
--Draw bull's eye
gui.box(zap.xmouse-1,zap.ymouse-1,zap.xmouse+1,zap.ymouse+1,"clear","red")
gui.box(zap.xmouse-6,zap.ymouse-6,zap.xmouse+6,zap.ymouse+6,"clear",color)
gui.box(zap.xmouse-12,zap.ymouse-12,zap.xmouse+12,zap.ymouse+12,"clear",color)
gui.line(zap.xmouse-12,zap.ymouse-12,zap.xmouse+12,zap.ymouse+12,color)
gui.line(zap.xmouse+12,zap.ymouse-12,zap.xmouse-12,zap.ymouse+12,color)
gui.pixel(zap.xmouse,zap.ymouse,"red")
emu.frameadvance()
end