public EnemyGenerator(GeomCloneLevel setLevel, float setTimeOutTime, float setWaitingTime)
            : base(setLevel.Game)
        {
            timeOutTime = setTimeOutTime;
            waitingTime = setWaitingTime;

            currentLevel = setLevel;
            entityManager = currentLevel.EntityManager;
        }
Esempio n. 2
0
        public GeomCloneLevel(GeomCloneGame setGame)
            : base(setGame)
        {
            Input.SetActionOnTriggered(Microsoft.Xna.Framework.Input.Keys.P, delegate(GameTime time) { setGame.ChangeLevel(new GamePause(game)); });
            player = new Player(this, "smallRect");
            player.SetMovementControl(Input);
            entityManager = new EntityManager(setGame, player);

            targetSize = new Vector2(
                GraphicsDevice.Viewport.Width,
                GraphicsDevice.Viewport.Height
                );

            blur = game.Content.Load<Effect>("Blur");
            blur.Parameters["TargetSize"].SetValue(targetSize);
            blur.Parameters["GlowScalar"].SetValue(intensity);
            blur.Parameters["numPixel"].SetValue(30);
            //blur.Parameters["Intensity"].SetValue(hue);

            //Input.SetActionOnPressed(Keys.PageUp, delegate(GameTime t) { intensity += 0.01f; blur.Parameters["GlowScalar"].SetValue(intensity); });
            //Input.SetActionOnPressed(Keys.PageDown, delegate(GameTime t) { intensity -= 0.01f; blur.Parameters["GlowScalar"].SetValue(intensity); });

            //Input.SetActionOnPressed(Keys.Z, delegate(GameTime t) { hue += 0.01f; blur.Parameters["Intensity"].SetValue(hue); });
            //Input.SetActionOnPressed(Keys.X, delegate(GameTime t) { hue -= 0.01f; blur.Parameters["Intensity"].SetValue(hue); });

            target1 = new RenderTarget2D(
                GraphicsDevice,
                (int)targetSize.X,
                (int)targetSize.Y,
                0,
                SurfaceFormat.Color
            );

            target2 = new RenderTarget2D(
                GraphicsDevice,
                (int)targetSize.X,
                (int)targetSize.Y,
                0,
                SurfaceFormat.Color
            );

            fps = new FPSCounter(game, "GeomCloneFont");

            state = LevelState.PlayerAlive;

            borders = new Line2D[4];
            borders[0] = new Line2D(setGame, new Vector2(0.5f, 0.0f), 0.0f, 2.5f, 1600.0f, Color.White);
            borders[1] = new Line2D(setGame, new Vector2(0.5f, 1.0f), 0.0f, 2.5f, 1600.0f, Color.White);
            borders[2] = new Line2D(setGame, new Vector2(0.0f, 0.5f), 90.0f, 2.5f, 1280.0f, Color.White);
            borders[3] = new Line2D(setGame, new Vector2(1.0f, 0.5f), 90.0f, 2.5f, 1280.0f, Color.White);
        }