public Room GetRandomDungeonRoom()
        {
            string filename = "Levels\\dungeon";

            filename += PlatformerMath.Choose("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10") + ".json";
            return((new Room(Engine)).Load(filename));
        }
Beispiel #2
0
        public PreparedMaObject(Room room, Vector2 position) : base(room, position)
        {
            Vector2 viewSize = new Vector2(Room.Engine.Game.GraphicsDevice.Viewport.Width, Room.Engine.Game.GraphicsDevice.Viewport.Height);

            Light       = new Light(viewSize / 2);
            Font        = null;
            Text        = PlatformerMath.Choose("Ready or not, here I come.", "I'm coming.", "Are you ready?", "Are you prepared?", "I hope you're prepared to die.");
            TextOpacity = 0;
            Timer       = MaxTimer;
            Persistent  = true;
            Room.Engine.Assets.RequestFont("fnt_main", (font) =>
            {
                Font = font;
                Text = Text;
            });
            Light = new Light(viewSize / 2);
            Room.Engine.Assets.RequestTexture("lgt_circular", (tex) =>
            {
                Light.Sprite.Change(tex);
                Light.Sprite.Size   = new Vector2(384, 256);
                Light.Sprite.Offset = -Light.Sprite.Size / 2;
                Light.Color         = new Color(255, 102, 102);
            });
            Room.LightList.Add(Light);
        }
Beispiel #3
0
        public override void Use(PlayerObject player)
        {
            MouseState       mouseState = Mouse.GetState();
            float            dir        = (float)Math.Atan2(mouseState.Y - (player.Position.Y + player.Room.ViewPosition.Y), mouseState.X - (player.Position.X + player.Room.ViewPosition.X));
            ProjectileObject proj       = new ProjectileObject(player.Room, player.Position, dir, 8, Damage, "obj_enemy", "obj_boss");

            proj.TimeToLive = 10;
            proj.Sprite.Change(SwipeTexture);
            proj.Sprite.Angle  = dir;
            proj.Sprite.Size   = new Vector2(16, 32);
            proj.Sprite.Origin = proj.Sprite.Size / 2;
            player.Room.GameObjectList.Add(proj);
            player.Room.Sounds.PlaySound(SwipeSounds[PlatformerMath.Choose(0, 1, 2)], 1);
        }
Beispiel #4
0
        public override void Use(PlayerObject player)
        {
            MouseState       mouseState = Mouse.GetState();
            float            dir        = (float)Math.Atan2(mouseState.Y - (player.Position.Y + player.Room.ViewPosition.Y), mouseState.X - (player.Position.X + player.Room.ViewPosition.X));
            ProjectileObject proj       = new ProjectileObject(player.Room, player.Position, dir, 6, Damage, "obj_enemy", "obj_boss");

            proj.TimeToLive = 150;
            proj.Sprite.Change(MagicBallTexture);
            proj.Sprite.Size   = new Vector2(32, 32);
            proj.Sprite.Offset = -proj.Sprite.Size / 2;
            proj.Sprite.Speed  = 0.3f;
            player.Room.GameObjectList.Add(proj);
            player.Room.Sounds.PlaySound(MagicSounds[PlatformerMath.Choose(0, 1)], 1);
        }
Beispiel #5
0
        public override void Load(AssetManager assets)
        {
            assets.RequestTexture(PlatformerMath.Choose("spr_dirt", "spr_dirt2"), (tex) =>
            {
                Sprite.Change(tex);
            });
            bool      left      = Room.CheckTileAt(Position - new Vector2(Sprite.Size.X, 0));
            bool      right     = Room.CheckTileAt(Position + new Vector2(Sprite.Size.X, 0));
            bool      top       = Room.CheckTileAt(Position - new Vector2(0, Sprite.Size.Y));
            bool      bottom    = Room.CheckTileAt(Position + new Vector2(0, Sprite.Size.Y));
            LayerData nextLayer = new LayerData(Sprite.LayerData.Layer + 1); //todo

            if (!bottom)
            {
                GameTile tl = new DirtSideBottomTile(Room, Position);
                tl.Sprite.LayerData = nextLayer;
                Room.GameTileList.Add(tl);
            }
            if (!top)
            {
                GameTile tl = new DirtSideTopTile(Room, Position);
                tl.Sprite.LayerData = nextLayer;
                Room.GameTileList.Add(tl);
            }
            if (!left)
            {
                GameTile tl = new DirtSideLeftTile(Room, Position);
                tl.Sprite.LayerData = nextLayer;
                Room.GameTileList.Add(tl);
            }
            if (!right)
            {
                GameTile tl = new DirtSideRightTile(Room, Position);
                tl.Sprite.LayerData = nextLayer;
                Room.GameTileList.Add(tl);
            }
        }
Beispiel #6
0
 public GameOverObject(Room room, Vector2 position) : base(room, position)
 {
     Font        = null;
     Text        = PlatformerMath.Choose("I don't think you were prepared.", "Back to the hole where you belong.", "Are you even trying?", "Time's up.", "Even SCP-999 would stand a better chance than you.");
     TextOpacity = 0;
 }
Beispiel #7
0
 public GameWinObject(Room room, Vector2 position) : base(room, position)
 {
     Font        = null;
     Text        = PlatformerMath.Choose("Surely you must be cheating?", "I didn't expect that.", "Game over. For me. I guess.");
     TextOpacity = 0;
 }