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.
Develop games in your browser. Powerful, performant & highly capable.