From the Super Mario Wiki
Bomb Flies are Bob-omb-like insect enemies in the Gnat Attack minigame in Mario Paint. If a Bomb Fly is left alone for a little while, it explodes. They are some of the last enemies encountered before King Watinga, the final boss of the game. They reappear in Super Mario Maker as part of the Gnat Attack minigame. If a Bomb Fly explodes, one second from the 30-second timer is deducted.