What do you want from me, it's a game jam. This is the code. It could probably be a lot more eficient than this, but I'm restricted for time here.
check out the itchy io page https://gokritz.itch.io/overlord
check out the nerdgrunds page https://www.newgrounds.com/portal/view/819102