Here's my battle engine, a bit simplified, along with some instruction on how to remix this and make it your own. Arrows to move. Z to attack.
Sprites are from Super Mario Bros and Undertale, properties of Nintendo and Toby Fox, respectively. Music: Tʜᴇ Zᴇʀᴏ - Contra Void -ᴀᴍᴇʟɪᴏʀᴀᴛɪᴏɴ- Phase 2 - Desolo Zantas Sounds from Undertale.