Adding entities to a “Parade”
|
A couple of weeks ago I started working on the parade mechanic within our game. Since we have decided to change the parade mechanic, but still do not know what we will change it into, I have since stopped working on it for the time being. However, I figured what I do have implemented with the mechanic would still be interesting to talk about. So first of all, the parade as of this moment consists of enemies you have killed, who follow you in a chain-like behaviour behind the player. As an enemy “dies” it loses all its features and starts following the last entity within the chain. So if the player has killed no enemies yet, it will start following the player, and then each enemy after that will follow the previously killed enemy. This is done through an invisible entity, who is offscreen of the playable game area, who adds all fallen enemies into an array and turns off all the enemies other scripts and gives them a follow script, where the object being followed will be the last enemy previously added to the array. This worked pretty well but the follow script itself at this point felt kind of stiff. All the entities within the chain moved with the same speed, so instead of having a chain like property, it felt more like the player had enemies superglues to its behind. In order to remedy this situation I decided upon only moving the enemies within the chain if they where a certain distance away from the object they where following. This change made sure that the entities would feel more like they where actively following whoever was infront of them.
Depending on whether we want to be able to remove enemies in the future within our parade is still uncertain, but since they are all stored within an array I do not think it would prove to be that hard to change remove parts of the chain and link it back so to speak. |
