Closed hevesg closed 10 years ago
Agree. Shall we go with Angular then? However we should also use extra scripts (ex the one above). And also:
(Sorry for keep on closing and opening the conversation Github is a brand new game for me)
At this point I don't have time to learn a new framework. ;) I working on the Paranoia one I use jQuery and bootstraps. It would be great if you guys can pick one like Warhammer Fantasy or 40K and there you could show me this AngularJS stuff there. I want to create the paranoia one as basic demo, to demonstrate the Required Functionality. To set up a standard in functionality (not the tech). I don't mind to rewrite this later. I try to use minimal file number while keeping it sane.
We can work out a common library in the mean time.
Library: Class: Storage Functions: Load, Save, New, Delete
Class: Dice Functions: RandomRoll(diceType) RandomRolls(array diceTypes)
Class: Sheet Build, Update
I looked into storing data in XML. Like Attribute names and Skill names, equipment, but it will not work from filesystem. Because permission problems (Not the values but the fields itself to build the character sheet)
AngularJS looks good, I will catch up on it in the mean time. :)
I have created a new file Paranoia2ndv2.html as a placeholder for the angularJS version. Please, add any angularJS stuff here, not the first version.
Dice question: Which shall it be?
We should break it two levels
1.) Handles 1 dice roll Dice.roll(['1d20'])
2.) Handles combination of dices an integers. (calls Dice.roll ) Dice.sumRolls(['1d20','+1','3d6','-2'])
The last one seems a bit tricky. Let me think...
I think the first one is tricky. ;)
The second one is only simple sum function Dice.sumRolls(new_rolls){ result = 0; new_rolls.forEach (function(one_roll){ result = result + Dice.roll(one_roll); }); return result }
Dice.roll() should handle integers '-1' or dice rolls "d6" or multiple dice rolls "2d10" 1 a) Dice.roll('-1'); returns: -1
1b) Dice.roll('d6'); returns: 1 to 6
1c) Dice.roll('2d10'); returns 2 to 20 [possible to call recursively itself Dice.roll('d10')+Dice.roll('d10') ]
1C is may not needed at all as we can do: Dice.sumRolls(['d10','d10']);
Tricky I mean that it might be a better solution just to use one function as this: Dice.roll('d20+2+3d5-1') What do you think?
If one call is easier for you that is fine.
I would make the following: Dice.roll('d10'); Dice.roll('1'); Dice.roll('-2'); and Dice.sumRolls(array dices);
But I like to break it down to small chunks ;)
let's move this conversation over to an issue: https://github.com/kory75/CharacterSheetGenerator/issues/7 :v:
Please check. Character Class with basic methods (base)