public AdventureProjectile(bool friendly, Master.Directions faceDir, Vector2 location, int deathTimer, int damage)
 {
     this.friendly = friendly;
     this.faceDir = faceDir;
     this.location = location;
     this.deathTimer = deathTimer;
     this.texture = Master.texCollection.texProjectile;
     this.moving = true;
     this.damage = damage;
     //z = 1;
     width = 4;
     height = 4;
 }
예제 #2
0
        public bool isSolid(Vector2 dest, int z, int width, int height, Master.Directions faceDir)
        {
            // Checks for the solidity of a rectangle; width and height are measured from the center of the rectangle

            int i, x, y;

            if ((faceDir == Master.Directions.Up) || (faceDir == Master.Directions.Left))
            {
                x = (int)Math.Floor((dest.X - width) / 32);
                y = (int)Math.Floor((dest.Y - height) / 32);
                i = x + (y * 25);
                if (i >= tileMap.Length || i < 0)
                    return true;
                if (((tileType)key[tileMap[i]] == tileType.Solid) || ((tileType)key[tileMap[i]] == tileType.Lock) || ((tileType)key[tileMap[i]] == tileType.Wood) ||
                    (((tileType)key[tileMap[i]] == tileType.Crevasse) && z == 0))
                    return true;
            }

            if ((faceDir == Master.Directions.Up) || (faceDir == Master.Directions.Right))
            {
                x = (int)Math.Floor((dest.X + width) / 32);
                y = (int)Math.Floor((dest.Y - height) / 32);
                i = x + (y * 25);
                if (i >= tileMap.Length || i < 0)
                    return true;
                if (((tileType)key[tileMap[i]] == tileType.Solid) || ((tileType)key[tileMap[i]] == tileType.Lock) || ((tileType)key[tileMap[i]] == tileType.Wood) ||
                    (((tileType)key[tileMap[i]] == tileType.Crevasse) && z == 0))
                    return true;
            }

            if ((faceDir == Master.Directions.Down) || (faceDir == Master.Directions.Left))
            {
                x = (int)Math.Floor((dest.X - width) / 32);
                y = (int)Math.Floor((dest.Y + height) / 32);
                i = x + (y * 25);
                if (i >= tileMap.Length || i < 0)
                    return true;
                if (((tileType)key[tileMap[i]] == tileType.Solid) || ((tileType)key[tileMap[i]] == tileType.Lock) || ((tileType)key[tileMap[i]] == tileType.Wood) ||
                    (((tileType)key[tileMap[i]] == tileType.Crevasse) && z == 0))
                    return true;
            }

            if ((faceDir == Master.Directions.Down) || (faceDir == Master.Directions.Right))
            {
                x = (int)Math.Floor((dest.X + width) / 32);
                y = (int)Math.Floor((dest.Y + height) / 32);
                i = x + (y * 25);
                if (i >= tileMap.Length || i < 0)
                    return true;
                if (((tileType)key[tileMap[i]] == tileType.Solid) || ((tileType)key[tileMap[i]] == tileType.Lock) || ((tileType)key[tileMap[i]] == tileType.Wood) ||
                    (((tileType)key[tileMap[i]] == tileType.Crevasse) && z == 0))
                    return true;
            }

            return false;
        }
 public static AdventureProjectile getIntangibleProjectile(bool friendly, Master.Directions faceDir, Vector2 location, int deathTimer)
 {
     AdventureProjectile aP = new AdventureProjectile(friendly, faceDir, location, deathTimer, 1);
     aP.intangible = true;
     return aP;
 }
예제 #4
0
 static void Main()
 {
     using (var game = new Master())
         game.Run();
 }
예제 #5
0
 public TitleScreen(Master master)
 {
     this.master = master;
     this.savedGame = master.savedGame;
     if (savedGame == null)
         saveFailed = true;
     PlaySong.Play(PlaySong.SongName.Title);
 }