Polished. Should be very shiny now. Look at the sparklies! Anyway, now it pops up some text letting you know what you did.

This commit is contained in:
fatratknight 2009-09-16 16:55:38 +00:00
parent 88b4c24baa
commit bfb67729ee
1 changed files with 27 additions and 33 deletions

View File

@ -1,6 +1,5 @@
-- Just something quick for Mike Tyson's Punch Out!! -- Just something quick for Mike Tyson's Punch Out!!
-- Intended to help time hits in real time. -- Intended to help time hits in real time.
-- Just quickly worked something up. Didn't bother with bells and whistles.
--FatRatKnight --FatRatKnight
@ -10,14 +9,14 @@ local BND= -8 -- KEEP NEGATIVE!! Frames after the golden zone.
local DISPx= 180 local DISPx= 180
local DISPy= 180 local DISPy= 180
local DISPx2= DISPx+11 -- Right side of box. Adjust that plus to your need
local timer= 0 local timer= 0
local EnemyHP local EnemyHP
local lastEHP local lastEHP
local LastHit=-50 local LastHit=-50
local poke local HitTiming= BND-1
local FreakingAwesome
--***************************************************************************** --*****************************************************************************
function Is_Hit() function Is_Hit()
@ -52,64 +51,59 @@ while true do
gui.text(144,22,EnemyHP) gui.text(144,22,EnemyHP)
if IsPress() then if IsPress() then
poke= true HitTiming= LastHit
LastHit= BND-1
timer= -18
end end
if Is_Hit() then if Is_Hit() then
LastHit= TMR LastHit= TMR
poke= false
end 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
if poke then
color= "red"
else
color= "green" color= "green"
elseif i == HitTiming and timer < 0 then
color= "red"
gui.text(100,80,"early " .. i)
end end
end gui.drawbox(DISPx, DISPy-3 - 4*i,DISPx2, DISPy-1 - 4*i,color)
gui.drawbox(DISPx, DISPy-3 - 4*i,DISPx+7, DISPy-1 - 4*i,color)
end end
if FreakingAwesome then if HitTiming == 0 and timer < 0 then
gui.text(128,50,"OK") gui.text(128,80,"OK")
gui.drawbox(128,80,144,90,"green")
local color= "white" local color= "white"
if (timer % 3) == 0 then if (timer % 3) == 0 then
color= "green" color= "green"
elseif (timer % 3) == 1 then elseif (timer % 3) == 1 then
color= "blue" color= "blue"
end end
gui.drawbox(DISPx , DISPy , DISPx+7, DISPy+2, color) gui.drawbox(DISPx , DISPy , DISPx2, DISPy+2, color)
gui.drawbox(DISPx-2, DISPy-2, DISPx+9, DISPy+4, color) gui.drawbox(DISPx-2, DISPy-2, DISPx2+2, DISPy+4, color)
else else
local color= "black" local color= "black"
if LastHit == 0 then if i == LastHit then
if poke then
color= "blue"
else
color= "green" color= "green"
end end
end gui.drawbox(DISPx , DISPy ,DISPx2, DISPy+2,color)
gui.drawbox(DISPx , DISPy ,DISPx+7, DISPy+2,color) gui.drawbox(DISPx-2, DISPy-2,DISPx2+2, DISPy+4,"white")
gui.drawbox(DISPx-2, DISPy-2,DISPx+9, DISPy+4,"white")
end end
for i= BND, -1 do for i= BND, -1 do
local color= "black" local color= "black"
if i == LastHit then if i == LastHit then
if poke then
color= "red"
else
color= "green" color= "green"
elseif i == HitTiming and timer < 0 then
color= "red"
gui.text(146,80,"late " .. -i)
end end
end gui.drawbox(DISPx, DISPy+3 - 4*i,DISPx2, DISPy+5 - 4*i,color)
gui.drawbox(DISPx, DISPy+3 - 4*i,DISPx+7, DISPy+5 - 4*i,color)
end end
if not poke then
LastHit= LastHit-1 LastHit= LastHit-1
end
FCEU.frameadvance() FCEU.frameadvance()
lastEHP= EnemyHP lastEHP= EnemyHP
timer= timer+1 timer= timer+1