gitdefence / game-off-2012

Build networks, destroy bugs
http://www.justinmcgirr.com/gitdefence/master/game/
5 stars 1 forks source link

Redo Allele Interface #84

Closed yeerkkiller1 closed 11 years ago

yeerkkiller1 commented 11 years ago

Allele interface will become like this:

An allele is made up of a group and a delta. Only one allele from each group may be present in a tower or bug or anything at one time. The delta is applied simply by: a) Adding the number of any property in the delta to the property of the same name in the object attrs b) Instantiating and then adding anything with a name of "attack" to the attack_types c) Setting the target strategy to anything with a name of "target".

When an allele is added any allele in the same group is removed, the attrs of the entity is reset by calling "setBaseAttrs" and then all the alleles are reapplied (right now in no particular order, but in the future they will be applied anything which added/subtracts, then multiplication/division, etc).

If applying a lot of alleles you can call startAlleleAdd before you add the alleles and then endAlleleAdd afterwards, causing the alleles to be applied only once (instead of applied and reapplied for every allele you add).

yeerkkiller1 commented 11 years ago

It seems like it is inefficient how we apply alleles, but unfortunately this has to be done or else we can't insure a consistent allele application order.

yeerkkiller1 commented 11 years ago

Should be done, may be bugs but not anything I can find right away.