Well, at least that silly rectangle stops now. Unused code is in there, so experiment with stuff if anyone feels like it.
This commit is contained in:
parent
3e3c2af93a
commit
42a808b099
|
@ -11,14 +11,16 @@ local BND= -8 -- KEEP NEGATIVE!! Frames after the golden zone.
|
||||||
local DISPx= 200
|
local DISPx= 200
|
||||||
local DISPy= 180
|
local DISPy= 180
|
||||||
|
|
||||||
local timer= 0 -- Unused variable
|
local timer= 0
|
||||||
|
|
||||||
local EnemyHP
|
local EnemyHP
|
||||||
local lastEHP
|
local lastEHP
|
||||||
local LastHit=-50
|
local LastHit=-50
|
||||||
|
local poke
|
||||||
|
local FreakingAwesome
|
||||||
|
|
||||||
--*****************************************************************************
|
--*****************************************************************************
|
||||||
function IsHit()
|
function Is_Hit()
|
||||||
--*****************************************************************************
|
--*****************************************************************************
|
||||||
if EnemyHP ~= lastEHP then
|
if EnemyHP ~= lastEHP then
|
||||||
return true
|
return true
|
||||||
|
@ -27,14 +29,16 @@ function IsHit()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local LastButtons= {}
|
||||||
|
local Buttons= {}
|
||||||
--*****************************************************************************
|
--*****************************************************************************
|
||||||
function IsPress()
|
function IsPress()
|
||||||
--*****************************************************************************
|
--*****************************************************************************
|
||||||
-- Unused function
|
LastButtons["A"]= Buttons["A"]
|
||||||
|
LastButtons["B"]= Buttons["B"]
|
||||||
|
|
||||||
local buttons= {}
|
Buttons= joypad.get(1)
|
||||||
buttons= joypad.get()
|
if (Buttons["A"] and not LastButtons["A"]) or (Buttons["B"] and not LastButtons["B"]) then
|
||||||
if buttons["A"] or buttons["B"] then
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
@ -45,39 +49,68 @@ end
|
||||||
while true do
|
while true do
|
||||||
--*****************************************************************************
|
--*****************************************************************************
|
||||||
EnemyHP= memory.readbyte(EHP)
|
EnemyHP= memory.readbyte(EHP)
|
||||||
local tap
|
|
||||||
gui.text(144,22,EnemyHP)
|
gui.text(144,22,EnemyHP)
|
||||||
|
|
||||||
if IsHit() then
|
if IsPress() then
|
||||||
LastHit= TMR
|
poke= true
|
||||||
-- Hrm... Not a lot I can think of...
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Is_Hit() then
|
||||||
|
LastHit= TMR
|
||||||
|
poke= false
|
||||||
|
end
|
||||||
|
|
||||||
for i= 1, TMR do
|
for i= 1, TMR do
|
||||||
local color= "black"
|
local color= "black"
|
||||||
if i == LastHit then
|
if i == LastHit then
|
||||||
color= "green"
|
if poke then
|
||||||
|
color= "red"
|
||||||
|
else
|
||||||
|
color= "green"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
gui.drawbox(DISPx, DISPy-3 - 4*i,DISPx+7, DISPy-1 - 4*i,color)
|
gui.drawbox(DISPx, DISPy-3 - 4*i,DISPx+7, DISPy-1 - 4*i,color)
|
||||||
end
|
end
|
||||||
|
|
||||||
local color= "black"
|
if FreakingAwesome then
|
||||||
if LastHit == 0 then
|
gui.text(128,50,"OK")
|
||||||
color= "green"
|
local color= "white"
|
||||||
|
if (timer % 3) == 0 then
|
||||||
|
color= "green"
|
||||||
|
elseif (timer % 3) == 1 then
|
||||||
|
color= "blue"
|
||||||
|
end
|
||||||
|
gui.drawbox(DISPx , DISPy , DISPx+7, DISPy+2, color)
|
||||||
|
gui.drawbox(DISPx-2, DISPy-2, DISPx+9, DISPy+4, color)
|
||||||
|
else
|
||||||
|
local color= "black"
|
||||||
|
if LastHit == 0 then
|
||||||
|
if poke then
|
||||||
|
color= "blue"
|
||||||
|
else
|
||||||
|
color= "green"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
gui.drawbox(DISPx , DISPy ,DISPx+7, DISPy+2,color)
|
||||||
|
gui.drawbox(DISPx-2, DISPy-2,DISPx+9, DISPy+4,"white")
|
||||||
end
|
end
|
||||||
gui.drawbox(DISPx , DISPy ,DISPx+7, DISPy+2,color)
|
|
||||||
gui.drawbox(DISPx-2, DISPy-2,DISPx+9, DISPy+4,"white")
|
|
||||||
|
|
||||||
for i= BND, -1 do
|
for i= BND, -1 do
|
||||||
local color= "black"
|
local color= "black"
|
||||||
if i == LastHit then
|
if i == LastHit then
|
||||||
color= "green"
|
if poke then
|
||||||
|
color= "red"
|
||||||
|
else
|
||||||
|
color= "green"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
gui.drawbox(DISPx, DISPy+3 - 4*i,DISPx+7, DISPy+5 - 4*i,color)
|
gui.drawbox(DISPx, DISPy+3 - 4*i,DISPx+7, DISPy+5 - 4*i,color)
|
||||||
end
|
end
|
||||||
|
|
||||||
LastHit= LastHit-1
|
if not poke then
|
||||||
|
LastHit= LastHit-1
|
||||||
|
end
|
||||||
FCEU.frameadvance()
|
FCEU.frameadvance()
|
||||||
lastEHP= EnemyHP
|
lastEHP= EnemyHP
|
||||||
|
timer= timer+1
|
||||||
end
|
end
|
Loading…
Reference in New Issue