Closed xurxodiz closed 12 years ago
As an example, for the blocks thing.
There are four possible heights at which to place things:
(we could technically place things on the hovering over the hovering, but let's stop here)
so instead of having createEnemy and createEnemyCoins and createEnemyBlocksEmpty and createEnemyBlocksEmptyCoin, blah...
createStuff([what, to, place, where] {
switch array.size:
case 4:
createHoverHover(array[3])
case 3:
createOnHover(array[2])
case 2:
createHove(array[1])
case 1:
createOnGround(array[0])
Look ma, no breaks!
This is done for the ones already existing. New ones will be created in this model.
A bit dumbly, for the sake of prettiness, genes call functions with no parameters, any of them.
Yeah that's not really scalable. Specially with the thousand different combinations of blocks and coins and enemies in each chunk.
So we're going to store in each gene, besides the function, the parameters it should use to call it.