Ejemplo n.º 1
0
        public void Clear()
        {
            _param = null;
            _game  = null;

            _currentFrame = 0;
        }
Ejemplo n.º 2
0
        public void EnterBattle(GameParam param, IGame game)
        {
            if (_isRunning)
            {
                this.LogWarning("The game is running, don't run it!");
                return;
            }
            _isRunning = true;

            _map = new GameMap();
            _map.Load(param.mapID);

            _context = new GameContext(param, game);

            _foodList.Clear();
            _snakerList.Clear();
            tobeAddFoodList.Clear();
            tobeAddSnakerList.Clear();
            removeFoodList.Clear();
            removeSnakerList.Clear();

            _context.EnterFrame(0);

            this.Log("StartBattle()");
        }
Ejemplo n.º 3
0
        public GameContext(GameParam param, IGame game)
        {
            _param = param;
            _game  = game;

            _random      = new Random();
            _random.Seed = _param.randSeed;

            _currentFrame = 0;
        }
Ejemplo n.º 4
0
        public void Start(object param)
        {
            _isStoped = false;

            GameParam gameParam = param as GameParam;

            _gameMode = gameParam.mode;

            RegisterPlayer();

            BattleEngine.Instance.EnterBattle(gameParam, this);
            m_context = BattleEngine.Instance.Context;

            GameInput.onVKey = OnVKey;
            GameInput.DisableInput();

            Scheduler.AddFixedUpdateListener(FixedUpdate);
        }