A StayInPlaceBehavior would constantly toggle directions to stay in place (well, switch between two neighboring grid cell). It would have the benefit that it would not run into walls (unlike the DoNothingBehavior) but does still require almost no context (except the last direction we moved in). This means that the entity class needs to be changed to contain the entity direction on top of the position.
A StayInPlaceBehavior would constantly toggle directions to stay in place (well, switch between two neighboring grid cell). It would have the benefit that it would not run into walls (unlike the DoNothingBehavior) but does still require almost no context (except the last direction we moved in). This means that the entity class needs to be changed to contain the entity direction on top of the position.