Example #1
0
        //---------------------------- Properties ---------------------------------


        //---------------------------- Methods ---------------------------------
        public void StartGame(Game.Enemy enemy)
        {
            foreach (var c in TopGrid.Children)
            {
                (c as Image).Source = null;
            }
            foreach (var c in LeftGrid.Children)
            {
                (c as Image).Source = null;
            }
            foreach (var c in BottomGrid.Children)
            {
                (c as Image).Source = null;
            }
            foreach (var c in RightGrid.Children)
            {
                (c as Image).Source = null;
            }
            this.ScoreEnemy.Text = this.ScorePlayer.Text = "0";

            impaleLine = new Line()
            {
                Fill            = Brushes.Red,
                StrokeThickness = 5,
                Stroke          = Brushes.Red,
            };
            MeatCanvas.Children.Add(impaleLine);

            game.Start(enemy);
        }
Example #2
0
    // Start is called before the first frame update
    public override Game.GameObject save()
    {
        Game.GameObject gameObject = new Game.GameObject();

        gameObject.Components.Add(new Game.CircleCollider());
        gameObject.Components.Add(new Game.RigidBody());

        Game.Enemy enemyComp = new Game.Enemy();
        enemyComp.health             = health;
        enemyComp.walkSpeed          = walkSpeed;
        enemyComp.attackTimeInterval = attackTimeInterval;
        enemyComp.attackStyle        = attackStyle;

        if (weapon != null)
        {
            enemyComp.weaponPrefabGUID = weapon.prefabGuid;
        }
        gameObject.Components.Add(enemyComp);

        return(gameObject);
    }