Hi everyone!
I'm trying to put together an open source 2D Action Platformer framework titled OpenWarriors inspired by the gameplay of the Musou/Warriors games - idea being it provides a basis for others to make their own characters/levels for the framework and have them be loaded in and used together within the compiled releases through resource packs, much like MUGEN.
As the Dynasty Warriors games feature a per-character level/XP system I'm looking to try to put something like that in OpenWarriors but I'm not sure where to start or if it'd even be possible - my current theory is something like this:
Have a global Array variable called CharacterXP, which itself hosts a set of Arrays with the following format:
[CharacterName:String,Level:Int,CurrentXP:Int,DamageBonus:float,DefenceBonus:float]
Whenever we need to get any of these values, we check CharacterXP for a value that contains the character's name and nab the appropriate value from there, creating a new entry in CharacterXP with appropriate starter values, e.g. ["character2",1,0,1.0,1.0] if it doesn't exist and returning the needed value if it does.
I understand there would be a lot involved in making this happen, there would need to be some way for each character to store which value in CharacterXP their stats are at to stop us having to do a costly search through the array every time we need their stats - I was just wondering if anyone knows if this would work or if there's any better way of doing something like this?