I have base class which containcontains a Vector2 velocity field, which I was initializing it in the constructor with Vector2.Zero. But that was mycaused an issue whichso I havehad to replace it with new Vector2(0, 0)
public abstract class BaseEntity { private Vector2 velocity; public BaseEntity() { // velocity = Vector2.Zero; // this is causes the issue velocity = new Vector2(0, 0); // this I am using now } } So theThe problem was that when I was adding other entities like Ship, Rock which extend the BaseEntity they were always moving in the same direction. So when I was moving the player, rocks and other entities which extend that BaseEntity class waswere following movement of my player.
I am not able to understand why is that, is; could someone smart in here explain to me why that issue occurred?