Пример #1
0
 public Wheel(Vehicle vehicle, Vector2 offset, Color color, float scale)
 {
     Texture  = Game1.instance.Content.Load<Texture2D>("Car_wheel");
     _vehicle = vehicle;
     Offset   = offset * _vehicle.Scale;
     Position = new Vector2(_vehicle.Position.X + Offset.X, _vehicle.Position.Y + Offset.Y);
     Color    = color;
     Scale    = scale;
 }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="option">The option indicates which vehicle has been chosen</param>
        public World(int option)
        {
            switch (option)
            {
                case 1:
                    _vehicle = new Car(new Vector2(0, 172), 0.3f, Color.PaleGreen);
                    break;
                case 2:
                    _vehicle  = new Truck(new Vector2(0, 130), 0.13f, Color.Red);
                    break;
            }

            _counter    = new Counter();
            _rock       = new Rock(new Vector2(626, 178));
            _background = Game1.instance.Content.Load<Texture2D>("cliff");
            _spVerdana  = Game1.instance.Content.Load<SpriteFont>("Verdana");
        }