I'm pleased with how this is turning out. I haven't worked out a way to battle these enemies yet, but the logic behind using variables to create more complex programs is starting to make more sense to me. Originally I had only planned to have two enemies to demo this program, and they would not change; this function adds a good deal of random chance to the game, with relatively simple code. when I seek to improve on it, I may add enemy HP variables, values that change depending on which enemy spawns. I might also add a boss spawn mechanic, which could simply be an additional random value in the code used to determine the first enemy's sprite.

An example in which only one enemy has spawned. Note that Randommobspawn 1 and 2 are both < 1. These variables are related, and a third enemy will only spawn if a second spawns- a second will spawn only if a random variable between -10 and 10 is greater than 0.

No comments:
Post a Comment