Inheritance: MonoBehaviour
        public override void Update(GameTime gameTime, GameEngine.TeeEngine engine)
        {
            if (Entity.IntersectsWith(this, "Body", Target, "Body", gameTime))
            {
                // Target is hit
                if (Target is NPC)
                {
                    NPC target = (NPC)Target;
                    target.OnHit(this, Damage, gameTime, engine);
                }

                engine.RemoveEntity(this);
            }
            else
            {
                double distance = Vector2.Distance(Pos, MoveTo);

                if (distance < 10)
                {
                    // TODO check for attack succeeding
                    engine.RemoveEntity(this);
                }
                else
                {
                    Pos.X += (float)(Math.Cos(_moveAngle) * Speed);
                    Pos.Y += (float)(Math.Sin(_moveAngle) * Speed);
                }
            }
        }
 public void StartGame()
 {
     //this.simpleSound.Stop();
     KeyboardController keyboardController = new KeyboardController();
     GameEngine game = new GameEngine(keyboardController);
     game.Run();
 }
        public override void Init(GameEngine game)
        {
            base.Init(game);
            List<SFML.Graphics.Text> protptypeLabel = new List<SFML.Graphics.Text>();
            List<Type> prototypeStates = new List<Type>();

            Assembly assembly = Assembly.GetExecutingAssembly();

            Type[] classes = assembly.GetTypes();
            int i =0;
            foreach (Type t in classes)
            {
                if (t.BaseType.Name.Equals("IPrototype"))
                {
                    SFML.Graphics.Text text = new SFML.Graphics.Text(i+". :"+t.Name);
                    text.Position = new SFML.Window.Vector2f(50, 20 + i * 30);
                    protptypeLabel.Add(text);
                    prototypeStates.Add(t);
                    i++;
                }
            }

            _prototypeLabels = protptypeLabel.ToArray<SFML.Graphics.Text>();
            _prototypeStates = prototypeStates.ToArray<Type>();
        }
 static void Main()
 {
     using (var game = new GameEngine())
     {
         game.Run();
     }
 }
        public LoadScreenState(GameEngine engine, PlayState playstate, int lvl)
        {
            eng = engine;
			this.playstate = playstate;
			this.lvl = lvl;

			doneLoading = false;

            lookat = new Vector3(0, 0, 2);
            eye = new Vector3(0, 0, 5);

			screens = new Texture[8];
			for(int i = 0; i < 8; i++) {
				screens[i] = eng.StateTextureManager.GetTexture("load" + (i + 1));
			}

			// Set the current image to be displayed at 0 which is the first in the sequence
			curFrame = 0.0;

			//Free up any old textures so we have more VRAM available to load new stuff
			for(int i = SpriteSheet.allSprites.Count - 1; i >= 0; i-- ) {
				SpriteSheet.allSprites[i].releaseTexture();
			}

			foreach(int i in SpriteSheet.texIDsToRemove) {
				GL.DeleteTexture(i);
			}
			SpriteSheet.texIDsToRemove.Clear();

			GC.Collect();

			//Start loading in separate thread
			Thread loaderThread = new Thread(new ThreadStart(loadLevel));
			loaderThread.Start();
        }
        // Runs expectimax searches to test the weights of the chromosome
        private double TestWeights()
        {
            double total = 0;
            ConcurrentBag<double> subTotals = new ConcurrentBag<double>();

            Parallel.For(0, NUM_THREADS, j =>
            {
                double subtotal = 0;
                for (int i = 0; i < NUM_TESTS / NUM_THREADS; i++)
                {
                    GameEngine gameEngine = new GameEngine();
                    Expectimax expectimax = new Expectimax(gameEngine, 2);
                    State end = expectimax.RunStar1WithUnlikelyPruning(false, chromosome);
                    double points = end.Points;
                    subtotal += points;

                }
                subTotals.Add(subtotal);
            });
            foreach (double sub in subTotals)
            {
                total += sub;
            }
            num_tests += NUM_TESTS;
            return total;
        }
Exemple #7
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (GameEngine game = new GameEngine(800, 640, true))
     {
         game.Run();
     }
 }
Exemple #8
0
        public OpenTKWindow(GameEngine engine)
            : base(800, 600, new GraphicsMode(32, 24, 0, 2), "ORTS.Test")
        {
            VSync = VSyncMode.Off;
            Views= new ConcurrentDictionary<Type,IGameObjectView>();
            this.Engine = engine;

            this.Engine.Bus.OfType<LoadObjectView>().Subscribe(m => Views.TryAdd(m.GameObjectType,m.View));
            KeyMap map = new KeyMap();

            Keyboard.KeyDown += (object sender, KeyboardKeyEventArgs e) => {
                this.Engine.Bus.Add(new KeyDown(this.Engine.Timer.LastTickTime, map.Do(e.Key)));
            };
            Keyboard.KeyUp += (object sender, KeyboardKeyEventArgs e) => {
                this.Engine.Bus.Add(new KeyUp(this.Engine.Timer.LastTickTime, map.Do(e.Key)));
            };

            Mouse.WheelChanged += (object sender, MouseWheelEventArgs e) => {
                camera.Translate(new Vect3(0,0,-e.DeltaPrecise));
            };

            engine.Bus.Add(new GraphicsLoadedMessage(engine.Timer.LastTickTime));

            camera = new Camera();
            camera.Translate(new Vect3(0, 0, 30));
        }
        // End Fonts

        public PauseMenuState(GameEngine engine, MainMenuState menustate)
        {
            eng = engine;
            menu = menustate;
            lookat = new Vector3(0, 0, 2);
            eye = new Vector3(0, 0, 5);
//             _p1 = eng.StateTextureManager.GetTexture("p1");
//             _p2 = eng.StateTextureManager.GetTexture("p2");
//             _p3 = eng.StateTextureManager.GetTexture("p3");
//             _p4 = eng.StateTextureManager.GetTexture("p4");

            // QFont
            Assembly assembly = Assembly.GetExecutingAssembly();
            eng.StateTextureManager.LoadTexture("menu", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.menu.png"));
            bg = eng.StateTextureManager.GetTexture("menu");

            _buttons = new List<String>();            
            _buttons.Add("Continue??");
			_buttons.Add("Main Menu");
            _buttons.Add("Quit");
            button = QFont.FromQFontFile("Fonts/myHappySans.qfont", new QFontLoaderConfiguration(true));
            button.Options.DropShadowActive = true;
            //title = QFont.FromQFontFile("myHappySans.qfont", new QFontLoaderConfiguration(true));
            title = QFont.FromQFontFile("Fonts/myRock.qfont", new QFontLoaderConfiguration(true));
            title.Options.DropShadowActive = false;
            buttonHighlight = QFont.FromQFontFile("Fonts/myHappySans2.qfont", new QFontLoaderConfiguration(true));
            buttonHighlight.Options.DropShadowActive = true;
            //QFont.CreateTextureFontFiles("Fonts/Rock.TTF", 48, "myRock"); // Use this to create new Fonts that you will texture
            // End QFonts

			// Set the current image to be displayed at 0 which is the first in the sequence
			curFrame = 0.0;


        }
        public PlayerNameState(GameEngine engine, MainMenuState ms)
        {
            eng = engine;
            mouse = eng.Mouse;
            savedGameStates = new Stack<XmlNodeList>();
            savedGameChoices = new Stack<string>();
            _ms = ms;

            Assembly assembly = Assembly.GetExecutingAssembly();
            
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            lookat = new Vector3(0, 0, 2);
            eye = new Vector3(0, 0, 5);

            _old_state = OpenTK.Input.Keyboard.GetState(); // Get the current state of the keyboard

            eng.StateTextureManager.LoadTexture("menu", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.menu.png"));
            menu = eng.StateTextureManager.GetTexture("menu");

            saveFont = QFont.FromQFontFile("Fonts/myHappySans.qfont", new QFontLoaderConfiguration(true));
            saveFont.Options.DropShadowActive = true;

            start_x = saveFont.Measure("Name: ").Width;

            //title = QFont.FromQFontFile("myHappySans.qfont", new QFontLoaderConfiguration(true));
            title = QFont.FromQFontFile("Fonts/myRock.qfont", new QFontLoaderConfiguration(true));
            title.Options.DropShadowActive = true;

            name = "";          

            numOfButtons = savedGameChoices.Count - 1;
        }
Exemple #11
0
 public TradeManager(GameState gamestate, GameEngine ge)
 {
     this.gamestate = gamestate;
     gameengine = ge;
     this.numProposedTrades = 0;
     this.numSuccessfulTrades = 0;
 }
        public LevelSelect(GameEngine engine) : base(engine)
        {
            eng = engine;
            savedGameStates = new Stack<XmlNodeList>();
            savedGameChoices = new Stack<string>();
            mouse = eng.Mouse;
            // Load all the textures
            eng.StateTextureManager.RenderSetup();
            Assembly assembly = Assembly.GetExecutingAssembly();
            eng.StateTextureManager.LoadTexture("menu", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.menu.png"));
            menu = eng.StateTextureManager.GetTexture("menu");
            eng.StateTextureManager.LoadTexture("arrow", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.arrow.png"));
            arrow = eng.StateTextureManager.GetTexture("arrow");
            eng.StateTextureManager.LoadTexture("load", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_loadlevel.png"));
            load_nopress = eng.StateTextureManager.GetTexture("load");
            eng.StateTextureManager.LoadTexture("loadpress", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_loadlevel_hover.png"));
            load_press = eng.StateTextureManager.GetTexture("loadpress");
            eng.StateTextureManager.LoadTexture("quit", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_exit.png"));
            quit_nopress = eng.StateTextureManager.GetTexture("quit");
            eng.StateTextureManager.LoadTexture("quitpress", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_exit_hover.png"));
            quit_press = eng.StateTextureManager.GetTexture("quitpress");
            eng.StateTextureManager.LoadTexture("play", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_play.png"));
            play_nopress = eng.StateTextureManager.GetTexture("play");
            eng.StateTextureManager.LoadTexture("playpress", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_play_hover.png"));
            play_press = eng.StateTextureManager.GetTexture("playpress");
            eng.StateTextureManager.LoadTexture("ld", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_leveldesign.png"));
            ld_nopress = eng.StateTextureManager.GetTexture("ld");
            eng.StateTextureManager.LoadTexture("ldpress", assembly.GetManifestResourceStream("U5Designs.Resources.Textures.btn_leveldesign_hover.png"));
            ld_press = eng.StateTextureManager.GetTexture("ldpress");

            musicFile = new AudioFile(assembly.GetManifestResourceStream("U5Designs.Resources.Sound.Retribution.ogg"));
            musicFile.Play();

            // Setup saved game data 
            SavedGameDataSetup();

            // Display available saved game states
            DisplayAvailableSaves();

            // Clear the color to work with the SplashScreen so it doesn't white out
            GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            lookat = new Vector3(0, 0, 2);
            eye = new Vector3(0, 0, 5);

            _old_state = OpenTK.Input.Keyboard.GetState(); // Get the current state of the keyboard           

            arX = -150.0f;
            b1Y = 0.0f;
            b2Y = -100.0f;
            b3Y = -200.0f;
            b4Y = -250.0f;

            // TEST //
            enterdown = false;
            LoadSavedState(1);

        }
Exemple #13
0
        public override void onAttack(GameEngine.TeeEngine engine, GameTime gameTime)
        {
            BeeProjectile attack = new BeeProjectile(Pos.X, Pos.Y, AttackTarget);
            attack.Damage = Damage;
            engine.AddEntity(attack);

            Stance = AttackStance.Retreating;
        }
        public GamePlayViewModel(GameEngine gameEngine)
        {
            this.gameEngine = gameEngine;

            StartNewGameCommand = new RelayCommand<GamePlayViewModel>(x => StartNewGame());

            NextTurnCommand = new RelayCommand<GamePlayViewModel>(x => x.IsGameInProgress, x => NextTurn());
        }
 private void SetupGamer()
 {
     this.player = new Gamer();
     var form = new GameForm();
     IRenderer renderer = new GuiRenderer(form);
     IInputHandlerer handler = new GuiInputHandlerer();
     this.engine = new GameEngine(renderer, handler);
 }
Exemple #16
0
 public static GameEngine getGameEngine()
 {
     if (null == instance)
     {
         instance = new DayGameEngineImp();
     }
     return instance;
 }
        public override void PostInitialize(GameTime gameTime, GameEngine.TeeEngine engine)
        {
            // Todo: this should technically NOT be here.
            this.Pos += new Vector2(Width/2.0f, Height/2.0f);

            LightShader lightShader = (LightShader)engine.GetPostGameShader("LightShader");
            lightShader.LightSources.Add(this);
        }
 public void Setup()
 {
     _display = new Mock<IGameDisplay>();
     _display.SetupSequence<IGameDisplay, bool>(x => x.PlayAgainMessage()).Returns(true).Returns(true).Returns(false);
     _board = new Mock<IBoard>();
     _playGameHandler = new Mock<PlayGameHandler>();
     _gameEngine = new GameEngine(_display.Object, _board.Object, _playGameHandler.Object);
 }
Exemple #19
0
        public GameTerrain(GameEngine game, GameCamera camera, string resource)
            : base(game)
        {
            this.camera = camera;
            this.resource = resource;

            Loaded = false;
        }
Exemple #20
0
        public GameSky(GameEngine game, GameCamera camera, string resource, string effect)
            : base(game)
        {
            this.camera = camera;
            this.resource = resource;

            Loaded = false;
        }
        public void SetUp()
        {
            var gameEngine = new GameEngine(Substitute.For<ITileSetFactory>());

            gamePlayViewModel = new GamePlayViewModel(gameEngine);

            gamePlayViewModel.StartNewGameCommand.Execute(null);
        }
        public override void Update(GameTime gameTime, GameEngine.TeeEngine engine)
        {
            if (CurrentDrawableState.Contains("Spin"))
            {

            }

            base.Update(gameTime, engine);
        }
        public AIPlayer(GameEngine.CSharp.Game.Engine.Game gameData, Guid gameId, Guid playerId)
        {
            this.gameData = gameData;
            this.gameId = gameId;
            this.playerId = playerId;
            this.myColor = this.gameData.playerColorMapping[this.playerId];

            InitializeAIStrategies();
        }
Exemple #24
0
 public GameEventProxy(Engine scriptEngine, GameEngine gameEngine)
 {
     engine = scriptEngine;
     this.gameEngine = gameEngine;
     eventCache = new Dictionary<string,Octgn.DataNew.Entities.GameEvent[]>();
                 eventCache.Add("OnTableLoad",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnTableLoad"))
         eventCache["OnTableLoad"] = gameEngine.Definition.Events["OnTableLoad"];
                         eventCache.Add("OnGameStart",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnGameStart"))
         eventCache["OnGameStart"] = gameEngine.Definition.Events["OnGameStart"];
                         eventCache.Add("OnLoadDeck",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnLoadDeck"))
         eventCache["OnLoadDeck"] = gameEngine.Definition.Events["OnLoadDeck"];
                         eventCache.Add("OnChangeCounter",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnChangeCounter"))
         eventCache["OnChangeCounter"] = gameEngine.Definition.Events["OnChangeCounter"];
                         eventCache.Add("OnEndTurn",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnEndTurn"))
         eventCache["OnEndTurn"] = gameEngine.Definition.Events["OnEndTurn"];
                         eventCache.Add("OnTurn",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnTurn"))
         eventCache["OnTurn"] = gameEngine.Definition.Events["OnTurn"];
                         eventCache.Add("OnTargetCard",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnTargetCard"))
         eventCache["OnTargetCard"] = gameEngine.Definition.Events["OnTargetCard"];
                         eventCache.Add("OnTargetCardArrow",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnTargetCardArrow"))
         eventCache["OnTargetCardArrow"] = gameEngine.Definition.Events["OnTargetCardArrow"];
                         eventCache.Add("OnMoveCard",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnMoveCard"))
         eventCache["OnMoveCard"] = gameEngine.Definition.Events["OnMoveCard"];
                         eventCache.Add("OnPlayerGlobalVariableChanged",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnPlayerGlobalVariableChanged"))
         eventCache["OnPlayerGlobalVariableChanged"] = gameEngine.Definition.Events["OnPlayerGlobalVariableChanged"];
                         eventCache.Add("OnGlobalVariableChanged",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnGlobalVariableChanged"))
         eventCache["OnGlobalVariableChanged"] = gameEngine.Definition.Events["OnGlobalVariableChanged"];
                         eventCache.Add("OnCardClick",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnCardClick"))
         eventCache["OnCardClick"] = gameEngine.Definition.Events["OnCardClick"];
                         eventCache.Add("OnCardDoubleClick",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnCardDoubleClick"))
         eventCache["OnCardDoubleClick"] = gameEngine.Definition.Events["OnCardDoubleClick"];
                         eventCache.Add("OnMarkerChanged",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnMarkerChanged"))
         eventCache["OnMarkerChanged"] = gameEngine.Definition.Events["OnMarkerChanged"];
                         eventCache.Add("OnPlayerConnect",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnPlayerConnect"))
         eventCache["OnPlayerConnect"] = gameEngine.Definition.Events["OnPlayerConnect"];
                         eventCache.Add("OnPlayerLeaveGame",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnPlayerLeaveGame"))
         eventCache["OnPlayerLeaveGame"] = gameEngine.Definition.Events["OnPlayerLeaveGame"];
                         eventCache.Add("OnScriptedMoveCard",new DataNew.Entities.GameEvent[0]);
     if(gameEngine.Definition.Events.ContainsKey("OnScriptedMoveCard"))
         eventCache["OnScriptedMoveCard"] = gameEngine.Definition.Events["OnScriptedMoveCard"];
 }
        public void TestGetTopResults()
        {
            Playfield playfield = new Playfield();
            GameEngine engine = new GameEngine(playfield);

            string expected = engine.GetTopResults();
            string actual = new ScoreBoard().ShowScoreboard();
            Assert.AreEqual(expected, actual);
        }
Exemple #26
0
 private static void Main()
 {
     using (var engine = new GameEngine(
         "Red Line",
         CreateMainMenuScene))
     {
         engine.Run();
     }
 }
    static void Main()
    {
        FleckLog.Level = LogLevel.Error;

        var renderers = new ConcurrentDictionary<IWebSocketConnection, IRenderer>();

        var proxyRenderer = new ProxyRenderer();
            proxyRenderer.AddRenderer( new ConsoleRenderer());
        var allSockets = new List<IWebSocketConnection>();
        var server = new WebSocketServer("ws://localhost:8080/websession");
        server.Start(socket =>
        {
            socket.OnOpen = () =>
            {
                allSockets.Add(socket);
                renderers[socket] = new WebRenderer(socket);
                proxyRenderer.AddRenderer(renderers[socket]);

                if (allSockets.Count == 1)
                {
                    var size = new Size(10, 15);
                    var dto = new InitMessageDto(new SizeDto(size));
                    socket.Send(dto.ToJson());

                    var engine = new GameEngine(size, new ConsoleInputListener(), proxyRenderer);
                    engine.Start();
                }
                else
                {
                    var size = new Size(10, 15);
                    var dto = new InitMessageDto(new SizeDto(size));
                    socket.Send(dto.ToJson());
                }
            };
            socket.OnClose = () =>
            {
                allSockets.Remove(socket);
                proxyRenderer.RemoveRenderer(renderers[socket]);

                IRenderer toRemove;
                renderers.TryRemove(socket, out toRemove);
            };
            socket.OnMessage = message =>
            {
                //Console.WriteLine(message);
                //allSockets.ToList().ForEach(s => s.Send("Echo: " + message));
            };
        });

        while (true)
        {
            Thread.Sleep(1000);
        }

           // Console.ReadLine();
    }
        public void SetUp()
        {
            var tileFactory = Substitute.For<ITileSetFactory>();

            tileFactory.CreateTiles(Arg.Any<int>()).Returns(new[] { CreateTile(), CreateTile(), CreateTile() });

            gameEngine = new GameEngine(tileFactory);

            gameEngine.StartNewGame();
        }
Exemple #29
0
        private static void Main()
        {
            Console.BufferWidth = Console.LargestWindowWidth;
            Console.BufferHeight = Console.LargestWindowHeight;
            MainMenu();

            ConsoleKeyInfo info = Console.ReadKey();

            do {
                GameEngine game;
                
                switch(info.KeyChar)
                {
                    case 'l':
                        game = new GameEngine(12, 12);
                        //// 12x12 blinker
                        string blinker = "000000000000000000000000000000000000000000100000000000100000000000100000000000000000";
                        RunGame(game, blinker, 20);
                        break;
                    case 't':
                        game = new GameEngine(6,6);
                        string toad = "000000000100010010010010001000000000";
                        RunGame(game, toad, 20);
                        break;
                    case 'b':
                        game = new GameEngine(6,6);
                        string beacon = "000000011000010000000010000110000000";
                        RunGame(game,beacon,20);
                        break;
                    case 'p':
                        game = new GameEngine(17,17);
                        string pulsar = "0000000000000000000000000000000000000011100011100000000000000000000000100001010000100001000010100001000010000101000010000001110001110000000000000000000000000111000111000000100001010000100001000010100001000010000101000010000000000000000000000011100011100000000000000000000000000000000000000";
                        RunGame(game,pulsar,20);
                        break;
                    case 'i':
                        game = new GameEngine(8,10);
                        string indef = "00000000000000000100000001011000000101000000010000000100000001010000000000000000";
                        RunGame(game, indef, 20);
                        break;
                    case 'c':
                        ExtendedMenu();
                        break;
                    default:
                        Console.WriteLine("Please press the key from above list");
                        break;
                }

                
                ClearPlayArea(7,17,17);
                Console.SetCursorPosition(0, 7);
                info = Console.ReadKey();

            } while ( info.KeyChar  != 'z'  ) ;
        }
Exemple #30
0
        public GamePlayLogic(GameEngine gameEngine)
        {
            this.GameEngine = gameEngine;

            InitializePlayers();
            InitializeCurves();

            //LoadMap("Congas");
            //LoadMap("Clap");
            NewMap("Bass");
        }
Exemple #31
0
 public Scores(GameEngine main)
 {
     InitializeComponent();
     PlayerScores.ItemsSource = main.CurrentScores;
 }
Exemple #32
0
        static void Main()
        {
            GameEngine Engine = new GameEngine();

            Engine.GameLoop();
        }
Exemple #33
0
 public override bool validate(Field f)
 {
     return(f.isEmpty() && GameEngine.distanceFromTower(f) <= range);
 }
Exemple #34
0
 public static void Main()
 {
     GameEngine.Run();
 }
 public static void Main()
 {
     GameEngine.Start();
 }
        public void TestMoveOffBoard()
        {
            GameEngine gameEngine = new GameEngine();

            gameEngine.Move(2, 7, 3, 8);
        }
Exemple #37
0
 public void DenySellUnit()
 {
     sellUnitModal.gameObject.SetActive(false);
     GameEngine.GetInstance().audioManager.PlayAudio(AudioManager.BUTTON_CLICK_SOUND);
 }
Exemple #38
0
 public override bool CanExecute()
 {
     return(GameEngine.IsFreeSpace(_target));
 }
Exemple #39
0
 public Move(DragonX dragon, Direction direction, GameEngine game) : base(dragon, game)
 {
     Direction = direction;
     _target   = Dragon.Location + direction;
 }
Exemple #40
0
 public override CAST_EFFECT beginCast()
 {
     GameEngine.requestSetOfFieldsTarget(modX, modY, new FieldValidator(), "Select target");
     return(CAST_EFFECT.SUSPEND);
 }
 void Awake()
 {
     m_Instance = this;
 }
 protected MaintenanceRequest(MaintenanceCommandTypes commandType)
 {
     this.commandType = (int)commandType;
     clientID         = GameEngine.GetInstance().Client.ClientID;
 }
Exemple #43
0
        public static void Main()
        {
            var gameEngine = new GameEngine();

            gameEngine.Run();
        }
 public Menu()
 {
     GameEngine = new GameEngine();
 }
Exemple #45
0
 static void Main(string[] args)
 {
     GameEngine gameEngine = new GameEngine { ShowFps = true, WindowTitle = "Vipp Game" };
     gameEngine.Init();
     gameEngine.Start();
 }
 public void Cleanup()
 {
     GameEngine.Uninitialize();
 }
        public void TestBadMove()
        {
            GameEngine gameEngine = new GameEngine();

            gameEngine.Move(1, 1, 2, 2);
        }
Exemple #48
0
 /// <summary>
 /// Handle input for this menu
 /// </summary>
 /// <param name="engine"></param>
 public override void HandleInput(GameEngine engine)
 {
 }
 public ExpelFireAction(DragonX dragon, GameEngine game) : base(dragon, game)
 {
 }
Exemple #50
0
 public static void TryCloseOozePopup()
 {
     AddAction(new Action(GameEngine.GetRelicOozePopupButton1(), 0));
     AddAction(new Action(GameEngine.GetRelicOozePopupButton2(), 0));
 }
Exemple #51
0
        /// <summary>
        /// Draw the message menu
        /// </summary>
        /// <param name="engine"></param>
        /// <param name="ImageManager"></param>
        public override void Draw(GameEngine engine, ImageManager ImageManager)
        {
            // Get the parent's coordinates if there is one
            int parentX = 0;
            int parentY = 0;

            if (Parent != null)
            {
                parentX = Parent.X;
                parentY = Parent.Y;
            }

            // Find the x and y coordinates in the terminal for the menu
            int terminalX = parentX + X;
            int terminalY = parentY + Y;

            // Allow the borders to be placed on top of other glyphs
            ImageManager.CompositionMode();

            // Draw the borders
            for (int x = terminalX + 1; x < terminalX + Width - 1; x++)
            {
                ImageManager.PlaceChar(x, terminalY, 0x2500);
                ImageManager.PlaceChar(x, terminalY + Height - 1, 0x2500);
            }
            for (int y = terminalY + 1; y < terminalY + Height - 1; y++)
            {
                ImageManager.PlaceChar(terminalX, y, 0x2502);
                ImageManager.PlaceChar(terminalX + Width - 1, y, 0x2502);
            }

            // Draw the corners to the border
            ImageManager.PlaceChar(terminalX, terminalY, 0x250C);
            ImageManager.PlaceChar(terminalX, terminalY + Height - 1, 0x2514);
            ImageManager.PlaceChar(terminalX + Width - 1, terminalY, 0x2510);
            ImageManager.PlaceChar(terminalX + Width - 1, terminalY + Height - 1, 0x2518);

            ImageManager.CompositionMode(false);

            // Draw the title of the menu
            ImageManager.PrintCenter("Log", terminalX, terminalX + Width, terminalY);

            // Find the x coordinate of the messages
            int msgX = terminalX + 1;
            // Find the y coordinate for the top most message
            int msgY = terminalY + 1;

            // Print all of the messages
            // A queue that we will use to save the messages so they're not deleted
            Queue messages = new Queue();

            // Print all of the messages
            int numMessages = AscensionGame.DisplayedMessages.Count;

            for (int i = 0; i < numMessages; i++)
            {
                string message = (string)AscensionGame.DisplayedMessages.Dequeue();
                ImageManager.PrintText(msgX, msgY + i, message, null, null, true);
                messages.Enqueue(message);
            }

            AscensionGame.DisplayedMessages = messages;
        }
 /// <summary>
 /// Called from the GUI when the game needs to reload the current scene. Should only occur if the pc is currently at a home base. Forces the text for the current location
 /// to be regenerated, but with no other interactions running. This way, the text can respond to language changes and such, or handle the case where it's switching from
 /// appearance to skills and back to standard text or whatever.
 /// </summary>
 public static void ForceReloadFromGUI()
 {
     GameEngine.ForceReload();
 }
Exemple #53
0
 public TopMenuState(GameEngine engine)
 {
     _engine = engine;
 }
 private void Awake()
 {
     GameEngine = new GameEngine();
 }
Exemple #55
0
 public GameEngineTests()
 {
     this.gameEngine = new GameEngine();
 }
Exemple #56
0
 private void Start()
 {
     bTokens.text = "Tokens: " + GameEngine.GetInstance().bChoosers;
     aTokens.text = "Tokens: " + GameEngine.GetInstance().aChoosers;
     sTokens.text = "Tokens: " + GameEngine.GetInstance().sChoosers;
 }
Exemple #57
0
 /// <summary>
 /// Toggles the Progress mode
 /// </summary>
 public static void ToggleProgressMode()
 {
     AddAction(new Action(GameEngine.GetProgressButton(), 0));
 }
 public override void GiveReward()
 {
     GameEngine.GetInstance().messageQueue.PushMessage("Bonus: Harvester", MessageType.POSITIVE);
     GameEngine.GetInstance().messageQueue.PushMessage(this.achievementName + " Complete", MessageType.POSITIVE);
     GameEngine.GetInstance().AddHarvester();
 }
Exemple #59
0
 /// <summary>
 /// Moves the player and calls each client to update it's game
 /// </summary>
 /// <param name="KeyCode"></param>
 public void KeyPressed(int KeyCode)
 {
     GameEngine.MovePlayer(Context.ConnectionId, KeyCode);
     Clients.All.UpdateGame(_game);
 }
Exemple #60
0
 public MainMenuState(GameEngine engine)
 {
     _engine = engine;
 }