Beispiel #1
0
        private void CreateCameraEventsAndBorders(Identity identity)
        {
            //Right side
            List<GameEventCommand> rightBorderEventCommands = new List<GameEventCommand>();
            rightBorderEventCommands.Add(new GameEventCommand("Game", null, "PauseLogic", DynamicArray.ObjectArray(1), 0));
            rightBorderEventCommands.Add(new GameEventCommand("Camera", null, "MoveBy", DynamicArray.ObjectArray(new Vector2(1280.0f, 0), 2000), 0));
            rightBorderEventCommands.Add(new GameEventCommand("Game", null, "ResumeLogic", DynamicArray.ObjectArray(1), 2000));
            GameEvent rightBorderEvent = new GameEvent(rightBorderEventCommands);

            Trigger rightCameraBorder = new Trigger(new Vector2(1330, 400), new Rectangle(0, 0, 50, 2000), "Right Camera Object", GameEventCondition.RightCameraBorderId, identity, this.world, 0, true);

            GameEventCondition rightCameraBorderCondition = new GameEventCondition(GameEventCondition.RightCameraBorderId, rightBorderEvent);
            base.AddEventCondition(rightCameraBorderCondition);

            //Left side
            List<GameEventCommand> leftBorderEventCommands = new List<GameEventCommand>();
            leftBorderEventCommands.Add(new GameEventCommand("Game", null, "PauseLogic", DynamicArray.ObjectArray(1), 0));
            leftBorderEventCommands.Add(new GameEventCommand("Camera", null, "MoveBy", DynamicArray.ObjectArray(new Vector2(-1280.0f, 0), 2000), 0));
            leftBorderEventCommands.Add(new GameEventCommand("Game", null, "ResumeLogic", DynamicArray.ObjectArray(1), 2000));
            GameEvent leftBorderEvent = new GameEvent(leftBorderEventCommands);

            Trigger leftCameraBorder = new Trigger(new Vector2(-50, 400), new Rectangle(0, 0, 50, 2000), "Left Camera Object", GameEventCondition.LeftCameraBorderId, identity, this.world, 0, true);

            GameEventCondition leftCameraBorderCondition = new GameEventCondition(GameEventCondition.LeftCameraBorderId, leftBorderEvent);
            base.AddEventCondition(leftCameraBorderCondition);

            //Unlock Horizontally
            GameEvent unlockCameraHorizontallyEvent = new GameEvent(new GameEventCommand("Camera", null, "UnlockHorizontally", DynamicArray.ObjectArray(50), 0));
            GameEventCondition unlockCameraHorizontallyCondition = new GameEventCondition(GameEventCondition.UnlockCameraHorizontallyId, unlockCameraHorizontallyEvent);
            base.AddEventCondition(unlockCameraHorizontallyCondition);

            //Lock Horizontally
            GameEvent lockCameraHorizontallyEvent = new GameEvent(new GameEventCommand("Camera", null, "LockHorizontally", DynamicArray.ObjectArray(1), 0));
            GameEventCondition lockCameraHorizontallyCondition = new GameEventCondition(GameEventCondition.LockCameraHorizontallyId, lockCameraHorizontallyEvent);
            base.AddEventCondition(lockCameraHorizontallyCondition);

            //Unlock Vertically
            GameEvent unlockCameraVerticallyEvent = new GameEvent(new GameEventCommand("Camera", null, "UnlockVertically", DynamicArray.ObjectArray(50), 0));
            GameEventCondition unlockCameraVerticallyCondition = new GameEventCondition(GameEventCondition.UnlockCameraVerticallyId, unlockCameraVerticallyEvent);
            base.AddEventCondition(unlockCameraVerticallyCondition);

            //Lock Vertically
            GameEvent lockCameraVerticallyEvent = new GameEvent(new GameEventCommand("Camera", null, "LockVertically", DynamicArray.ObjectArray(1), 0));
            GameEventCondition lockCameraVerticallyCondition = new GameEventCondition(GameEventCondition.LockCameraVerticallyId, lockCameraVerticallyEvent);
            base.AddEventCondition(lockCameraVerticallyCondition);

            //Test unlocker
            //CameraObject co = new CameraObject(1280, 2, new Vector2(640, 300), CameraObject.UnlockWhenPlayerMovesRight, "TestCameraObject");
        }
Beispiel #2
0
 public GameEventCondition(int id, GameEvent ev)
 {
     this.id = id;
     this.ev = ev;
     this.fulfilled = false;
 }
Beispiel #3
0
 public GameEventCondition(int id, GameEvent ev)
 {
     this.id        = id;
     this.ev        = ev;
     this.fulfilled = false;
 }