Пример #1
0
        public SurvivalArmoryWorld(BloomComponent bloomComponent)
            : base(new Vector2(OGE.HUDCamera.Width + 100, OGE.HUDCamera.Height + 100), bloomComponent)
        {
            viruses = new List<VirusEnemy>();

            DriveData.SetDriveBackdrop(OGE.Random.Next(DriveData.MAX_DRIVE_NUMBER) + 1);
        }
Пример #2
0
        public GameRoot()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            Instance = this;
            //http://msdn.microsoft.com/en-us/library/dd231915%28v=xnagamestudio.31%29.aspx nores on how to load audio engine. had to add xact.dll reference located in programfiles/microsoftxna/.../win/xact.dll
            //http://xboxforums.create.msdn.com/forums/p/102228/608489.aspx how to find other audio devices.

            // Initialize audio objects.
            engine = new AudioEngine(@"Content\Audio\Xact.xgs",TimeSpan.Zero,"{0.0.0.00000000}.{a26fe1c0-9b55-4670-a6fd-76d91685f704}");
            soundBank = new SoundBank(engine, @"Content\Audio\Sound Bank.xsb");
            waveBank = new WaveBank(engine, @"Content\Audio\Wave Bank.xwb");

            //Console.WriteLine("SOUND ENGINE: " + engine.RendererDetails.ToString()); used to determine the redndererID
            //foreach (var r in engine.RendererDetails)
            //{
            //    Console.WriteLine(r.FriendlyName +","+ r.RendererId);
            //}

            graphics.PreferredBackBufferWidth = 1680;//(int)DisplaySize.X-150;
            graphics.PreferredBackBufferHeight = 1050;//(int)DisplaySize.Y -350;

            bloom = new BloomComponent(this);
            Components.Add(bloom);
            bloom.Settings = new BloomSettings(null, .25f, 4, 2, 1, 1.5f, 1);

            IsFixedTimeStep = true;
            //TargetElapsedTime = TimeSpan.FromSeconds(1.0 / 120);
        }
Пример #3
0
        public ManagedSpriteBatch()
            : base(G.Game.GraphicsDevice)
        {
            HasBegun = false;

            DefaultFont = G.Content.Load<SpriteFont>(@"SpriteFonts/Debug");
            bloom = new BloomComponent(this);
        }
Пример #4
0
        public SurvivalGameplayWorld(LevelData levelData, BloomComponent bloomComponent)
            : base(levelData.Dimension, bloomComponent)
        {
            GlobalVariables.LevelScore = 0;
            GlobalVariables.EnableControls = false;

            this.levelData = levelData;
            this.levelEnded = false;
        }
Пример #5
0
        public BloomPostprocessGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            bloom = new BloomComponent(this);

            Components.Add(bloom);
        }
Пример #6
0
        public GameRoot()
        {
            Instance = this;
            _graphics = new GraphicsDeviceManager(this) { PreferredBackBufferWidth = 800, PreferredBackBufferHeight = 600 };
            Content.RootDirectory = "Content";

            _bloom = new BloomComponent(this);
            Components.Add(_bloom);
            _bloom.Settings = new BloomSettings(null, 0.25f, 4, 2, 1, 1.5f, 1);
        }
Пример #7
0
        public MainMenuWorld(BloomComponent bloomComponent)
            : base(new Vector2(OGE.HUDCamera.Width + 100, OGE.HUDCamera.Height + 100), bloomComponent)
        {
            viruses = new List<VirusEnemy>();

            if (!firstRun)
            {
                currentAlpha = 1;
            }
        }
Пример #8
0
        public BloomPostprocessGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            bloom = new BloomComponent(this);

            Components.Add(bloom);
        }
Пример #9
0
        public GameplayWorld(LevelData levelData, BloomComponent bloomComponent)
            : base(levelData.Dimension, bloomComponent)
        {
            HUDEntity.BossMaxHealth = 0;

            GlobalVariables.LevelScore = 0;
            GlobalVariables.EnableControls = false;

            this.levelData = levelData;
            this.levelEnded = false;
            this.failReason = "System Failure";
        }
Пример #10
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            //graphics.IsFullScreen = true;
            graphics.PreferMultiSampling = true;
            graphics.ApplyChanges();
            Content.RootDirectory = "Content";

            bloom = new BloomComponent(this);
            Components.Add(bloom);
            bloom.Settings = new BloomSettings(null, 0.01f, 1, 5, .5f, 2, 1);
        }
Пример #11
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth = (int)OGE.ScreenResolution.X;
            graphics.PreferredBackBufferHeight = (int)OGE.ScreenResolution.Y;
            graphics.IsFullScreen = Properties.Settings.Default.FullScreen;

            graphics.ApplyChanges();

            bloomPostProcess = new BloomComponent(this);
            bloomPostProcess.Settings = BloomSettings.PresetSettings[3];

            this.Window.Title = "Clean'Em Up";
        }
Пример #12
0
        public Game1()
            : base()
        {
            windowRes = new Rectangle(
                0, 0,
                960, 544);

            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content/";

            graphics.PreferredBackBufferWidth = windowRes.Width;
            graphics.PreferredBackBufferHeight = windowRes.Height;
            IsFixedTimeStep = false;

            bloomShader = new BloomComponent(this);
            Components.Add(bloomShader);
            bloomShader.Settings = new BloomSettings(null, 0.25f, 1.25f, 2.6f, 2f, 2.5f, 1f);
        }
Пример #13
0
        public MainMenuEntity(BloomComponent bloomComponent)
        {
            mainMenuButtons = new List<Button>();
            this.bloomComponent = bloomComponent;

            Color color = new Color(150, 255, 130);
            mainMenuButtons.Add(new Button(color,"Start New Scan", new ButtonPressed(NewGame)));
            mainMenuButtons.Add(new Button(color,"Continue Scanning", new ButtonPressed(LoadContent)));
            mainMenuButtons.Add(new Button(color,"Stop Scanning", new ButtonPressed(ExitGame)));

            for (int i = 0; i < mainMenuButtons.Count; i++)
            {
                mainMenuButtons[i].Position.X = OGE.HUDCamera.Width / 2;
                mainMenuButtons[i].Position.Y = OGE.HUDCamera.Height - (mainMenuButtons.Count - i) * 70 - 50;
            }

            saveExists = GlobalVariables.SaveExists();
        }
Пример #14
0
        /// <summary>
        /// Creates a bunch of stuff (such as the biome library, primitive library etc.) which won't change
        /// from game to game.
        /// </summary>
        public void InitializeStaticData(string companyName, string companyMotto, NamedImageFrame companyLogo, Color companyColor)
        {
            CompositeLibrary.Initialize();
            CraftLibrary = new CraftLibrary();

            if (SoundManager.Content == null)
            {
                SoundManager.Content = Content;
                SoundManager.LoadDefaultSounds();
                SoundManager.SetActiveSongs(ContentPaths.Music.dwarfcorp, ContentPaths.Music.dwarfcorp_2, ContentPaths.Music.dwarfcorp_3, ContentPaths.Music.dwarfcorp_4);
            }
            new PrimitiveLibrary(GraphicsDevice, Content);
            InstanceManager = new InstanceManager();

            EntityFactory.InstanceManager = InstanceManager;
            InstanceManager.CreateStatics(Content);

            Color[] white = new Color[1];
            white[0] = Color.White;
            pixel = new Texture2D(GraphicsDevice, 1, 1);
            pixel.SetData(white);

            Tilesheet = TextureManager.GetTexture(ContentPaths.Terrain.terrain_tiles);
            AspectRatio = GraphicsDevice.Viewport.AspectRatio;
            DefaultShader = Content.Load<Effect>(ContentPaths.Shaders.TexturedShaders);
            DefaultShader.Parameters["xFogStart"].SetValue(40.0f);
            DefaultShader.Parameters["xFogEnd"].SetValue(80.0f);

            VoxelLibrary = new VoxelLibrary();
            VoxelLibrary.InitializeDefaultLibrary(GraphicsDevice, Tilesheet);

            bloom = new BloomComponent(Game)
            {
                Settings = BloomSettings.PresetSettings[5]
            };
            bloom.Initialize();

            fxaa = new FXAA();
            fxaa.Initialize();

            SoundManager.Content = Content;
            PlanService.Restart();

            ComponentManager = new ComponentManager(this, companyName, companyMotto, companyLogo, companyColor);
            ComponentManager.RootComponent = new Body("root", null, Matrix.Identity, Vector3.Zero, Vector3.Zero, false);
            Vector3 origin = new Vector3(WorldOrigin.X, 0, WorldOrigin.Y);
            Vector3 extents = new Vector3(1500, 1500, 1500);
            ComponentManager.CollisionManager = new CollisionManager(new BoundingBox(origin - extents, origin + extents));

            Alliance.Relationships = Alliance.InitializeRelationships();

            JobLibrary.Initialize();
            MonsterSpawner = new MonsterSpawner();
            EntityFactory.Initialize();
        }
Пример #15
0
        public Shorewood()
        {
            graphics = new GraphicsDeviceManager(this);
            threadPool = new ThreadPoolComponent(this);
            inputHandler = new InputHandler(this);
            inputHandler.AddEvent(Buttons.Back, new EventHandler<ButtonFireEventArgs>(OnPause));
            inputHandler.AddEvent(Buttons.Start, new EventHandler<ButtonFireEventArgs>(OnPause));
            storageScreen = new StorageScreen(this);

            foundWordAnimator = new FoundWordAnimationRenderer(this);
            constantBackground = new ConstantBackground(this);
            fluidSolver = new FluidSolverComponent(this);
            scoreBox = new ScoreBox(this);
            particleSystem = new UniversalParticleSystem(this);
            constantBackground.Enabled = false;
            constantBackground.Visible = false;

            foundWordAnimator.Enabled = false;
            foundWordAnimator.Visible = false;
            graphics.PreferredBackBufferWidth = PlatformDisplaySettings.width;
            graphics.PreferredBackBufferHeight = PlatformDisplaySettings.height;
            fluidSolver.Differences = new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            IsFixedTimeStep = false;

            Shorewood.Content = base.Content;
            Content.RootDirectory = "Content";
            scale = graphics.PreferredBackBufferHeight / 1000.0f;
            soundTrack = new SoundTrack(this);
            ninthPlanetGames = new NinthPlanetGames.SplashScreen(this);

            ninthPlanetGames.Visible = true;
            ninthPlanetGames.Enabled = true;

            bloom = new BloomComponent(this);

            loadingPosition = (new Vector2(PlatformDisplaySettings.width / 2, PlatformDisplaySettings.height / 2));
            graphics.PreparingDeviceSettings += OnPreparingDeviceSettings;
            ShorewoodPool.InitalizePools();
            physicsEngine = new PhysicsSimulator(new Vector2(0, 100));

            #if XBOX
            services = new GamerServicesComponent(this);
            Components.Add(services);
            #endif

            Components.Add(threadPool);
            storage = new StorageHandler();
            Components.Add(inputHandler);
            Components.Add(storage.sharedSaveDevice);
            Components.Add(soundTrack);
            Components.Add(fluidSolver);
            Components.Add(ninthPlanetGames);
            avatar2DAnimation = new Avatar2DAnimation(this);
            Components.Add(avatar2DAnimation);
            //Components.Add(ietGames);
        }
Пример #16
0
 public ReviewWorld(BloomComponent bloomComponent)
     : base(new Vector2(OGE.HUDCamera.Width + 100, OGE.HUDCamera.Height + 100), bloomComponent)
 {
     viruses = new List<VirusEnemy>();
 }
Пример #17
0
        public MainGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            IsMouseVisible = true;

            graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();

            //Gets the user's screen width and height, also creates the game fullscreen.
            scale = new Vector2((float)GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / optimalWidth, (float)GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / optimalHeight);

            spaceLocOne = new Vector2(-810 * scale.X, -810 * scale.Y);
            spaceLocTwo = new Vector2(-810 * scale.X, -810 * scale.Y);

            quadTree = new QuadTree(1, new Point(0, 0), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            bloom = new BloomComponent(this);
            Components.Add(bloom);
            bloom.Settings = new BloomSettings(null, 0.15f, 3, 1.20f, 1, 1.5f, 1);

            //Calculates the spawn point dimensions
            spawnPointsSizeX = (graphics.PreferredBackBufferWidth / 36) - 1;
            spawnPointsSizeY = (graphics.PreferredBackBufferHeight / 36) - 4;

            //Initializes the spawn points
            spawnPoints = new Vector2[spawnPointsSizeX, spawnPointsSizeY];
            for (int i = 0; i < spawnPointsSizeX; i++)
            {
                for (int j = 0; j < spawnPointsSizeY; j++)
                {
                    spawnPoints[i, j] = new Vector2(36 + i * 36, 136 + j * 36);
                }
            }
        }
Пример #18
0
 /// <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: Add your initialization logic here
     bloom = new BloomComponent(this);
     Components.Add(bloom);
     //bloom.Settings = new BloomSettings(null, 0.25f, 4, 2, 1, 1.5f, 1);
     bloom.Settings = new BloomSettings(null, 0.0f, 4, 3, 1, 1.5f, 1);
     base.Initialize();
 }
Пример #19
0
 public VirusNotifierWorld(Dictionary<Type, EnemyData> newViruses, BloomComponent bloomComponent)
     : base(new Vector2(OGE.HUDCamera.Width + 100, OGE.HUDCamera.Height + 100), bloomComponent)
 {
     this.viruses = new List<VirusEnemy>();
     this.newViruses = newViruses;
 }