add Lua script that shows a target on screen for the zapper x,y
This commit is contained in:
parent
c87abe9503
commit
4f5e43f40c
output/Lua/NES
|
@ -0,0 +1,20 @@
|
|||
-- Draws a target on screen representing the x,y coordinates of the Zapper plugged into the 2nd port
|
||||
|
||||
while true do
|
||||
buttons = joypad.get();
|
||||
x = buttons["P2 Zapper X"];
|
||||
y = buttons["P2 Zapper Y"];
|
||||
fired = buttons["P2 Fire"];
|
||||
|
||||
color = "white";
|
||||
if fired then
|
||||
color = "red";
|
||||
end
|
||||
|
||||
gui.drawLine(x - 4, y + 4, x + 4, y - 4, color);
|
||||
gui.drawLine(x + 4, y + 4, x - 4, y - 4, color);
|
||||
gui.drawEllipse(x - 5, y - 5, 10, 10, color);
|
||||
gui.drawPixel(x, y, "red");
|
||||
gui.drawEllipse(x - 1, y - 1, 2, 2, "red");
|
||||
emu.frameadvance()
|
||||
end
|
Loading…
Reference in New Issue