Ejemplo n.º 1
0
    public void buildBehaviorTree()
    {
        Task[] tasks = new Task[2];

        tasks[0] = new DoorUnlocked(door);
        tasks[1] = new OpenDoor(door);
        Task sequence = new Sequence(tasks);

        tasks    = new Task[2];
        tasks[0] = new DoorClosed(door);
        tasks[1] = new BargeDoor(door);
        Task sequence2 = new Sequence(tasks);

        tasks    = new Task[2];
        tasks[0] = sequence;
        tasks[1] = sequence2;
        Task selector = new Selector(tasks);

        tasks    = new Task[2];
        tasks[0] = new DoorOpen(door);
        tasks[1] = new MoveRoom(this.transform);
        sequence = new Sequence(tasks);

        tasks     = new Task[3];
        tasks[0]  = new MoveDoor(this.transform);
        tasks[1]  = selector;
        tasks[2]  = new MoveRoom(this.transform);
        sequence2 = new Sequence(tasks);

        tasks    = new Task[2];
        tasks[0] = sequence;
        tasks[1] = sequence2;

        task = new Selector(tasks);
    }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            LoadContent();

            DoorBombed.ResetBombedDoors();
            DoorClosed.ResetClosedDoors();
            DoorLocked.ResetLockedfDoors();
            LootManagement.ResetLoot();

            player          = new Link(this);
            player.Position = new Vector2(0, 160);
            LinkSpriteFactory.Instance.player = player;
            if (playerDebug)
            {
                player.Health      = 1000;
                player.TotalHealth = 1000;
                player.ItemCounts[ItemType.Map]++;
                player.ItemCounts[ItemType.Compass]++;
                player.ItemCounts[ItemType.Rupee] = 89;
            }

            player.ItemCounts[ItemType.Rupee] += 10;
            hud       = new HeadsUpDisplay(this, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            screen    = new NormalScreen(this, GraphicsDevice, graphics);
            gameState = new NormalGameState(this);

            this.IsMouseVisible = true;
            base.Initialize();

            currentRoom = new Room1(this, new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2 + 84), floortilebase);
            currentRoom.LoadRoom("RoomC6");
            if (playerDebug)
            {
                currentRoom.LoadRoom("RoomDEBUG");
            }
            roomIndex = Array.FindIndex(rooms, x => x == "RoomC6");

            lightingManager = new LightingManager(this);

            savedPlayer = new Link(this);
            savedRoom   = new Room1(this, new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2 + 84), floortilebase);
            savedScreen = new NormalScreen(this, GraphicsDevice, graphics);

            notificationsQueue = new Queue <INotification>();

            SoundFactory.Instance.musicDungeonLoop.Play();
        }
Ejemplo n.º 3
0
 protected virtual void OnDoorClosed(EventArgs e)
 {
     DoorClosed?.Invoke(this, e);
 }
Ejemplo n.º 4
0
 private void Apply(DoorClosed e)
 {
     AggregateGuid = e.AggregateGuid;
 }
Ejemplo n.º 5
0
 public bool closeDoor()
 {
     DoorClosed?.Invoke(this, EventArgs.Empty);
     return(true);
 }
Ejemplo n.º 6
0
 public void OnDoorClosed()
 {
     DoorClosed?.Invoke(this, EventArgs.Empty);
 }