예제 #1
0
파일: Weapon.cs 프로젝트: timpiper/YASJARG
 /// <summary>
 /// Constructs a new weapon.
 /// </summary>
 /// <param name="owner">The Player that owns this weapon.</param>
 protected Weapon(Player owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     this.owner = owner;
 }
예제 #2
0
        /// <summary>
        /// Constructs a new projectile.
        /// </summary>
        /// <param name="owner">The Player that fired this projectile.</param>
        /// <param name="direction">The initial direction for this projectile.</param>
        protected Projectile(Player owner, Vector2 direction)
            : base()
        {
            // safety-check the parameter
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            // apply the parameters
            this.owner = owner;
            this.velocity = direction; // speed will be applied in the subclass

            // initialize the graphics data
            this.position = owner.Position;
            this.rotation = (float)Math.Acos(Vector2.Dot(Vector2.UnitY, direction));
            if (direction.X > 0f)
            {
                this.rotation *= -1f;
            }
        }
예제 #3
0
        /// <summary>
        /// Constructs a new laser weapon.
        /// </summary>
        /// <param name="owner">The Player that owns this weapon.</param>
        public LaserWeapon(Player owner)
            : base(owner)
        {
            fireDelay = 0.15f;

            // Pick one of the laser sound variations for this instance.
            /*
            switch (RandomMath.Random.Next(3))
            {
                case 0:
                    fireSoundEffect = "fire_laser1";
                    break;
                case 1:
                    fireSoundEffect = "fire_laser2";
                    break;
                case 2:
                    fireSoundEffect = "fire_laser3";
                    break;
            }
            */
        }
예제 #4
0
파일: Level.cs 프로젝트: timpiper/YASJARG
 public void Render(SpriteBatch Sprite, Player Player)
 {
     //Alle Zeilen durchlaufen
     for (int i = 0; i < 32; i++)
     {
         // alle Spalten durchlaufen
         for (int j = 0; j < 64; j++)
         {
             //Die in dem Feld gespeicherte Grafik auf dem Bildschirm Zeichnen
             Sprite.Draw(m_map_textures[m_tilemap[i, j]], new Vector2((20 * j), (20 * i)), Color.White);
         }
     }
 }