public Player(MainGame creator, IntVector2 screenCenter, IntVector3 chunkIn, Vector3 posInChunk) { parent = creator; this.screenCenter = screenCenter; Mouse.SetPosition(screenCenter.x, screenCenter.x); chunk = chunkIn; this.posInChunk = posInChunk; emptyDefault = new Items.PlayerFist(); activeItem = emptyDefault; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //TODO: make this run in something besides the *default* game directory //Logger.newLog(LuaBridge.GAME_DIR_DEFAULT + DateTime.Now.ToString("yyyy-MM-dd-hh-mm") + ".log"); Logger.newLog(LuaBridge.GAME_DIR_DEFAULT + "Outpost.log"); //TODO: make this save to a dated log file, without filling the computer with a million log files. MainGame mainGame = new MainGame(this.Content, GraphicsDevice); ScreenManager.screenManager.push(mainGame); LoadingScreen.Display("Starting up"); contentLoader = new System.Threading.Thread(LoadContentInNewThread); contentLoader.Priority = System.Threading.ThreadPriority.Normal; contentLoader.Start(); base.Initialize(); }
/// <summary> /// Creates a game with a new world. /// </summary> /// <param name="c">The content manager to use.</param> /// <param name="g">The graphics device to use.</param> public MainGame(ContentManager c, GraphicsDevice g) { //what is this I don't even /* IAsyncResult result = StorageDevice.BeginShowSelector(null, null); result.AsyncWaitHandle.WaitOne(); StorageDevice harddrive = StorageDevice.EndShowSelector(result); result.AsyncWaitHandle.Close(); result = harddrive.BeginOpenContainer("StorageDemo", null, null); result.AsyncWaitHandle.WaitOne(); cont = harddrive.EndOpenContainer(result); result.AsyncWaitHandle.Close(); cont.CreateDirectory(WorldFolder); //*/ MainGame.mainGame = this; content = c; graphics = g; random = new Random(); fontling = content.Load<SpriteFont>("someFont"); reticule = content.Load<Texture2D>("reticule"); blank = content.Load<Texture2D>("blank"); initializeGraphics(); lua = new LuaBridge(); }