Hello fellow Pulp enthusiasts!
My son has started learning to code at school, so I thought it would be fun to introduce him to Pulp. He’s been having a blast creating several sprites and his little world. He’s even doing small scripts! While helping him on different coding aspects, I have been having fun testing things out and I’m really into it as well!
I’m also playing through the Dragon Quest 1+2 remake right now, and with that game fresh in my mind, I wanted to see if I could implement a JRPG like turn-based battle system in Pulp. I’m certainly not the first to do this. But it was a fun learning exercise to build my own.
I’m sharing the project here so that others can learn from it or use it in their own game.
Pulp file:
JRPG Battle System.json.zip (7.5 KB)
PDX:
JRPG-Battle-System.pdx.zip (51.7 KB)
Some notes:
The battle system is menu based, leveraging the Pulp menu and say functions.
Some tiles are “wild” and have a chance of triggering a battle. Each wild tile has some logic to determine the type of enemy that can be encountered.
When a battle occurs, the player is moved to the battle room, and different sprites are displayed for the enemy and player. The actual player tile is hidden in battle. The player sprite is static in the room, but the enemy sprites are displayed dynamically over several tiles based on its enemySizeX and enemySizeY variables.
I used some item tiles has logic containers. These include:
-
battleSystem: all the logic to handle battles -
enemyDefinitions: functions to initialize the variables for each enemy type. There are 3 currently: Slime, Big Slime and Goblin
The player script has a series of functions to adjust health, XP and coins. I wanted to centralize the logic there so that it will be easier to change it (i.e. checking for level up after the player gains XP)
What’s missing:
I have a good portion of what I want implemented. But here are some of the things I would like to add eventually.
-
Allow sprite animation in combat: this is tricky since the menu and say functions will pause tile animation. So an idle animation will not work with the menu open. However, an attack animation should be possible by using the
waitfunction before showing the say message. -
Create a logic container for the spells, so that the code can be reused. Right now, the code for the Heal spell is duplicated in the
playerandbattleSystemscripts. -
Add sound effects to battle actions and spells.
-
Have more than one enemy in a battle, and more than one character (party system).
-
I have some basic stats implemented, but some additional ones, a level up system and an inventory system would help in creating a better RPG experience.
I hope this can be helpful to someone. Let me know if you use it. I’m curious to see what others build with it.

