public UserInput(Scripting.IMover mover, Scripting.ISoundPlayer soundPlayer, Scripting.IItemPicker itemPicker, World.NavMeshes.NavMesh navMesh) { elapsedIgnoreMilliseconds = 0; ignoringInput = false; interpreter = new Scripting.PlayerInterpreter(mover, soundPlayer, itemPicker); this.navMesh = navMesh; }
public BugMind(Scripting.IMover mover, Scripting.ILocator locator, World.NavMeshes.NavMesh navMesh, int bugId, List <Scripting.Instructions.Instruction> behavior) { this.bugId = bugId; this.behavior = behavior; aiType = BugAI.AIType.Bug1Behavior; instructionCounter = 0; interpreter = new Scripting.BugInterpreter(mover, locator, navMesh, bugId); }
public LocationContainer(Scripting.IMover mover, World.NavMeshes.NavMesh navMesh) { this.mover = mover; this.navMesh = navMesh; bugAI = new Input.BugAI(mover, navMesh, this); locations = new List <Location>(Globals.LocationCount); for (int i = 0; i < Globals.LocationCount; i++) { locations.Add(new Location(false, false, false, false)); } playerLocationId = 0; bugLocations = new Dictionary <int, int>(); waveConfigurations = WaveBuilder.DefaultWaves(); ResetGame(); }
//IInvokeProvider pauseProv; public MainGamePage() { isLoaded = false; playerVulnerable = true; this.InitializeComponent(); gameStateMachine = new StateMachine.GameStateMachine(); gameStateMachine.Subscribe(this); navMesh = new World.NavMeshes.NavMesh(); locationContainer = new World.Locations.LocationContainer(this, navMesh); // Tile Arrangments must be loaded before the visualizer tries to use them in its own startup sequence: tileArrangements = new Visual.Arrangements.TileArrangements(); visualizer = new Visual.Visualizer( locationContainer, tileArrangements, new Visual.TileGraphicArrangement()); userInput = new Input.UserInput(this, this, this, navMesh); upKeyPressed = false; downKeyPressed = false; leftKeyPressed = false; rightKeyPressed = false; spacebarPressed = false; letterAKeyPressed = false; //escapeKeyPressed = false; northButtonPeer = new ButtonAutomationPeer(NorthButton); northProv = northButtonPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; southButtonPeer = new ButtonAutomationPeer(SouthButton); southProv = southButtonPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; westButtonPeer = new ButtonAutomationPeer(WestButton); westProv = westButtonPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; eastButtonPeer = new ButtonAutomationPeer(EastButton); eastProv = eastButtonPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; actionButtonPeer = new ButtonAutomationPeer(ActionButton); actionProv = actionButtonPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; //pauseButtonPeer = new ButtonAutomationPeer(PauseButton); //pauseProv = pauseButtonPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; score = StartingScore; chancesLeft = StartingChances; transitionFunctionMappings = new Dictionary <GameStateCodes, TransitionFunc> { { GameStateCodes.StartingUp, StartingUpTransition }, { GameStateCodes.PlayerReady, PlayerReadyTransition }, { GameStateCodes.Playing, PlayingTransition }, { GameStateCodes.PlayerDying, PlayerDyingTransition }, { GameStateCodes.Paused, PausedTransition }, { GameStateCodes.GameOver, GameOverTransition } }; playerMessage = null; playerMessageRow2 = null; }
public BugInterpreter(Scripting.IMover mover, Scripting.ILocator locator, World.NavMeshes.NavMesh navMesh, int bugId) { this.bugId = bugId; this.mover = mover; this.locator = locator; this.navMesh = navMesh; totalIdlingTime = 0; maxIdlingTime = 0; idling = false; dictionary = new Dictionary <Instructions.OpCodes, Action <int> >(); dictionary.Add(Instructions.OpCodes.MoveTo, MoveTo); dictionary.Add(Instructions.OpCodes.Bite, Bite); dictionary.Add(Instructions.OpCodes.TryNorth, TryNorth); dictionary.Add(Instructions.OpCodes.TrySouth, TrySouth); dictionary.Add(Instructions.OpCodes.TryWest, TryWest); dictionary.Add(Instructions.OpCodes.TryEast, TryEast); dictionary.Add(Instructions.OpCodes.Idle, Idle); }
public BugAI(Scripting.IMover mover, World.NavMeshes.NavMesh navMesh, Scripting.ILocator locator) { this.mover = mover; this.navMesh = navMesh; this.locator = locator; bugs = new List <BugMind>(); bugType1Behavior = new List <Scripting.Instructions.Instruction> { new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), }; bugType2Behavior = new List <Scripting.Instructions.Instruction> { new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryEast, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryWest, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), }; bugType3Behavior = new List <Scripting.Instructions.Instruction> { new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), }; }