public void Clear() { _param = null; _game = null; _currentFrame = 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()"); }
public GameContext(GameParam param, IGame game) { _param = param; _game = game; _random = new Random(); _random.Seed = _param.randSeed; _currentFrame = 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); }