Exemple #1
0
        public Laser(Game game)
            : base(game)
        {
            // Create a sprite component
            var sprite = new SpriteComponent(this);

            sprite.SetTexture(Game.Renderer.GetTexture("Assets/Laser.png"));

            // Create a move component, and set a forward speed
            var move = new MoveComponent(this)
            {
                ForwardSpeed = 800.0f,
            };

            // Create a circle component (for collision)
            _circle = new CircleComponent(this)
            {
                Radius = 11.0f,
            };
        }