Well I actually have a similar giant 3d jumble of rules in a couple of different actors. The one in the screenshot is that actor on the level select screen. I'm making 30 levels, so it says:
if level is 1: - switch scene to level 1 else: - if level is 2: - - switch scene to level 2: - else: - - if level is 3: ...
It has to be nested 30 times. I could do it without the else's and just have 30 rules in a row, and it probably wouldn't make a noticable difference, but technically it's more efficient to do it the way I'm doing it. Rather than running 30 rules, it only runs as many rules as it needs to until it gets to the right level.
But I also have a giant jumble of rules like that when you walk through the door (if level is 1, change scene to level 2, etc.).
Comments
if level is 1:
- switch scene to level 1
else:
- if level is 2:
- - switch scene to level 2:
- else:
- - if level is 3:
...
It has to be nested 30 times. I could do it without the else's and just have 30 rules in a row, and it probably wouldn't make a noticable difference, but technically it's more efficient to do it the way I'm doing it. Rather than running 30 rules, it only runs as many rules as it needs to until it gets to the right level.
But I also have a giant jumble of rules like that when you walk through the door (if level is 1, change scene to level 2, etc.).
`Switch! Case! Switch! Case! Switch Case!`