Array Help

0 favourites
  • 1 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi

    I am making a simple game in which a dragon moves to and perches on, random points along a cliff face and drops eggs. At regular intervals, the dragon will randomly pick another position from the array and move there. Trouble is, that sometimes it randomly selects the same point at which it just landed. This means it just flies a little circle around the same perch and lands again.

    Any ideas on how I can guarantee that the dragon will always pick a different perch?

    I have given the Dragon an instance variable of currentlandingpoint, and set it to record the UID of the last perch it landed on. I have then put in an event after the perch selection to compare the currentlandingpoint to the selected UID. Im not sure how to proceed from here. If it is the same perch I would like it just to move to the next UID in the array.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)