I ran out of space in the title but, how do I have multiple instances of a single object successfully interact with each other?
I want to make a simple combat test. A single sprite object called player and they have instance variables: Dodge, strength, and health, and I want to be able to have it so that every second both objects are subtracting a random amount from the others health (because they are fighting). There are two instances of them on the screen, and they essentially target each other.
My problem is I don't know how to properly make the events for this because it is only one object. If I had two different objects then it would be easy, but I don't know how to use two separate instances of ONE object interact with each other as successfully as two different objects. Do you know what I mean? It's kind of hard for me to explain.
The method I'm thinking about is to have another instance variable called "target", and events depending on distance. So instance A gets close to instance B. Instance A's "target" variable gets the value of instance B's instance ID. And instance B gets instance A's. But I have no clue how the events would look like for this.
Please help! Thanks bye