Jump to content

Array of Positions/Areas


Recommended Posts

Posted

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.

 

unknown.png

 

Any help would be appreciated!

 

 

Posted (edited)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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