Looping through list and this?

About Monkey 2 Forums Monkey 2 Programming Help Looping through list and this?

This topic contains 2 replies, has 2 voices, and was last updated by  Pakz 1 year, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11062

    Pakz
    Participant

    I have a list class with ai entities and I need for instance to check collision with one entity vs the other entities. The last time I tried that I used a variable that I set to true so that I would know to not check this entity vs the others.

    Is there a way to know when a entity in a list is in the current class method?

     

    I am kind of tired right now so I am not going to spend time now trying to figure this out now so I hope maybe someone will show a example on how to do this so I can read this when I wake up 🙂

    #11063

    Mark Sibly
    Keymaster

    ‘Self’ is a reference to the ‘current object’ inside methods and properties, much like ‘this’ in c++/java etc. Is this what you mean? You could use it like this:

    #11070

    Pakz
    Participant

    Yes, that would be what I am looking for. Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.