This tutorial relies heavily on a video series made by GDQuest (Github Repository) a couple of years ago. Along with their videos, I’ve provided the code and lot of comments. I recommend following along with the first video on your own in order to get used to the game engine, and then just copying my code as needed.
UPDATE: At the end I have a very small but pretty functional base game that has a sword, enemy, enemy drops, pickups, health, locked doors, save games, and teleporting. It would make a great template for almost any real time RPG.