Ejemplo n.º 1
0
        public void AddMember(IAI ai)
        {
            Debug.Assert(!m_members.Contains(ai));

            m_members.Add(ai);
            ai.Worker.Destructed += OnDestructed;
        }
Ejemplo n.º 2
0
        private void btnNewGame_Click(object sender, EventArgs e)
        {
            using (var newGameForm = new NewGame()) {
                newGameForm.Player1AI = _newGamePlayer1AIStatus;
                newGameForm.Player2AI = _newGamePlayer2AIStatus;

                if (newGameForm.ShowDialog() == DialogResult.OK) {

                    _newGamePlayer1AIStatus = newGameForm.Player1AI;
                    _newGamePlayer2AIStatus = newGameForm.Player2AI;

                    Player player1 = new Player("Player 1",
                        Player.Player1TokenColour,
                        Player.Player1HighlightColour,
                        newGameForm.Player1AI);
                    Player player2 = new Player("Player 2",
                        Player.Player2TokenColour,
                        Player.Player2HighlightColour,
                        newGameForm.Player2AI);

                    _gameController = new GameController(this, dropBoard, player1, player2);
                    dropBoard.InitializeGameState(_gameController);
                }
            }
        }
Ejemplo n.º 3
0
 public void SetTankAI(IAI tankAI)
 {
     if (tankAI == null)
     {
         throw new NullReferenceException("tankAI is null!");
     }
     this.tankAI = tankAI;
 }
Ejemplo n.º 4
0
 public MainWindow()
 {
     InitializeComponent();
     this.game        = new Game();
     this.DataContext = game;
     AI = new AIMinMax();
     InitBoardUI();
 }
Ejemplo n.º 5
0
 public PlayerController(IPlayerReposytory playerRepository, IGameBoard board, IAI aimimax)
 {
     _playerRepository = playerRepository ?? throw new ArgumentNullException(nameof(playerRepository));
     _board            = board ?? throw new ArgumentNullException(nameof(board));
     _aimimax          = aimimax ?? throw new ArgumentNullException(nameof(aimimax));
     _playerX          = _playerRepository.LoadDefaultPlayerList()[0];
     _playerO          = _playerRepository.LoadDefaultPlayerList()[1];
 }
Ejemplo n.º 6
0
 public void StartBehavior(IAI self, CombatState target)
 {
     _target           = target;
     _self             = self;
     _combat           = _self.Combat;
     _lastKnownPostion = _target.transform.position;
     _self.SetAtomicAction(ActionType.AIRotate, _self, _target.transform.position, GameManager.FixedGameTime);
 }
Ejemplo n.º 7
0
 public EnemyState(IAI AI, Enemy enemy) : base(enemy)
 {
     isClimbing = false;
     ai         = AI;
     health     = Stat.Health(400);
     speed      = Stat.Speed(85);
     damage     = Stat.Damage(50);
 }
Ejemplo n.º 8
0
 public Tester(string name, IAI ai)
 {
     this.name = name;
     this.ai   = ai;
     scores    = new List <int>();
     rankings  = new List <int>();
     players   = new List <IPlayer>();
 }
Ejemplo n.º 9
0
        private void InitialAI(IAI tankAI)
        {
            commonServer = new AICommonServer(mapSize);
            tank.SetTankAI(tankAI);
            tankAI.OrderServer  = tank;
            tankAI.CommonServer = commonServer;

            GameManager.ObjMemoryMgr.AddSingle(tank);
        }
Ejemplo n.º 10
0
	public void stuff2(IAI other)
	{
		int x = 7;
		other.val = x;
		val = x;
		x = other.val;
		x = val;
		val = other.val;
	}
Ejemplo n.º 11
0
        public Enemy(Spritemap spritemap, IAI ai, float x, float y)
            : base(x, y)
        {
            this.spritemap = spritemap;
            this.ai        = ai;
            this.AddComponent <Image>(this.spritemap);

            this.touchDamage = 15;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Provides the extra text for the <see cref="AdvancedPropertyDescriptor"/> for a
        /// <see cref="IAI"/>.
        /// </summary>
        /// <param name="v">The value.</param>
        /// <returns>The extra text to display.</returns>
        static string ExtraTextProvider_IAI(IAI v)
        {
            if (v == null)
            {
                return(null);
            }

            return(AIFactory.Instance.GetAIName(v.ID));
        }
Ejemplo n.º 13
0
        public IAI GetAIInterfacObject()
        {
            IAI result = null;

            if (this.loaded)
            {
                result = this.loadedObject as IAI;
            }
            return(result);
        }
Ejemplo n.º 14
0
    public void stuff2(IAI other)
    {
        int x = 7;

        other.val = x;
        val       = x;
        x         = other.val;
        x         = val;
        val       = other.val;
    }
Ejemplo n.º 15
0
 public AIPlayer(IAI AI, Level level, Point location, int score = 0) : base(level, location, score)
 {
     this.AI = AI;
     AI.GameStart(this, 3);
     startNextActionThreadAsync();
     OnPlayerAction += delegate(PlayerGameObject obj)
     {
         startNextActionThreadAsync();
     };
 }
Ejemplo n.º 16
0
    public static void SimulateAction(IAI _ai, Vector3 _target, float _startTime)
    {
        Vector3 _tempTarget = new Vector3(_target.x, _ai.transform.position.y, _target.z);
        Vector3 _up         = _ai.transform.up;
        Vector3 _dir        = _tempTarget - _ai.transform.position;
        float   _angle      = Util.AngleBetweenVector3(_ai.transform.forward, _dir, _up);

        _ai.SetAction(new ValueTargetAction(ActionType.AIRotate, _angle, _target, _startTime));
        float _endTime = Math.Abs(_angle) / _ai.RotationSpeed + _startTime;

        _ai.SetAction(new ValueTargetAction(ActionType.AIRotateUnset, _angle, _target, _endTime));
    }
Ejemplo n.º 17
0
        public Enemy(Vector2 position, string enemyState)
        {
            Position       = position;
            FuturePosition = position;  // make the unit not move when spawned.
            Velocity       = new Vector2(1f, 1f);

            EnemyAI = new AI(this, "Enemy");

            if (enemyState == "Bandit")
            {
                EnemyState = new Bandit(this);
            }
        }
Ejemplo n.º 18
0
 public void SetAtomicAction(ActionType _type, IAI _ai, Vector3 _target, float _time)
 {
     _history.SpliceOffPossibleFuture();
     if (_currentAction != null)
     {
         SetAction(_currentAction.Unset());
     }
     switch (_type)
     {
     case ActionType.AIRotate:
         AARotate.SimulateAction(_ai, _target, _time);
         break;
     }
 }
Ejemplo n.º 19
0
        private void AIInitial(IAI tankAI1, IAI tankAI2)
        {
            commonServer = new AICommonServer(mapRect);

            tankAI1.CommonServer = commonServer;
            tankAI1.OrderServer  = tank1;
            tank1.SetTankAI(tankAI1);

            tankAI2.CommonServer = commonServer;
            tankAI2.OrderServer  = tank2;
            tank2.SetTankAI(tankAI2);

            //GameManager.ObjMemoryMgr.AddSingle( tank1 );
            //GameManager.ObjMemoryMgr.AddSingle( tank2 );
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Attempts to set the Character's AI.
        /// </summary>
        /// <param name="aiName">The name of the new AI to use.</param>
        /// <returns>
        /// True if the AI was successfully set; otherwise false.
        /// </returns>
        public override bool SetAI(string aiName)
        {
            var newAI = _aiFactory.Create(aiName, this);

            if (newAI == null)
            {
                _ai = null;
                return(false);
            }

            Debug.Assert(newAI.Actor == this);
            _ai = newAI;

            return(true);
        }
Ejemplo n.º 21
0
 private void UpdatePlayerComboValues(IAI playerAI, ComboBox playerCombo, ComboBox aiDifficultyCombo)
 {
     _updateingPlayerAI = true;
     if (playerAI == null)
     {
         playerCombo.Text          = PlayerOptions.Human.ToString();
         aiDifficultyCombo.Visible = false;
     }
     else
     {
         playerCombo.Text          = PlayerOptions.AI.ToString();
         aiDifficultyCombo.Text    = playerAI.Difficulty.ToString();
         aiDifficultyCombo.Visible = true;
     }
     _updateingPlayerAI = false;
 }
Ejemplo n.º 22
0
        private void InitialDrawMgr(IAI tankAI1, IAI tankAI2)
        {
            if (tankAI1 is ManualControl)
            {
                DrawMgr.SetCondition(
                    delegate(IDrawableObj obj)
                {
                    if (tank1.IsDead)
                    {
                        return(true);
                    }

                    if (tank1.Rader.PointInRader(obj.Pos) || obj == tank1 ||
                        ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank1))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });
            }
            if (tankAI2 is ManualControl)
            {
                DrawMgr.SetCondition(
                    delegate(IDrawableObj obj)
                {
                    if (tank2.IsDead)
                    {
                        return(true);
                    }

                    if (tank2.Rader.PointInRader(obj.Pos) || obj == tank2 ||
                        ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank2))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });
            }
        }
Ejemplo n.º 23
0
        private void PlayerOrAIOptionChanged(ref IAI playerAI, ComboBox playerCombo, ComboBox aiDifficultyCombo)
        {
            if (_updateingPlayerAI) {
                return;
            }

            if (playerCombo.Text == PlayerOptions.Human.ToString()) {
                playerAI = null;
                aiDifficultyCombo.Visible = false;

            } else if (playerCombo.Text == PlayerOptions.AI.ToString()) {
                AI.AIDifficulty diff = FourRow.AI.AIDifficulty.Medium;
                if (!string.IsNullOrEmpty(aiDifficultyCombo.Text)) {
                    diff = (AI.AIDifficulty)Enum.Parse(typeof(AI.AIDifficulty), aiDifficultyCombo.Text);
                }
                playerAI = new AI.AIBase(diff);
                cmbPlayer2AIDifficulty.Visible = true;
            }
        }
Ejemplo n.º 24
0
        public BoardPanel()
            : base()
        {
            //this.DoubleBuffered = true;
            this.ResizeRedraw = true;
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.Opaque | ControlStyles.AllPaintingInWmPaint, true);

            //Initialize board
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    Board[i, j]        = new Square();
                    Board[i, j].Colour = CheckerColour.Empty;
                }
            }

            //Setup Pieces
            for (int i = 0; i < 8; i += 1)
            {
                int offset = 0;
                if (i % 2 != 0)
                {
                    offset++;
                }
                for (int j = offset; j < 8; j += 2)
                {
                    if (i < 3)
                    {
                        Board[i, j].Colour = CheckerColour.Red;
                    }
                    if (i > 4)
                    {
                        Board[i, j].Colour = CheckerColour.Black;
                    }
                }
            }

            AI        = new AI_Tree();
            AI.Colour = CheckerColour.Black;

            AdvanceTurn();
        }
Ejemplo n.º 25
0
        static async Task Main(string[] args)
        {
            // in a .net program, paths will be relative to the location of the application dll (probably down in bin/Debug/(etc)).
            string filePath    = "../../../data.json"; // should be next to this file.
            var    persistence = new JsonFilePersistence(filePath);

            Console.WriteLine("Let's Play Rock Paper Scissors!");
            // Creates new instances of game and score
            var          playerGame      = new RPSgame();
            Task <Score> playerScoreTask = persistence.ReadAsync();

            List <IAI> ais    = GetAllAIs();
            var        random = new Random();

            // Sets initial last user choice to null so AI knows not to consider
            string lastPlay = null;

            //Gather's user's initial choiuce
            Console.WriteLine("Choose rock (r), paper (p), or scissors(s). Enter x to quit.");
            string playerChoice = Console.ReadLine();

            var playerScore = await playerScoreTask;

            playerScore.WinHappened += () => { Console.WriteLine("(win via event)"); };
            // Loops through game until player chooses to quit.
            while (playerChoice != "x")
            {
                // randomly choose an AI to respond with
                IAI whichAi = ais[random.Next(ais.Count)];
                // Sends info to AI to choose play
                string comChoice = whichAi.ChooseRPS(lastPlay);
                // Sends player and AI choice to RPSgame to resolve win/loss
                playerGame.Play(playerChoice, comChoice, playerScore);
                // Updates last play for AI decision making
                lastPlay = playerChoice;
                // Prompts for more input/exiting game
                Console.WriteLine($"Your current record is: {playerScore.winCount} Wins - {playerScore.lossCount} Losses - {playerScore.tieCount} Ties ");
                Console.WriteLine("Play again? Choose r, p, s, or x to quit.");
                playerChoice = Console.ReadLine();
            }
            await persistence.WriteAsync(playerScore);
        }
Ejemplo n.º 26
0
        public BoardPanel(string typegame)
        {
            switch (typegame)
            {
            case "jvj":
                _ai  = null;
                _ai2 = null;
                init_game();
                break;

            case "jvia":
                _ai = new AI_Random()
                {
                    Colour = CheckerColour.Red
                };
                _ai2 = null;
                init_game();
                break;

            case "iavia":
                _ai = new AI_Random {
                    Colour = CheckerColour.Red
                };
                _ai2 = new AI_Random {
                    Colour = CheckerColour.Black
                };
                init_game();
                break;

            default:
                _ai  = null;
                _ai2 = null;
                init_game();
                break;
            }

            //this.DoubleBuffered = true;
            ResizeRedraw = true;
            SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.Opaque | ControlStyles.AllPaintingInWmPaint, true);

            AdvanceTurn();
        }
Ejemplo n.º 27
0
        public FindPathGameScreen(IAI tankAI)
        {
            BaseGame.CoordinMgr.SetScreenViewRect(scrnRect);
            camera  = new Camera(2, cameraStartPos, 0f);
            compass = new Compass(new Vector2(740, 540));
            camera.Enable();

            InitialBackGround();

            InitialScene();

            InitialAI(tankAI);

            camera.Focus(tank, true);

            GameTimer timer = new GameTimer(5,
                                            delegate()
            {
                TextEffectMgr.AddRiseFadeInScrnCoordin("test FadeUp in Scrn!", new Vector2(100, 100), 1f, Color.Black, LayerDepth.Text, GameFonts.Lucida, 300, 0.5f);
                TextEffectMgr.AddRiseFade("test FadeUp in Login!", new Vector2(100, 100), 1f, Color.White, LayerDepth.Text, GameFonts.Lucida, 300, 0.5f);
            });
        }
Ejemplo n.º 28
0
 public UnitType(
     string name,
     Material material,
     Mesh mesh,
     Shape collisionShape,
     Sphere boundingSphere,
     float maxHealth,
     float density,
     IAI ai,
     Type controllerType
     )
 {
     Name           = name;
     Material       = material;
     Mesh           = mesh;
     CollisionShape = collisionShape;
     BoundingSphere = boundingSphere;
     MaxHealth      = maxHealth;
     Density        = density;
     AI             = ai;
     ControllerType = controllerType;
 }
Ejemplo n.º 29
0
        private void InitialDrawMgr(IAI tankAI1, IAI tankAI2)
        {
            DrawMgr.SetCondition(
                delegate(IDrawableObj obj)
            {
                return(true);
            });
            //if (tankAI1 is ManualControl)
            //{
            //    DrawMgr.SetCondition(
            //        delegate(IDrawableObj obj)
            //        {
            //            if (tank1.IsDead)
            //                return true;

            //            if (tank1.Rader.PointInRader(obj.Pos) || obj == tank1 ||
            //                ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank1))
            //                return true;
            //            else
            //                return false;
            //        });
            //}
            //if (tankAI2 is ManualControl)
            //{
            //    DrawMgr.SetCondition(
            //        delegate(IDrawableObj obj)
            //        {
            //            if (tank2.IsDead)
            //                return true;

            //            if (tank2.Rader.PointInRader(obj.Pos) || obj == tank2 ||
            //                ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank2))
            //                return true;
            //            else
            //                return false;
            //        });
            //}
        }
Ejemplo n.º 30
0
        private void PlayerOrAIOptionChanged(ref IAI playerAI, ComboBox playerCombo, ComboBox aiDifficultyCombo)
        {
            if (_updateingPlayerAI)
            {
                return;
            }

            if (playerCombo.Text == PlayerOptions.Human.ToString())
            {
                playerAI = null;
                aiDifficultyCombo.Visible = false;
            }
            else if (playerCombo.Text == PlayerOptions.AI.ToString())
            {
                AI.AIDifficulty diff = FourRow.AI.AIDifficulty.Medium;
                if (!string.IsNullOrEmpty(aiDifficultyCombo.Text))
                {
                    diff = (AI.AIDifficulty)Enum.Parse(typeof(AI.AIDifficulty), aiDifficultyCombo.Text);
                }
                playerAI = new AI.AIBase(diff);
                cmbPlayer2AIDifficulty.Visible = true;
            }
        }
Ejemplo n.º 31
0
        public DuelGameScreen(IAI TankAI1, IAI TankAI2)
        {
            BaseGame.CoordinMgr.SetScreenViewRect(scrnViewRect);

            camera          = new Camera(2.6f, new Vector2(150, 112), 0);
            camera.maxScale = 4.5f;
            camera.minScale = 2f;
            camera.Enable();

            InitialBackGround();

            sceneMgr = new SceneMgr();
            SceneInitial();
            GameManager.LoadScene(sceneMgr);

            RuleInitial();

            AIInitial(TankAI1, TankAI2);

            InitialDrawMgr(TankAI1, TankAI2);

            InitialStartTimer();
        }
Ejemplo n.º 32
0
        public Game(AIStrategy aiStrategy, bool serialize)
        {
            _serialize = serialize;

            if (_serialize)
            {
                _gameHistories = _jsonPersistence.Read();
            }

            switch (aiStrategy)
            {
            case AIStrategy.Random:
                _ai = new RandomAI();
                break;

            case AIStrategy.AlwaysWins:
                _ai = new AlwaysWinsAI();
                break;

            case AIStrategy.AlwaysLoses:
                _ai = new AlwaysLosesAI();
                break;
            }
        }
Ejemplo n.º 33
0
 public Player(string name, Color tokenColour, Color highlightColour, IAI ai)
     : this(name, tokenColour, highlightColour)
 {
     _ai = ai;
 }
Ejemplo n.º 34
0
        private void AIInitial( IAI tankAI1, IAI tankAI2 )
        {
            commonServer = new AICommonServer( mapRect );

            tankAI1.CommonServer = commonServer;
            tankAI1.OrderServer = tank1;
            tank1.SetTankAI( tankAI1 );

            tankAI2.CommonServer = commonServer;
            tankAI2.OrderServer = tank2;
            tank2.SetTankAI( tankAI2 );

            //GameManager.ObjMemoryMgr.AddSingle( tank1 );
            //GameManager.ObjMemoryMgr.AddSingle( tank2 );
        }
Ejemplo n.º 35
0
        private void InitialDrawMgr( IAI tankAI1, IAI tankAI2 )
        {
            if (tankAI1 is ManualControl)
            {
                DrawMgr.SetCondition(
                    delegate( IDrawableObj obj )
                    {
                        if (tank1.IsDead)
                            return true;

                        if (tank1.Rader.PointInRader( obj.Pos ) || obj == tank1 ||
                            ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank1))
                            return true;
                        else
                            return false;
                    } );
            }
            if (tankAI2 is ManualControl)
            {
                DrawMgr.SetCondition(
                    delegate( IDrawableObj obj )
                    {
                        if (tank2.IsDead)
                            return true;

                        if (tank2.Rader.PointInRader( obj.Pos ) || obj == tank2 ||
                            ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank2))
                            return true;
                        else
                            return false;
                    } );
            }
        }
Ejemplo n.º 36
0
 public void SetTankAI( IAI tankAI )
 {
     if (tankAI == null)
         throw new NullReferenceException( "tankAI is null!" );
     this.tankAI = tankAI;
 }
Ejemplo n.º 37
0
 public Player(IAI ai)
     : this()
 {
     this.ai = ai;
     this.ai.Player = this;
 }
Ejemplo n.º 38
0
        public void RemoveMember(IAI ai)
        {
            Debug.Assert(m_members.Contains(ai));

            m_members.Remove(ai);
        }
Ejemplo n.º 39
0
        private void InitialDrawMgr(IAI tankAI1, IAI tankAI2)
        {
            DrawMgr.SetCondition(
                delegate(IDrawableObj obj)
                {
                    return true;
                });
            //if (tankAI1 is ManualControl)
            //{
            //    DrawMgr.SetCondition(
            //        delegate(IDrawableObj obj)
            //        {
            //            if (tank1.IsDead)
            //                return true;

            //            if (tank1.Rader.PointInRader(obj.Pos) || obj == tank1 ||
            //                ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank1))
            //                return true;
            //            else
            //                return false;
            //        });
            //}
            //if (tankAI2 is ManualControl)
            //{
            //    DrawMgr.SetCondition(
            //        delegate(IDrawableObj obj)
            //        {
            //            if (tank2.IsDead)
            //                return true;

            //            if (tank2.Rader.PointInRader(obj.Pos) || obj == tank2 ||
            //                ((obj is ShellNormal) && ((ShellNormal)obj).Firer == tank2))
            //                return true;
            //            else
            //                return false;
            //        });
            //}
        }
Ejemplo n.º 40
0
 public Agent(IEntity entity, IAI ai, float maxSpeed)
 {
     this.Entity = entity;
     this.AI = ai;
     this.MaxSpeed = maxSpeed;
 }
Ejemplo n.º 41
0
        public DuelGameScreen( IAI TankAI1, IAI TankAI2 )
        {
            BaseGame.CoordinMgr.SetScreenViewRect( scrnViewRect );

            camera = new Camera( 2.6f, new Vector2( 150, 112 ), 0 );
            camera.maxScale = 4.5f;
            camera.minScale = 2f;
            camera.Enable();

            InitialBackGround();

            sceneMgr = new SceneMgr();
            SceneInitial();
            GameManager.LoadScene( sceneMgr );

            RuleInitial();

            AIInitial( TankAI1, TankAI2 );

            InitialDrawMgr( TankAI1, TankAI2 );

            InitialStartTimer();
        }
Ejemplo n.º 42
0
 private void UpdatePlayerComboValues(IAI playerAI, ComboBox playerCombo, ComboBox aiDifficultyCombo)
 {
     _updateingPlayerAI = true;
     if (playerAI == null) {
         playerCombo.Text = PlayerOptions.Human.ToString();
         aiDifficultyCombo.Visible = false;
     } else {
         playerCombo.Text = PlayerOptions.AI.ToString();
         aiDifficultyCombo.Text = playerAI.Difficulty.ToString();
         aiDifficultyCombo.Visible = true;
     }
     _updateingPlayerAI = false;
 }
Ejemplo n.º 43
0
        private void InitialAI( IAI tankAI )
        {
            commonServer = new AICommonServer( mapSize );
            tank.SetTankAI( tankAI );
            tankAI.OrderServer = tank;
            tankAI.CommonServer = commonServer;

            GameManager.ObjMemoryMgr.AddSingle( tank );
        }
Ejemplo n.º 44
0
 public int AddPlayer(IAI ai)
 {
     players.Add(new KeyValuePair<IAI, Player>(ai, new Player(this)));
     return players.Count - 1;
 }
Ejemplo n.º 45
0
 internal void SetAI(IAI _ai)
 {
     ai = _ai;
 }
Ejemplo n.º 46
0
        /// <summary>
        /// Provides the extra text for the <see cref="AdvancedPropertyDescriptor"/> for a
        /// <see cref="IAI"/>.
        /// </summary>
        /// <param name="v">The value.</param>
        /// <returns>The extra text to display.</returns>
        static string ExtraTextProvider_IAI(IAI v)
        {
            if (v == null)
                return null;

            return AIFactory.Instance.GetAIName(v.ID);
        }
Ejemplo n.º 47
0
 // Use this for initialization
 void Start()
 {
     m_AI           = new AIIdle();
     m_GameObj      = GetComponent <IGameObject>();
     Time.timeScale = 2.0f;        // 加速.
 }
Ejemplo n.º 48
0
 public static Player NewPlayer1(IAI ai)
 {
     return new Player("Player 1", Player1TokenColour, Player1HighlightColour, ai);
 }
Ejemplo n.º 49
0
 public static Player NewPlayer2(IAI ai)
 {
     return new Player("Player 2", Player2TokenColour, Player2HighlightColour, ai);
 }
Ejemplo n.º 50
0
        public FindPathGameScreen( IAI tankAI )
        {
            BaseGame.CoordinMgr.SetScreenViewRect( scrnRect );
            camera = new Camera( 2, cameraStartPos, 0f );
            compass = new Compass( new Vector2( 740, 540 ) );
            camera.Enable();

            InitialBackGround();

            InitialScene();

            InitialAI( tankAI );

            camera.Focus( tank, true );

            GameTimer timer = new GameTimer( 5,
                delegate()
                {
                    TextEffectMgr.AddRiseFadeInScrnCoordin( "test FadeUp in Scrn!", new Vector2( 100, 100 ), 1f, Color.Black, LayerDepth.Text, GameFonts.Lucida, 300, 0.5f );
                    TextEffectMgr.AddRiseFade( "test FadeUp in Login!", new Vector2( 100, 100 ), 1f, Color.White, LayerDepth.Text, GameFonts.Lucida, 300, 0.5f );
                } );
        }