# How to make a battle difference and level up system?

hello everyone, this time I need help with something more complex. I’m developing a 2D game with mechanics inspired by Castlevania Symphony of the night, I think the metroidvania concept is beautiful, but I’m literally stuck in the game system.
I wanted to make the basics the basics, the enemy has “X” points for defense and I “X” for attack, so I would like to make a difference to do the damage, but I don’t know how to add this difference to generate damage. (I’m a little slow with python but I have a notion).
And finally, I also wanted to put a system of “level Up”, another thing that I also do not know how to deal with. I am almost sure that it is not so complex, but I have difficulty assembling XD scripts, could someone help me get a sense?

What’s so complicated? Reduce the attack score based on defense. Could be as plain as

`dmg = att/max(def, 1)` or `dmg = att * (1 - (min(def, 75)/100))`

First one is dull as def can just go up infinitely and reduce damage to ridiculous values but can do just fine if you don’t want to think too hard. Second one is percentual and caps at 75% damage reduction.