/// <summary>
 /// Determines what occurs when a projectile collides with something.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void collide(wormz toUse)
 {
     toUse.startExplosion();
     toUse.disposeOfRocket();
     try
     {
         SoundManager.PlayRocketExplosion();
         //TODO: Move this to where ever the rocket's animation will be handled.
     }
     catch (Exception e)
     {
     }
 }
Exemple #2
0
        public Terrain(Game game, SpriteBatch batch)
            : base(game)
        {
            spriteBatch = batch;
            randomizer = new Random();
            this.game = (wormz) game;

            sceneryDeterminer1 = randomizer.NextDouble() + 1;
            sceneryDeterminer2 = randomizer.NextDouble() + 2;
            sceneryDeterminer3 = randomizer.NextDouble() + 3;

            GenerateScenery(); //necessary to generate the terrain to place players on
        }
 /// <summary>
 /// Determines the game logic to use when increasing
 /// the power of the player's weapon.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void increasePower(wormz toUse, int amount)
 {
     toUse.increasePlayerPower(amount);
 }
 /// <summary>
 /// Determines what game logic to use when increasing
 /// the angle of the player's weapon slightly.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void increaseAngle(wormz toUse)
 {
     toUse.increasePlayerAngle(0.01f);
 }
 /// <summary>
 /// Determines what occurs when a weapon is fired.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void fireWeapon(wormz toUse)
 {
     toUse.pauseForFlight();
     toUse.launchRocket();
 }
 /// <summary>
 /// Determines what occurs when a projectile collides with something.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void collide(wormz toUse)
 {
 }
 /// <summary>
 /// Determines what occures when the game changes players.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void changePlayer(wormz toUse)
 {
 }
Exemple #8
0
 /// <summary>
 /// Creates a new player.
 /// </summary>
 /// <param name="game">The game this player will be participating in</param>
 /// <param name="batch">the Sprite Batch that will be drawing this class.</param>
 public Player(Game game, SpriteBatch batch)
     : base(game)
 {
     this.scorch = (wormz) game;
     spriteBatch = batch;
 }
 /// <summary>
 /// Determines the game logic to use when increasing
 /// the power of the player's weapon.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void increasePower(wormz toUse, int amount)
 {
 }
 /// <summary>
 /// Determines what game logic to use when increasing
 /// the angle of the player's weapon slightly.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void increaseAngle(wormz toUse)
 {
 }
 /// <summary>
 /// Determines what occurs when a weapon is fired.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void fireWeapon(wormz toUse)
 {
 }
 /// <summary>
 /// Determines the game logic to use when decreasing
 /// the angle of the player's weapon slightly.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void decreaseAngle(wormz toUse)
 {
 }
Exemple #13
0
 /// <summary>
 /// Creates a new hud
 /// </summary>
 /// <param name="game">The game this hud will be placed on.</param>
 public Hud(Game game)
     : base(game)
 {
     this.wormz = (wormz) game;
 }
Exemple #14
0
 /// <summary>
 /// Determines what occures when the game changes players.
 /// </summary>
 /// <param name="toUse">The game to reference for game logic.</param>
 public void changePlayer(wormz toUse)
 {
     toUse.allowPlayerMovement();
     toUse.changeCurrentPlayer();
 }
Exemple #15
0
        /// <summary>
        /// Maps the keys of the game.
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            wormz = ((wormz) Game);
            keyMap = new Dictionary<Keys, KeyboardCommand>();
            //increase the power.
            keyMap.Add(Keys.Up, new KeyboardCommand(doUp));
            //decrease the power.
            keyMap.Add(Keys.Down, new KeyboardCommand(doDown));
            //increase the power by 20.
            keyMap.Add(Keys.PageUp, new KeyboardCommand(doPageUp));
            //decrease the power by 20.
            keyMap.Add(Keys.PageDown, new KeyboardCommand(doPageDown));
            //rotate the cannon to the left.
            keyMap.Add(Keys.Left, new KeyboardCommand(doLeft));
            //rotate the cannon to the right.
            keyMap.Add(Keys.Right, new KeyboardCommand(doRight));
            //fire current weapon.
            keyMap.Add(Keys.Space, new KeyboardCommand(doSpace));
        }