public static void Main() { using (var game = new Game()) { game.Run(60); } }
private static void Main() { Debug.Log("Starting Game."); using (var game = new Game()) { EngineReferences.Game = game; var player = new Entity("Player"); Sprite sprite = new Sprite("Content/Sprites/table.png"); KeyboardController controller = new KeyboardController() { Speed = 15 }; player.AddComponent(sprite); player.AddComponent(controller); player.AddComponent(new RigidBody()); player.Transform.Position = new Vector2(50, 50); player.Transform.Size = new Vector2(100, 100); game.AddEntity(player); game.Run(); } }
public void InputKeyboardTest() { Game game = new Game(); this.game = game; game.Window.Title = "InputKeyboard Test"; InputKeyBoard.KeyEvent += InputKeyBoard_KeyEvent; game.Run(); }
public static void Main(string[] args) { Game game = new Game(); game.Initialize(800, 600, false); game.PushState(new TestState()); game.MaxFPS = 60; game.Display.Zoom = 100; //game.Display.CameraX = game.Display.ViewportWidth / 2; //game.Display.CameraY = game.Display.ViewportHeight / 2; while (!game.Done) { game.Run(); } }
/// <summary> /// Run the main game loop /// </summary> public void MainLoop() { game = new Game(); game.Initialize(1024, 768, false, "HIAGE Map Editor"); game.PushState(new MapEditorState(game, model)); model.ResourceManager = game.Resources; //model.CurrentTileset = model.ResourceManager.GetTileset("grassland"); //while (!game.Done && model.Running) { game.Run(); } Application.Quit(); }
public static void Main(string[] args) { Game game = new Game(); game.Initialize(800, 600, false, "Hiage Mario"); game.MaxFPS = 60; game.Display.Zoom = 150; //Log.OutputStreamWriter = new StreamWriter("log.txt"); PlayerState initialState = new PlayerState(); initialState.HealthStatus = PlayerState.Health.Small; game.PushState(new LevelState(game, initialState, "level1")); //game.PushState(new LevelState(null, game, "minimap")); //game.PushState(new LevelState(null, game, "test_multi")); game.Run(); }
/// <summary> /// Starts a "game round". There has to be 2 teams, and there has to be minimum 2 characters to start a round. /// </summary> private void startMatch_btn_Click(object sender, EventArgs e) { logBox.Clear(); if (CharList.Count > 1) { int teamOne = CharList.First().CharBase.Team; if (CharList.Where(x => x.CharBase.Team != teamOne).ToList().Count > 0) { game = new Game(CharList, sendMessageToLog, cleverSendToMessageLog, rules); game.Run(); } else sendMessageToLog("Error: All characters are on the same team!"); } else sendMessageToLog("Error: Not enough characters loaded!"); }