public static int VerticalCollisionIndex(MovingObject moving, List<GameObject> objects) { List<MatrixCoords> profile = moving.GetCollisionProfile(); List<MatrixCoords> verticalProfile = new List<MatrixCoords>(); foreach (var coord in profile) { verticalProfile.Add(new MatrixCoords(coord.Row + moving.Speed.Row, coord.Col)); } int collisionIndex = GetCollisionIndex(moving, objects, verticalProfile); return collisionIndex; }
public static int VerticalCollisionIndex(MovingObject moving, List <GameObject> objects) { List <MatrixCoords> profile = moving.GetCollisionProfile(); List <MatrixCoords> verticalProfile = new List <MatrixCoords>(); foreach (var coord in profile) { verticalProfile.Add(new MatrixCoords(coord.Row + moving.Speed.Row, coord.Col)); } int collisionIndex = GetCollisionIndex(moving, objects, verticalProfile); return(collisionIndex); }