The other day I open-sourced a little demo I worked on briefly. Take a look here:
https://github.com/Lochlan/pce-arpgDon't get too excited, there's not much to see! There's no collision detection, enemies, levels, or much of anything. Not even a readme! It's just the dude from Neutopia walking around, and you can use the I & II buttons to swing your sword. Try holding down the button and walking around for "swing" attacks!
I may revisit this code later, but I just wanted to put it out there for anybody to look at who's interested. I make no claims that any of this code is good, let alone production-ready.
Feel free to make a pull request if you want to hack on this a bit. Or just fork it and go crazy, consider this code public domain!
I hope somebody gets some use out of this, I'll post a README.md at some point so more people are more likely to stumble upon it.