コード例 #1
0
ファイル: Game1.cs プロジェクト: Dankerprouduct/SpaceGame
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            GUIManager.Init();
            GUIManager.LoadContent(Content);

            debugFont = Content.Load <SpriteFont>("Font/Debug");
            pixel     = Content.Load <Texture2D>("GUI/Pixel");

            planet = new Universe.Planet(Universe.Planet.PlanetClass.ClassA);
            planet.LoadContent(Content);
            system1 = new Universe.SolarSystem(8, 50000);
            system1.LoadContent(Content);
            ship = new Ship(Vector2.Zero);
            ship.LoadContent(Content);

            Point spawnPoint = planet.planetMap.Rooms[random.Next(0, planet.planetMap.Rooms.Count)].Center;

            player = new Entity.Player(0, new Vector2(spawnPoint.X * 128, spawnPoint.Y * 128));
            player.LoadContent(Content);
            planet.CompileEntityLua();
            Console.WriteLine("Spawned player at " + player.position + " " + player.cellIndex);
            luaDebug = new Utilities.LuaDebug();

            planet.cellSpacePartition.ClearCell(planet.cellSpacePartition.PositionToIndex(
                                                    new Vector2(spawnPoint.X * 128, spawnPoint.Y * 128)));
        }