Exemplo n.º 1
0
 public void Cleanup()
 {
     m_coneRight = null;
     m_coneTop = null;
     m_coneLeft = null;
     m_coneDown = null;
 }
Exemplo n.º 2
0
 public Light(Vector2 position, float radius, Color4ub startColor, Color4ub endColor)
 {
     m_position = position;
     m_light = new Cone(
         position,
         radius,
         (float)Math.PI * 2f,
         startColor,
         endColor,
         0
         );
 }
Exemplo n.º 3
0
        public Shoot(Vector2 position, Vector2 direction, Color4ub startColor, Color4ub endColor, float angle = 2, float radius = 2)
        {
            m_location = new LocationComponent(this);
            m_location.SetPosition(position);

            m_cone = new Cone(
                position,
                radius,
                angle,
                startColor,
                endColor,
                (float)((Math.Atan2(direction.Y, direction.X) + Math.PI*2) - (angle / 2.0) - Math.PI*2)
                );

            m_lifeTimeTotal = 0.2;
            m_lifeTime = m_lifeTimeTotal;
        }
Exemplo n.º 4
0
        public void Init()
        {
            var angle = 1.0;
            m_coneRight = new Cone(
                new Vector2(0, 0),
                10,
                (float)angle,
                (float)((Math.Atan2(0, 1) + Math.PI * 2) - (angle / 2.0) - Math.PI * 2)
                );

            angle = 1.0;
            m_coneTop = new Cone(
                new Vector2(0, 0),
                10,
                (float)angle,
                (float)((Math.Atan2(1, 0) + Math.PI * 2) - (angle / 2.0) - Math.PI * 2)
                );

            angle = 1.0;
            m_coneLeft = new Cone(
                new Vector2(0, 0),
                10,
                (float)angle,
                (float)((Math.Atan2(0, -1) + Math.PI * 2) - (angle / 2.0) - Math.PI * 2)
                );

            angle = 1.0;
            m_coneDown = new Cone(
                new Vector2(0, 0),
                10,
                (float)angle,
                (float)((Math.Atan2(-1, 0) + Math.PI * 2) - (angle / 2.0) - Math.PI * 2)
                );
        }