Example #1
0
        public Player(Vector2 pos, int id = 0) : base(pos, "player")
        {
            PlayerId = id;

            //Sprite.scale = new Vector2(0.7f);

            Rotation = MathHelper.DegreesToRadians(-90);

            Rigidbody.SetBCircleRadius(28);
            Rigidbody.Type = (uint)ColliderType.Player;
            Rigidbody.SetCollisionMask((uint)ColliderType.Enemy | (uint)ColliderType.EnemyBullet);

            shootTime  = new Timer(0, 0.1f);
            bulletType = BulletType.Player;
            shootSpeed = 900;

            invTime = new Timer(0, invTimeMax);

            LifePoints = TotalLifePoints = 3;
            lifeHUD    = new GameObject(new Vector2(), "player_life_HUD", DrawMgr.Layer.GUI);
            lifeHUD.Create();

            effect       = new BlinkingEffect(this, invTimeMax, 12);
            damageSource = new AudioSource();
        }
 public EnemyAlert(Vector2 pos, string textureName) : base(pos, textureName, DrawMgr.Layer.GUI)
 {
     effect = new BlinkingEffect(this, 2, 4);
 }