Esempio n. 1
0
        private void LoadItem(RaceState racetrack, string assetName, int x, int y, int rotation)
        {
            Body    item        = new Body(Vector2.Zero, assetName);
            Vector2 centerPoint = new Vector2(item.Width * 0.5f, -item.Height * 0.5f); //weird Tiled bottom-left offset

            centerPoint   = Vector2.Transform(centerPoint, Matrix.CreateRotationZ(MathHelper.ToRadians(rotation)));
            item.Position = new Vector2(x, y) + centerPoint;
            item.Degrees  = rotation;

            racetrack.Add(item);
        }