Scarecrow's Dangerous Job by gubidubi 2023-01-16T01:51:37Z
@willoxs Thanks a lot for the feedback :) In fact, unfortunately there are many things that did not have time to finish. I would have liked to make the crow's AI more visually noticeable, but it works like this: There are the following states: Fly, FlyToDive, Dive, Flee and FlyAway. Initially the crow searches through all the plants, chooses one at random. If it doesn't find any, it goes to the "FlyAway" state, where, every 2 seconds, it checks a few more times that there are no more plants while flying with an opposing force to the player, until the object is destroyed. If there is a plant, it randomly chooses one of the sides and then it will start pushing towards the first approach point which is a little more distant and above the point where the bird will perform the dive. When it gets close enough, it slows down a bit to make a smooth turn and goes into the "FlyToDive" state. In this state, every frame, it pushes to the Dive point. Getting close enough, set a velocity down and a force up, making a parabola. During that time, it will deal damage to the plants it hits, and at the end, it will look for a new plant and random side and return to the Fly state. There is a fear ray in which, if the player gets inside it, the bird will switch to the "Flee" state immediately, running away from the player (who is a scarecrow) for a few seconds. Thus, the player can quickly prevent a plant from being eaten by approaching it during a dive. Then it would fetch another plant and reset the state machine. Our idea would be to visually illustrate each state, but we ran out of time.