Ejemplo n.º 1
0
        public override void Start(GameState gameState)
        {
            this.gameState = gameState;

            SpawnPlayer (StartPoint);

            camera = gameState.camera;
            {
                camera.Bounds = new Rectangle(0, 0, Level.Texture.Width, Level.Texture.Height);
                camera.UseBounds = true;
                camera.Scale =  1f;
                camera.CenterOnPoint (StartPoint);
            }

            gameState.cloudManager = new CloudManager (camera.Bounds.Width, camera.Bounds.Height);

            GameObjects.Add (Player);

            var w1 = SpawnWalker (new Vector2(195, 301), Directions.Left, 140f, 135f);
            var w2 = SpawnWalker (new Vector2(304, 533), Directions.Right, 55f, 55f);
            var s1 = SpawnSentry (new Vector2(780, 744), Directions.Left, 1800, gameState, 1.8f);
            var s2 = SpawnSentry (new Vector2(30, 300), Directions.Right, 2000, gameState);

            s1.Invincible = true;
            w1.Speed = 150;
        }
Ejemplo n.º 2
0
        public override void Start(GameState gameState)
        {
            this.gameState = gameState;

            SpawnPlayer (StartPoint);

            camera = gameState.camera;
            {
                camera.Bounds = new Rectangle(0, 0, Level.Texture.Width, Level.Texture.Height);
                camera.UseBounds = true;
                camera.Scale =  1f;
                camera.CenterOnPoint (StartPoint);
            }

            gameState.cloudManager = new CloudManager (camera.Bounds.Width, camera.Bounds.Height);

            GameObjects.Add (Player);

            SpawnWalker (new Vector2(426, 750), Directions.Left, 200f, 150f);
            var w2 = SpawnWalker (new Vector2(150, 539), Directions.Left, 125f, 150f);
            w2.Speed = 150;
            SpawnWalker (new Vector2(605, 539), Directions.Right, 200f, 160f);
            SpawnWalker (new Vector2(593, 357), Directions.Right, 100f, 100f);

            var music = Engine.ContentManager.Load<Song> ("Sound\\Theme");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = 0.4f;
            MediaPlayer.Play (music);
        }
Ejemplo n.º 3
0
        public override void Start(GameState gameState)
        {
            this.gameState = gameState;

            SpawnPlayer (StartPoint);

            camera = gameState.camera;
            {
                camera.Bounds = new Rectangle(0, 0, Level.Texture.Width, Level.Texture.Height);
                camera.UseBounds = true;
                camera.Scale =  1f;
                camera.CenterOnPoint (StartPoint);
            }

            gameState.cloudManager = new CloudManager (camera.Bounds.Width, camera.Bounds.Height);

            GameObjects.Add (Player);

            var w1 = SpawnWalker (new Vector2(396, 647), Directions.Left, 100f, 115f);
            var w2 = SpawnWalker (new Vector2(589, 443), Directions.Right, 100f, 110f);
            var w3 = SpawnWalker (new Vector2(143, 175), Directions.Right, 100f, 100f);
            var s1 = SpawnSentry (new Vector2(41, 365), Directions.Right, 1600, gameState);

            w1.Speed = 150;
        }
 public CharacterMessageEffect(Character character, string message, Action action = null)
     : base(action)
 {
     this.character = character;
     this.gameState = gameState;
     this.message = message;
 }
Ejemplo n.º 5
0
        public void Open(GameState gameState)
        {
            Friend.Spawn (gameState);
            Friend.IsActive = true;
            Friend.Location = this.Location;

            gameState.CurrentLevel.GameObjects.Add (Friend);

            gameState.effectManager.Add ("Chest", new CharacterFadeEffect (this, 1f, 0f, 1f,
                () => this.IsActive = false));

            Opened = true;

            if (OpenedAction != null)
                OpenedAction ();
        }
Ejemplo n.º 6
0
 public abstract void Start(GameState gameState);
Ejemplo n.º 7
0
 public EffectManager(GameState gameState)
 {
     this.Effects = new Dictionary<string, Queue<BaseEffect>>();
     this.CurrentEffects = new Dictionary<string, BaseEffect>();
     this.gameState = gameState;
 }
 public override void Start(GameState gameState)
 {
 }
Ejemplo n.º 9
0
 public void Spawn(GameState gameState)
 {
     //gameState.effectManager.Add ("Friend", new CharacterMessageEffect (this, ThanksMessage));
     gameState.effectManager.Add ("Friend", new CharacterFadeEffect(this, 1f, 0f, 3f,
         () => gameState.CaptureFriend()));
 }
Ejemplo n.º 10
0
 public override void Start(GameState gameState)
 {
     timer = new Timer (waitFinished, null, (int)(delay * 1000), Timeout.Infinite);
 }