예제 #1
0
        private void addNewMinigame(JObject projectIdResult, MINIGAME_TYPE type, String title, String description)
        {
            Minigame mg = new Minigame(projectIdResult, type, title, description);

            if(!minigameDictionary.Keys.Contains(type))
            {
                minigameDictionary[type] = new List<Minigame>();
            }

            minigameDictionary[type].Add(mg);
        }
예제 #2
0
        public CarStopper(Minigame game)
        {
            state = GAME_STATE.Intro;
            minigame = game;
            introTitle = minigame.getTitle();
            introDescription = minigame.getDescription();

            setupLabels();

            mainCanvas.Children.Add(introTitleLabel);
            mainCanvas.Children.Add(introDescriptionLabel);
            mainCanvas.Children.Add(instructionLabel);
            mainCanvas.Children.Add(exitLabel);

            this.transitionTimer = new System.Windows.Threading.DispatcherTimer();
            this.transitionTimer.Tick += moveToNextState;
            this.transitionTimer.Interval = TimeSpan.FromMilliseconds(2000);
            this.transitionTimer.Start();

            this.fadeTimer = new System.Windows.Threading.DispatcherTimer();
            this.fadeTimer.Tick += fadeToNextState;
            this.fadeTimer.Interval = TimeSpan.FromMilliseconds(40);
            this.fadeTimer.IsEnabled = false;

            this.carTimer = new System.Windows.Threading.DispatcherTimer();
            this.carTimer.Tick += moveCar;
            this.carTimer.Interval = TimeSpan.FromMilliseconds(20);

            rightHandCursor = new System.Windows.Controls.Image();
            rightHandCursor.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.HandCursor);
            rightHandCursor.Width = 100;

            leftHandCursor = new System.Windows.Controls.Image();
            System.Drawing.Bitmap leftHandBitmap = ShoopDoup.Properties.Resources.HandCursor;
            leftHandBitmap.RotateFlip(RotateFlipType.RotateNoneFlipX);
            leftHandCursor.Source = this.toBitmapImage(leftHandBitmap);
            leftHandCursor.Width = 100;

            rightHandCursor.Opacity = 0;
            leftHandCursor.Opacity = 0;

            carBitmaps = new List<Bitmap>();
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperBus);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperCar);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperTruck);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperMotorcycle);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperSUV);

            mainCanvas.Children.Add(rightHandCursor);
            mainCanvas.Children.Add(leftHandCursor);
        }
예제 #3
0
        public WhackAMoleController(Minigame game)
        {
            state = GAME_STATE.Intro;
            minigame = game;
            introTitle = minigame.getTitle();
            introDescription = minigame.getDescription();

            setupLabels();

            mainCanvas.Children.Add(introTitleLabel);
            mainCanvas.Children.Add(introDescriptionLabel);
            mainCanvas.Children.Add(instructionLabel);

            this.transitionTimer = new System.Windows.Threading.DispatcherTimer();
            this.transitionTimer.Tick += moveToNextState;
            this.transitionTimer.Interval = TimeSpan.FromMilliseconds(2000);
            this.transitionTimer.Start();

            this.fadeTimer = new System.Windows.Threading.DispatcherTimer();
            this.fadeTimer.Tick += fadeToNextState;
            this.fadeTimer.Interval = TimeSpan.FromMilliseconds(40);
            this.fadeTimer.IsEnabled = false;

            this.popupTimer = new System.Windows.Threading.DispatcherTimer();
            this.popupTimer.Tick += changePopup;
            this.popupTimer.Interval = TimeSpan.FromMilliseconds(2500);

            rightHandCursor = new System.Windows.Controls.Image();
            rightHandCursor.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.HandCursor);
            rightHandCursor.Width = 100;

            leftHandCursor = new System.Windows.Controls.Image();
            System.Drawing.Bitmap leftHandBitmap = ShoopDoup.Properties.Resources.HandCursor;
            leftHandBitmap.RotateFlip(RotateFlipType.RotateNoneFlipX);
            leftHandCursor.Source = this.toBitmapImage(leftHandBitmap);
            leftHandCursor.Width = 100;

            rightHandCursor.Opacity = 0;
            leftHandCursor.Opacity = 0;

            mainCanvas.Children.Add(rightHandCursor);
            mainCanvas.Children.Add(leftHandCursor);
        }
예제 #4
0
        public CarStopperController(Minigame game)
        {
            state = GAME_STATE.Instructions;
            minigame = game;
            introTitle = minigame.getTitle();
            introDescription = minigame.getDescription();
            this.sp = new System.Media.SoundPlayer(ShoopDoup.Properties.Resources.carexplosion);

            carDictionary = new Dictionary<String, Car>();

            Console.WriteLine(minigame.getData().Count);
            int randomElementIndex = randomGen.Next(minigame.getData().Count);
            baseItem = (String)minigame.getData().ElementAt(randomElementIndex).getElementValue();
            minigame.getData().RemoveAt(randomElementIndex);

            setupLabels();

            //mainCanvas.Children.Add(introTitleLabel);
            //mainCanvas.Children.Add(introDescriptionLabel);
            mainCanvas.Children.Add(instructionLabel);
            mainCanvas.Children.Add(exitLabel);
            mainCanvas.Children.Add(scoreLabel);
            mainCanvas.Children.Add(baseLabel);

            this.transitionTimer = new System.Windows.Threading.DispatcherTimer();
            this.transitionTimer.Tick += moveToNextState;
            this.transitionTimer.Interval = TimeSpan.FromMilliseconds(3000);

            this.fadeTimer = new System.Windows.Threading.DispatcherTimer();
            this.fadeTimer.Tick += fadeToNextState;
            this.fadeTimer.Interval = TimeSpan.FromMilliseconds(40);
            this.fadeTimer.IsEnabled = false;

            this.carTimer = new System.Windows.Threading.DispatcherTimer();
            this.carTimer.Tick += moveCars;
            this.carTimer.Interval = TimeSpan.FromMilliseconds(20);

            this.exitTimer = new System.Windows.Threading.DispatcherTimer();
            this.exitTimer.Tick += controllerFinished;
            this.exitTimer.Interval = TimeSpan.FromMilliseconds(10000);

            this.userExitedTimer = new System.Windows.Threading.DispatcherTimer();
            this.userExitedTimer.Tick += controllerFinished;
            this.userExitedTimer.Interval = TimeSpan.FromMilliseconds(2000);

            this.introCarTimer = new System.Windows.Threading.DispatcherTimer();
            this.introCarTimer.Tick += addNewInstructionCar;
            this.introCarTimer.Interval = TimeSpan.FromMilliseconds(2600);

            this.introCarAnimatorTimer = new System.Windows.Threading.DispatcherTimer();
            this.introCarAnimatorTimer.Tick += moveCars;
            this.introCarAnimatorTimer.Interval = TimeSpan.FromMilliseconds(20);

            this.addNewCarTimer = new System.Windows.Threading.DispatcherTimer();
            this.addNewCarTimer.Tick += addNewCar;
            this.addNewCarTimer.Interval = TimeSpan.FromMilliseconds(4000);

            rightHandCursor = new System.Windows.Controls.Image();
            rightHandCursor.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.BlueHandCursor);
            rightHandCursor.Width = 100;

            leftHandCursor = new System.Windows.Controls.Image();
            System.Drawing.Bitmap leftHandBitmap = ShoopDoup.Properties.Resources.BlueHandCursor;
            leftHandBitmap.RotateFlip(RotateFlipType.RotateNoneFlipX);
            leftHandCursor.Source = this.toBitmapImage(leftHandBitmap);
            leftHandCursor.Width = 100;

            trafficBackgroundImage = new System.Windows.Controls.Image();
            trafficBackgroundImage.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.TrafficLaneBackGround);
            trafficBackgroundImage.Width = 1280;
            trafficBackgroundImage.Height = 800;
            trafficBackgroundImage.Opacity = .8;

            qrCode = new System.Windows.Controls.Image();
            qrCode.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.qr);
            qrCode.Height = 248;
            qrCode.Width = 248;

            baseLabelBox = new System.Windows.Controls.Image();
            baseLabelBox.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.blueText);

            scoreBox = new System.Windows.Controls.Image();
            scoreBox.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.TwoDigitBlue);
            scoreBox.Height = 100;
            scoreBox.Width = 200;

            ShoopDoupSpeakingImage = new System.Windows.Controls.Image();
            ShoopDoupSpeakingImage.Source = this.toBitmapImage(ShoopDoup.Properties.Resources.ThinkingUpgame);
            ShoopDoupSpeakingImage.Width = 1280;
            ShoopDoupSpeakingImage.Height = 800;
            ShoopDoupSpeakingImage.Opacity = 0;

            rightHandCursor.Opacity = 0;
            leftHandCursor.Opacity = 0;

            carBitmaps = new List<Bitmap>();
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperBus);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperCar);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperTruck);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperMotorcycle);
            carBitmaps.Add(ShoopDoup.Properties.Resources.CarStopperSUV);

            mainCanvas.Children.Add(rightHandCursor);
            mainCanvas.Children.Add(leftHandCursor);
            mainCanvas.Children.Add(trafficBackgroundImage);
            mainCanvas.Children.Add(scoreBox);

            Canvas.SetZIndex(rightHandCursor, 4);
            Canvas.SetZIndex(leftHandCursor, 4);
            Canvas.SetLeft(trafficBackgroundImage, 0);
            Canvas.SetTop(trafficBackgroundImage, 0);
            Canvas.SetZIndex(trafficBackgroundImage, -5);

            Canvas.SetZIndex(scoreBox, -1);
            Canvas.SetLeft(scoreBox, 40);
            Canvas.SetTop(scoreBox, 8);

            runIntro();
        }
예제 #5
0
 public PopTheBubblesController(Minigame game)
 {
     this.minigame = game;
     this.instructionBubbles = new List<Bubble>();
     this.selectedBubbles = new List<Boolean>();
     this.sp = new System.Media.SoundPlayer(ShoopDoup.Properties.Resources.bobblepopwav);
     state = GAME_STATE.Instruction;
     StartInstructionTimer();
     bubbles = new List<Bubble>();
     LoadScore();
     LoadBackground();
     LoadCursors();
     SetAssociateLabel();
     SetTimerLabel();
 }
예제 #6
0
 public NetGameController(Minigame game)
     : base()
 {
     this.minigame = game;
     start();
 }