Closed grimatoma closed 1 month ago
The initial position is set as the vector2 of Position but Position is a pointer so it updates meaning the initial position is the current position of the ball
Vector2 is a struct, and as such is copied on assignment. So both of those lines will yield the same result:
Vector2
struct
_initialPos = Position; _initialPos = new Vector2(Position.X, Position.Y);
The initial position is set as the vector2 of Position but Position is a pointer so it updates meaning the initial position is the current position of the ball