I am dabbling with a zombie game, I have a hero on the left side of the screen. On the right side I have a single zombie that spawns and changes its x position from right to left so it looks like its walking over to the hero. Users can touch the zombie and the hero goes through a shoot animation and the zombie dies.
How would I handle multiple zombies spawning randomly and then having them transition to the hero.
Is there a way I can use a single event listener to handle all zombies individually?
Does lua have a special word like other languages that use the word “this” or “self” to refer to the object that was interacted with?