public Player(fk_Vector position) : base(CharacterSide.Player, LifeMax, position, 100)
        {
            Model = new fk_Model()
            {
                Shape    = new fk_Block(4, 4, 4),
                Material = new fk_Material()
                {
                    Ambient   = new fk_Color(0, 0, 0),
                    Alpha     = 0.7f,
                    Diffuse   = new fk_Color(0.8, 0.6, 0),
                    Emission  = new fk_Color(0, 0, 0),
                    Shininess = 0,
                    Specular  = new fk_Color(0, 0, 0)
                },
                BMode = fk_BoundaryMode.CAPSULE,
                //BDraw = true,
                BLineColor = fk_Material.Blue.Diffuse
            };
            Model.GlUpvec(new fk_Vector(1, 1, 0));
            Model.SetCapsule(new fk_Vector(0, 0, 0), new fk_Vector(0, 0, 0.01), 2);

            GameInfo.GetInstance().AddPlayerSide(this);
            GameInfo.GetInstance().ControllableCharacter = this;

            _shootLine = new fk_Model()
            {
                Shape    = new fk_Block(0.2, 0.2, ShootLineLength),
                Material = fk_Material.Pink,
            };
            _shootLine.Material.Alpha = 0.5f;

            _isImmotal = false;
        }
        public EnemySphere(fk_Vector position) : base(CharacterSide.Enemy, LifeMax, position)
        {
            Model = new fk_Model()
            {
                Shape      = new fk_Sphere(4, 2.0),
                Material   = fk_Material.Cyan,
                BMode      = fk_BoundaryMode.CAPSULE,
                BDraw      = false,
                BLineColor = fk_Material.Red.Diffuse
            };
            Model.SetCapsule(new fk_Vector(0, 0, 0), new fk_Vector(0, 0, 0.01), 3.5);

            GameInfo.GetInstance().AddEnemySide(this);
        }
        public BossChild(fk_Vector position, Boss parent, fk_Vector relativePosition) : base(CharacterSide.Enemy,
                                                                                             LifeMax, position)
        {
            _parent           = parent;
            _relativePosition = relativePosition;

            Model = new fk_Model()
            {
                Shape      = new fk_Cone(4, 2.0, 4),
                Material   = fk_Material.BambooGreen,
                BMode      = fk_BoundaryMode.CAPSULE,
                BDraw      = false,
                BLineColor = fk_Material.Red.Diffuse
            };
            Model.SetCapsule(new fk_Vector(0, 0, 0), new fk_Vector(0, 0, 0.01), 3);

            GameInfo.GetInstance().AddEnemySide(this);
        }
        protected override void UniqueMove()
        {
            Position.z += MoveSpeed;
            if (Position.z > 20)
            {
                Escape();
            }

            if (AriveFrames != 0 && AriveFrames % 95 == 0)
            {
                var targetPosition = GameInfo.GetInstance().ControllableCharacter.Position;
                var chaseVector    = targetPosition - Position;
                chaseVector.Normalize();

                var normalBullet =
                    new NormalBullet(CharacterSide.Enemy, new fk_Vector(Position), chaseVector,
                                     fk_Material.Orange);
            }
        }
        protected BulletBase(CharacterSide side, int lifeMax, fk_Vector position, fk_Vector velocity) : base(side, lifeMax, position)
        {
            Velocity = velocity;

            switch (side)
            {
            case CharacterSide.Player:
                GameInfo.GetInstance().AddPlayerSide(this);
                break;

            case CharacterSide.Enemy:
                GameInfo.GetInstance().AddEnemySide(this);
                break;

            case CharacterSide.Other:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(side), side, null);
            }
        }
Exemple #6
0
        public Boss(fk_Vector position) : base(CharacterSide.Enemy, LifeMax, position)
        {
            _moveRange = GameInfo.MoveRange - 5;

            _childList = new BossChild[ChildrenCount];

            Model = new fk_Model()
            {
                Shape      = new fk_Block(4, 4, 4),
                Material   = fk_Material.Cyan,
                BMode      = fk_BoundaryMode.CAPSULE,
                BDraw      = false,
                BLineColor = fk_Material.Red.Diffuse
            };
            Model.SetCapsule(new fk_Vector(0, 0, 0), new fk_Vector(0, 0, 0.01), 2);

            GameInfo.GetInstance().AddEnemySide(this);

            SetRandomVelocity();

            GenerateNewChild(position);

            _restReviveCount = -1;
        }
 protected override void DeadProcess()
 {
     MainFrame.Instance.NowScene.MainScene.RemoveModel(_shootLine);
     GameInfo.GetInstance().GameOver();
 }
Exemple #8
0
 protected override void DeadProcess()
 {
     GameInfo.GetInstance().GameClear();
 }
Exemple #9
0
 public void DrawUpdate()
 {
     _lifeSprite.DrawText(GameInfo.GetInstance().ControllableCharacter.Life.ToString(), true);
 }