Actions: 1 - Spawn new clones by clicking 2 - Remove clones by clicking 3 - Set/change attributes by clicking on clones Enemy Attributes: 1 - type (Changing this to blue, red, green, yellow, orange, or purple will change the enemy's color) 2 - x (Changing this will move the enemy) 3 - y (Changing this will move the enemy) 4 - direction (Changing this will change which way the enemy is facing) 5 - level (Changing this makes no visual change) 6 - hp (If an enemy's HP is 0 or lower it will automatically despawn) 7 - attack (Changing this makes no visual change) 8 - defense (Changing this makes no visual change)
With this demo, each enemy has 9 list items given to them. The first one is their ID, and this is what we look for when we try to change anything about the enemy. The ID of an enemy will never change, which means it will never lose the location of its data. The rest are the attributes they have. We know every single enemy's attributes are in the exact same order, so if we store the order of the attributes in a global list, we can use that to figure out where a specific attribute for an enemy is. For example, we know that the x position of an enemy is the 2nd list item after the list item that has their ID. The formula to find the value of an enemy's attribute is: "[item (item # of (ID) in enemy_data_list) + (item # of (attribute) in attribute_list)] of enemy_data_list]"