I'm making a PICO-8 game where I have a reversed boss fight (you're the boss). One of the abilities for the boss is drawing a red rectangle over the entire screen and damaging every enemy NPC hero. Unfortunately, the rectangle won't show up.
Originally, I thought the rectangle was just drawing for too short a time frame, so I made it longer, but that didn't change anything. Making the number in the for loop too big just froze the screen temporarily.
Here's my code:
fire_wave_cooldown = 0
function fire_wave()
if time() - fire_wave_cooldown > 4 then
fire_wave_cooldown = time()
for i=1, 50 do
rectfill(0, 0, 128, 128, 8)
end
end
end
Thanks for any help!
You might be calling this before the
_draw()function—and if_draw()function contains a call tocls(), your rectangle is simply getting removed.