Jump to content

Array of Positions/Areas


Recommended Posts

Hi Guys,

I have a basic understanding of Arrays in a sense that I know it's a list of stuff.

I'm writing an agility script and I'm doing checks to see if Area contains my play in order to move on, but I wanted to try and create it as a list, in which it would need to verify based on like a queue or priority system to move forward to next area.




Any help would be appreciated!



Link to comment
Share on other sites

You could create a class to represent a "step" in the agility course. This class would include the Area that indicates which step it is, as well as a Position and String (action) describing how to complete this "step".

Then you can simply loop thru a list of 'steps', find whichever step you need to solve by checking if your player is in Area of that step, and dynamically solve it by getting the object at the specified position, and using the specified action on that object. If no steps are found for your position, you probably failed or completed your lap, so in that case make your way back to the start.

Edited by FrostBug
  • Heart 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...