コード例 #1
0
 /// <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)
     {
     }
 }
コード例 #2
0
ファイル: Terrain.cs プロジェクト: slstrozier/Wormz
        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
        }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
 /// <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();
 }
コード例 #6
0
 /// <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)
 {
 }
コード例 #7
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)
 {
 }
コード例 #8
0
ファイル: Player.cs プロジェクト: slstrozier/Wormz
 /// <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;
 }
コード例 #9
0
 /// <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)
 {
 }
コード例 #10
0
 /// <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)
 {
 }
コード例 #11
0
 /// <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)
 {
 }
コード例 #12
0
 /// <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)
 {
 }
コード例 #13
0
ファイル: Hud.cs プロジェクト: slstrozier/Wormz
 /// <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;
 }
コード例 #14
0
ファイル: ExplosionState.cs プロジェクト: slstrozier/Wormz
 /// <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();
 }
コード例 #15
0
ファイル: KeyboardHandler.cs プロジェクト: slstrozier/Wormz
        /// <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));
        }