public SpellControl(Spell spell, PlayScreen play)
 {
     InitializeComponent();
     standardBrush = this.Background;
     this.spell    = spell;
     this.play     = play;
 }
        public CustomAttack(Character c, PlayScreen play)
        {
            InitializeComponent();

            List <int> diceSides = new List <int>();

            diceSides.Add(0);
            diceSides.Add(4);
            diceSides.Add(6);
            diceSides.Add(8);
            diceSides.Add(10);
            diceSides.Add(12);
            diceSides.Add(20);

            foreach (int i in diceSides)
            {
                cbDiceSides.Items.Add(i);
                cbDiceSides2.Items.Add(i);
            }

            this.c = c;

            tbDiceAmount.Text  = c.lastDiceAmount.ToString() ?? string.Empty;
            tbDiceAmount2.Text = c.lastDiceAmount2.ToString() ?? string.Empty;
            cbDiceSides.Text   = c.lastDiceSide.ToString() ?? string.Empty;
            cbDiceSides2.Text  = c.lastDiceSide2.ToString() ?? string.Empty;
            tbToHit.Text       = c.lastToHit.ToString() ?? string.Empty;
            tbBonus.Text       = c.lastBonus.ToString();

            log = play.log;
        }
예제 #3
0
 public void ShowLeaderBoardPanel(bool r)
 {
     if (r)
     {
         leaderboardWindow.SetActive(true);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         InfoButton.GetComponent <Button>().interactable           = false;
         SettingsButton.GetComponent <Button>().interactable       = false;
         AccountBtnIcon.GetComponent <Button>().interactable       = false;
         LeaderButton.GetComponent <Button>().interactable         = false;
         PlayScreen.GetComponentInChildren <Button>().interactable = false;
         Camera.GetComponent <CameraController>().enabled          = false;
     }
     else
     {
         leaderboardWindow.SetActive(false);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         InfoButton.GetComponent <Button>().interactable           = true;
         SettingsButton.GetComponent <Button>().interactable       = true;
         PlayScreen.GetComponentInChildren <Button>().interactable = true;
         AccountBtnIcon.GetComponent <Button>().interactable       = true;
         LeaderButton.GetComponent <Button>().interactable         = true;
         Camera.GetComponent <CameraController>().enabled          = true;
     }
 }
        public PrepareSpells(PlayScreen playScreen, Character character)
        {
            InitializeComponent();

            spellPrepIds = new List <int>();
            db           = new DbHandler();
            this.play    = playScreen;
            this.c       = character;

            knownSpells = c.GetKnownSpells();
            SpellPrepControl prep;

            foreach (Spell s in knownSpells)
            {
                s.SetPrepared(false);
                // Not adding cantrips, for they are always prepared.
                if (s.GetLevel() > 0)
                {
                    prep = new SpellPrepControl(s);
                    stackSpells.Children.Add(prep);
                }
            }

            int totalSpells = c.GetModifier(c.GetSpellMod()) + c.GetLevel();

            if (totalSpells < 1)
            {
                totalSpells = 1;
            }

            lbPrep.Content = "Preparable Spells: " + totalSpells;
        }
예제 #5
0
 /// <summary>
 /// Updates the pipe logic.
 /// </summary>
 public void Update()
 {
     if ((long)(DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) - pipeSpawn > waitTime)
     {
         pipeSpawn = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
         int  widthBetween     = FlappyBirdGame.Random.Next(100, 200);
         int  heightOffsetDown = (widthBetween) * -1;
         Pipe downPipe         = new Pipe(PipeDirection.DOWN, new Vector2(0, 0), new Rectangle(288, heightOffsetDown, 55, 321));
         Pipe upPipe           = new Pipe(PipeDirection.UP, new Vector2(0, 0), new Rectangle(288, 265 + (widthBetween / 2), 55, 321));
         GameManager.GetGame().GetEntityManager().AddEntity(downPipe);
         GameManager.GetGame().GetEntityManager().AddEntity(upPipe);
         if (waitTime == 5000L)
         {
             waitTime = 2000L;
         }
         if (current == null)
         {
             current = downPipe;
         }
     }
     if (current != null && current.GetRectangle().X < 35)
     {
         Console.WriteLine(current.GetRectangle().X);
         current = null;
         GameManager.GetGame().GetFlappyBird().IncrementScore();
         PlayScreen playScreen = (PlayScreen)GameManager.GetGame().GetGameScreen();
         playScreen.GetPointSfx().Play();
     }
 }
예제 #6
0
 public void ShowAcountPanel(bool e)
 {
     if (e)
     {
         AcountPanel.SetActive(true);
         AccountButton.SetActive(false);
         InfoButton.SetActive(false);
         SettingsButton.SetActive(false);
         LeaderButton.SetActive(false);
         PlayScreen.SetActive(false);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         Camera.GetComponent <CameraController>().enabled = false;
     }
     else
     {
         AcountPanel.SetActive(false);
         AccountButton.SetActive(true);
         InfoButton.SetActive(true);
         SettingsButton.SetActive(true);
         LeaderButton.SetActive(true);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         PlayScreen.SetActive(true);
         Camera.GetComponent <CameraController>().enabled = true;
     }
 }
예제 #7
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;

            graphics.IsFullScreen = fullscreen;

            screenRectangle = new Rectangle(0, 0, screenWidth, screenHeight);

            Content.RootDirectory = "Content";

            Sounds.loadSounds(Content);

            Components.Add(new InputHandler(this));

            stateManager = new GameStateManager(this);
            Components.Add(stateManager);

            titleScreen = new TitleScreen(this, stateManager);
            playScreen  = new PlayScreen(this, stateManager);
            levelSelect = new LevelSelect(this, stateManager);

            stateManager.ChangeState(titleScreen);
        }
예제 #8
0
 public void ShowConfirm(bool y)
 {
     if (y)
     {
         ConfirmPanel.SetActive(true);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         InfoButton.GetComponent <Button>().interactable           = false;
         SettingsButton.GetComponent <Button>().interactable       = false;
         AccountBtnIcon.GetComponent <Button>().interactable       = false;
         LeaderButton.GetComponent <Button>().interactable         = false;
         PlayScreen.GetComponentInChildren <Button>().interactable = false;
         Camera.GetComponent <CameraController>().enabled          = false;
     }
     else
     {
         ConfirmPanel.SetActive(false);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         InfoButton.GetComponent <Button>().interactable           = true;
         SettingsButton.GetComponent <Button>().interactable       = true;
         PlayScreen.GetComponentInChildren <Button>().interactable = true;
         AccountBtnIcon.GetComponent <Button>().interactable       = true;
         LeaderButton.GetComponent <Button>().interactable         = true;
         Camera.GetComponent <CameraController>().enabled          = true;
     }
 }
예제 #9
0
 public void ShowModesPage(bool y)
 {
     if (y)
     {
         PlayScreen.SetActive(false);
         InfoButton.SetActive(false);
         TextMeshHome.SetActive(false);
         LeaderButton.SetActive(false);
         SettingsButton.SetActive(false);
         AccountBtnIcon.SetActive(false);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         BackToHomeButton.SetActive(true);
         ModesPage.SetActive(true);
     }
     else
     {
         BackToHomeButton.SetActive(false);
         ModesPage.SetActive(false);
         PlayScreen.SetActive(true);
         InfoButton.SetActive(true);
         TextMeshHome.SetActive(true);
         LeaderButton.SetActive(true);
         SettingsButton.SetActive(true);
         AccountBtnIcon.SetActive(true);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
     }
 }
예제 #10
0
 internal void ChangeScreen(PlayScreen playScreens)
 {
     m_GameScreen = playScreens;
     m_GameScreen.Add(this);
     m_IsDying        = false;
     m_BulletsCounter = 0;
 }
예제 #11
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent <Animator>();
     playerMovementsScript = GameObject.Find("Player").GetComponent <PlayerMovement>();
     screenScript          = GameObject.Find("Screen").GetComponent <PlayScreen>();
     persistentDataScript  = GameObject.Find("PersistentData").GetComponent <PersistentData>();
     teleportationStone.setInteractable(false);
 }
예제 #12
0
        public MoneyManager(Character c, PlayScreen play)
        {
            this.c    = c;
            this.play = play;
            setting   = "PLAY";

            Init();
        }
예제 #13
0
        public AddNumber(PlayScreen play, string setting)
        {
            InitializeComponent();
            this.play = play;

            // If healing use "HEAL"
            // If getting damage use "DAMAGE"
            // If casting at higher level, use "SPELL"
            this.setting = setting;
        }
예제 #14
0
 /// <summary>
 /// Constructs a new camera.
 /// </summary>
 /// <param name="game">Game that this camera belongs to.</param>
 /// <param name="position">Initial position of the camera.</param>
 /// <param name="target">Position of the target</param>
 /// <param name="speed">Initial movement speed of the camera.</param>
 public Camera(PlayScreen ps, Vector3 position, Vector3 target, float speed)
 {
     Ps       = ps;
     Position = position;
     Speed    = speed;
     //frustum
     ProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, 4f / 3f, .1f, 10000.0f);
     WorldMatrix      = Matrix.CreateWorld(Vector3.Zero, target - Position, Vector3.Up);
     ViewMatrix       = Matrix.CreateLookAt(Position, target, Vector3.Up);
 }
예제 #15
0
 /// <summary>
 /// Constructs a new DoodleJumpGame  instance.
 /// </summary>
 public FlappyBirdGame()
 {
     Content.RootDirectory = "Content";
     graphics         = new GraphicsDeviceManager(this);
     entityManager    = new EntityManager();
     menuScreen       = new MenuScreen(this);
     playScreen       = new PlayScreen(this);
     highscoreManager = new HighscoreManager();
     Console.WriteLine("Created new Flappy Bird Game");
 }
예제 #16
0
        private static void PlayScreen()
        {
            // clear current childrens
            Global.CurrentScreen.Children.Clear();

            _playScreen          = new PlayScreen(_controller, 110, 25);
            _playScreen.Position = new Point(2, 1);

            // Set our new console as the thing to render and process
            Global.CurrentScreen.Children.Add(_playScreen);
        }
예제 #17
0
        public SpaceInvadersGame()
        {
            Content.RootDirectory = "Content";
            LevelTransitionScreen levelTransitionScreen = new LevelTransitionScreen(this);
            PlayScreen            playScreen            = new PlayScreen(levelTransitionScreen, this);
            ScreensManager        screensManager        = new ScreensManager(this);

            screensManager.Push(new GameOverScreen(playScreen, this));
            screensManager.Push(playScreen);
            screensManager.Push(levelTransitionScreen);
            screensManager.SetCurrentScreen(new WelcomeScreen(this));
            this.IsMouseVisible = true;
        }
예제 #18
0
        public void btnStartGame_Click(object sender, EventArgs e)
        {
            PlayScreen ps = new PlayScreen(_graphics);

            ps.Initialize();
            ps.LoadContent(_content);
            this.ScreenManager.Add(ps);

            /*TestScreen ts = new TestScreen(_graphics);
             * ts.Initialize();
             * ts.LoadContent(_content);
             * this.ScreenManager.Add(ts);*/
        }
예제 #19
0
        public WeaponControl(BattleScribe.Classes.Items.Weapon w, PlayScreen play, Character c)
        {
            InitializeComponent();

            this.play = play;
            this.w    = w;
            this.c    = c;
            this.standardBackground = this.Background;

            lbName.Content = w.GetName();

            string damageDisplay = string.Empty;

            if (w.GetDamage() != "0")
            {
                damageDisplay += w.GetDamage();
            }

            if (w.GetDamage2() != "0")
            {
                damageDisplay += " + " + w.GetDamage2();
            }

            if (w.GetBonusDamage() != 0)
            {
                damageDisplay += " + " + w.GetBonusDamage();
            }

            lbDamage.Content = damageDisplay;
            //lbDamageType.Content = w.GetBaseDamageType();

            mod = w.GetModifier();

            if (mod == "FIN")
            {
                int STR = c.GetModifier("STR");
                int DEX = c.GetModifier("DEX");

                if (STR >= DEX)
                {
                    mod = "STR";
                }
                else
                {
                    mod = "DEX";
                }
            }

            toHit           = c.GetModifier(mod) + c.GetProfiencyBonus();
            lbToHit.Content = "Hit: " + toHit.ToString();
        }
예제 #20
0
        protected override void Initialize()
        {
            TSInputHandler.Initialize();
            //startScreen = new StartScreen(graphics);
            //startScreen.Initialize();

            playScreen = new PlayScreen(graphics);
            playScreen.Initialize();
            screenManager = new TSScreenManager(this);

            //screenManager.Add(startScreen);
            screenManager.Add(playScreen);

            base.Initialize();
        }
        public RollSkillScreen(Character c, PlayScreen play, bool stealthDis)
        {
            InitializeComponent();
            this.c = c;
            SkillControl skill;

            this.p          = play;
            this.stealthDis = stealthDis;

            foreach (string s in c.SkillsList())
            {
                skill = new SkillControl(s, c.GetModifier(s), this);
                skill.lbSkill.Content = s;
                stackSkills.Children.Add(skill);
            }
        }
예제 #22
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            UniversalVariables.spriteBatch = spriteBatch;
            UniversalVariables.content     = Content;
            UniversalVariables.graphics    = graphics;
            ///
            //Remove Content and Graphics references
            ///

            manager = new ScreenManager();
            scrn    = new PlayScreen(manager);
            manager.Add(scrn);
            scrn.IsActive = true;
            manager.Initialize();
            // TODO: use this.Content to load your game content here
            manager.LoadContent();
        }
예제 #23
0
        /// <summary>
        /// Creates a new StaticModel.
        /// </summary>
        /// <param name="model">Graphical representation to use for the entity.</param>
        /// <param name="transform">Base transformation to apply to the model before moving to the entity.</param>
        /// <param name="game">Game to which this component will belong.</param>
        public StaticModel(Model model, Matrix transform, Game game, PlayScreen ps)
            : base(game)
        {
            this.Enabled   = false;
            this.Visible   = false;
            this.model     = model;
            this.Transform = transform;
            this.ps        = ps;

            //Collect any bone transformations in the model itself.
            //The default cube model doesn't have any, but this allows the StaticModel to work with more complicated shapes.
            boneTransforms = new Matrix[model.Bones.Count];
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.EnableDefaultLighting();
                }
            }
        }
예제 #24
0
        public override void InitializeMembers()
        {
            // Defining Variables
            var startScreen = new StartScreen(this);
            var playScreen  = new PlayScreen(this);

            // Defining Properties
            Screens = new GameScreen[]
            {
                startScreen,
                playScreen
            };
            // Initializing Screens
            foreach (var screen in Screens)
            {
                screen.InitializeMembers();
            }
            //
            SetGameScreen <PlayScreen>();
        }
예제 #25
0
        /// <summary>
        /// The update logic of the flappy bird.
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            if (IsDead())
            {
                if (!hitSoundPlayed)
                {
                    hitSoundPlayed = true;
                    PlayScreen playScreen = (PlayScreen)GameManager.GetGame().GetGameScreen();
                    playScreen.GetHitSfx().Play();
                }
                return;
            }
            if (hitPipe)
            {
                if (!hitSoundPlayed)
                {
                    hitSoundPlayed = true;
                    PlayScreen playScreen = (PlayScreen)GameManager.GetGame().GetGameScreen();
                    playScreen.GetHitSfx().Play();
                }
                location.Y += 10;
                return;
            }
            CheckCollision();
            if ((long)(DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) - flapChange > FLAP_SPEED)
            {
                flapChange = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
                flapIndex++;
                if (flapIndex == 3)
                {
                    flapIndex = 0;
                }
            }
            Vector2 l = location;

            physics.Calculate(ref l);
            location    = l;
            rectangle.X = (int)location.X;
            rectangle.Y = (int)location.Y;
        }
예제 #26
0
        /// <summary>
        /// Checks if the flappy bird is dead.
        /// </summary>
        /// <returns></returns>
        public bool IsDead()
        {
            Pipe pipe      = GameManager.GetGame().GetEntityManager().getPipeManager().GetPipe();
            bool abovePipe = location.Y < 0 && (pipe != null && pipe.GetRectangle().X <= GetRectangle().X);

            if (location.Y >= 375 || abovePipe)
            {
                if (abovePipe)
                {
                    hitPipe = true;
                }
                if (!gameOverSoundPlayed)
                {
                    gameOverSoundPlayed = true;
                    PlayScreen playScreen = (PlayScreen)GameManager.GetGame().GetGameScreen();
                    playScreen.GetDieSfx().Play();
                    GameManager.GetGame().GetHighscoreManager().AddScore(score);
                }
                return(true);
            }
            return(false);
        }
예제 #27
0
파일: Engine.cs 프로젝트: Lele/bob_foo
        public Engine()
        {
            graphics     = new GraphicsDeviceManager(this);
            balanceBoard = new Wiimote();
            graphics.PreferredBackBufferHeight = 720;
            graphics.PreferredBackBufferWidth  = 1000;
            graphics.ToggleFullScreen();

            Content.RootDirectory = "Content";
            usingBalanceBoard     = false;
            balanceBoards         = new WiimoteCollection();
            //old
            //level = new PlayScreen(this,balanceBoard);
            level = new PlayScreen(this, balanceBoards);
            //old
            //menu = new Menu(this, balanceBoard);
            menu      = new Menu(this, balanceBoards);
            saveScore = new SaveScore(this);
            this.Components.Add(menu);
            this.Components.Add(saveScore);
            this.Components.Add(level);
            status = 0;
        }
예제 #28
0
 public void InfoPage(bool y)
 {
     if (y)
     {
         PlayScreen.SetActive(false);
         InfoButton.SetActive(false);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         BackToHomeButton.SetActive(true);
         InfoPanel.SetActive(true);
         TextMeshHome.SetActive(false);
     }
     else
     {
         PlayScreen.SetActive(true);
         InfoButton.SetActive(true);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         BackToHomeButton.SetActive(false);
         InfoPanel.SetActive(false);
         TextMeshHome.SetActive(true);
     }
 }
예제 #29
0
        //This event fires when the Controller detect screen is returning control back to the main game class
        public void HomeScreenEvent(object obj, EventArgs e)
        {
            //Switch to the title screen, the Controller detect screen is finished being displayed
            if ((double)obj == Game1.PLAY)
            {
                Game1.MENU_SOUND_INSTANCE.Stop();
                mPlayScreen = new PlayScreen(this.Content, this.GraphicsDevice, new EventHandler(PlayScreenEvent));
                mCurrentScreen = mPlayScreen;
            }
            else if ((double)obj == Game1.ABOUT)
            {
                mCurrentScreen = mAboutScreen;

            }
            else if ((double)obj == Game1.HOW_TO_PLAY)
            {
                mCurrentScreen = mHelpScreen;
            }
            else if ((double)obj == Game1.EXIT)
            {
                this.Exit();
            }
        }
예제 #30
0
 public Ship(Game i_InvadersGame, Vector2 i_Delta, PlayerIndex i_PlayerIndex, PlayScreen i_PlayScreens)
     : this(((IGameManager)i_InvadersGame.Services.GetService(typeof(IGameManager))).GetAssetByPlayerIndex((int)i_PlayerIndex), i_InvadersGame, i_Delta, i_PlayerIndex, i_PlayScreens)
 {
 }
예제 #31
0
 public Ship(string i_AssetName, Game i_InvadersGame, Vector2 i_Delta, PlayerIndex i_PlayerIndex, PlayScreen i_PlayScreens)
     : base(i_AssetName, i_InvadersGame, i_Delta)
 {
     m_TintColor     = Color.White;
     m_ScoreValue    = k_ShipScoreValue;
     r_PlayerIndex   = i_PlayerIndex;
     m_ShootAvailble = true;
     i_PlayScreens.Add(r_ShootingMachine = new ShootingMachine(i_InvadersGame, k_MaxBulletsOnScreen, Enums.eShooter.Ship, k_GunShootAsset));
     GameManager.LoadPlayerControls(i_PlayerIndex, out m_Leftkey, out m_Rightkey, out m_Shootingkey, out m_MouseMode);
 }
 public ScreenOverlayManager(Game game, PlayScreen playscreen)
     : base(game)
 {
     this.playScreen = playscreen;
     // TODO: Construct any child components here
 }