public HorizontalSpike(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Player player)
            : base(screenManager, position, parentRoom, player)
        {
            collisionOffsetX = 0;
            collisionOffsetY = 0;
            collisionBox.x = (int)position.X + collisionOffsetX;
            collisionBox.y = (int)position.Y + collisionOffsetY;
            collisionBox.width = 32;
            collisionBox.height = 32;
            currentSourceRect = sourceRect;
            countTowardsEnemyCount = false;

            animCount = 1;
            animSpeed = 0.1f;
            isHurtingOnContact = true;
            health = 3;
            maxHealth = 3;
            //invincibleCountdownSpeed = -0.02f;

            if (screenManager.RNG.Next(100) < 50)
                velocity.X = maxSpeed;
            else
                velocity.X = -maxSpeed;

            isHittable = false;
        }
        private void NewScreen()
        {
            var newScreen = new Screen();

            newScreen.Id = 1;
            if (Screens.Any())
            {
                newScreen.Id = Screens.Max(x => x.Id) + 1;
            }

            Screens.Add(newScreen);
            _currentScreen = newScreen;
            var newScreenListItem = new ListBoxItem
            {
                Tag     = newScreen.Id,
                Content = newScreen.Id + " - Screen"
            };

            listScreens.Items.Add(newScreenListItem);
            foreach (ListBoxItem item in listScreens.Items)
            {
                var tag = (int)item.Tag;
                if (tag == newScreen.Id)
                {
                    listScreens.SelectedItem = item;
                }
            }

            LoadSelectedScreen();
            NewOption();
        }
        public override bool Commit()
        {
            var screens = Screens.Where(s => s.IsSelected.Value).Select(s => s.Id).ToArray();

            _profileSettingsService.SetValue(ViewportProfileCategories.Viewports, ViewportSettingKeys.DeviceViewportsDisplays, screens);

            var profiles        = ProfileStorageAdapter.GetAll();
            var selectedProfile = profiles.FirstOrDefault(p => p.Name == _profileSettingsService.SelectedProfileName);

            Guard.RequireIsNotNull(selectedProfile, nameof(selectedProfile));

            switch (selectedProfile.ProfileType)
            {
            case SettingsProfileType.SingleMonitor:
                break;

            case SettingsProfileType.SimPit:
            case SettingsProfileType.Helios:
                if (screens.Length == 1)
                {
                    Controller.Steps.Add(new SelectInitialViewportsWizardStepViewModel(Container));
                }
                break;

            case SettingsProfileType.VirtualReality:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(base.Commit());
        }
Beispiel #4
0
        public static bool ValidateScreen(Screens screens)
        {
            bool          IsValid = true;
            StringBuilder sb      = new StringBuilder();

            if (screens.ScreenID < 0)
            {
                IsValid = false;
                sb.Append(Environment.NewLine + "Invalid Screen ID");
            }
            if (screens.ScreenName == string.Empty)
            {
                IsValid = false;
                sb.Append(Environment.NewLine + "Invalid Screen Name");
            }
            if (screens.GoldSeats < 0)
            {
                IsValid = false;
                sb.Append(Environment.NewLine + "There should be atleast one Gold Seat.");
            }
            if (screens.SilverSeats < 0)
            {
                IsValid = false;
                sb.Append(Environment.NewLine + "There should be atleast one Silver Seat.");
            }
            if (screens.GoldSeats + screens.SilverSeats != 200)
            {
                IsValid = false;
                sb.Append(Environment.NewLine + "Capacity is 200. Assign Gold seats and Silver seats accordingly.");
            }
            return(IsValid);
        }
        public BossProjectile(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Player player, Texture2D spriteSheet)
            : base(screenManager, position, parentRoom, player)
        {
            collisionOffsetX = 0;
            collisionOffsetY = 0;
            collisionBox.x = (int)position.X + collisionOffsetX;
            collisionBox.y = (int)position.Y + collisionOffsetY;
            collisionBox.width = 7 * 2;
            collisionBox.height = 8 * 2;
            currentSourceRect = BossProjectileRect;

            animCount = 2;
            animSpeed = 0.2f;

            velocity = player.Position - position;
            velocity.Normalize();
            velocity *= 2f;

            currentState = State.Attacking;
            attackRect.width = collisionBox.width;
            attackRect.height = collisionBox.height;

            this.spriteSheet = screenManager.SpriteSheet;
            countTowardsEnemyCount = false;
            health = 2;
        }
Beispiel #6
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);

        mScreens = new Canvas[(int)Screens.NumScreens];
        Canvas[] screens = GetComponentsInChildren <Canvas>();
        for (int count = 0; count < screens.Length; ++count)
        {
            for (int slot = 0; slot < mScreens.Length; ++slot)
            {
                if (mScreens[slot] == null && ((Screens)slot).ToString() == screens[count].name)
                {
                    mScreens[slot] = screens[count];
                    break;
                }
            }
        }

        for (int screen = 1; screen < mScreens.Length; ++screen)
        {
            mScreens[screen].enabled = false;
        }

        mCurrentScreen  = Screens.TitleScreen;
        mPreviousScreen = mCurrentScreen;
        mScreens[(int)mCurrentScreen].enabled = true;
    }
Beispiel #7
0
        private static void cMenConnectionPanelScreen_Click(object sender, EventArgs e)
        {
            Screen      screen = null;
            DockContent panel  = null;

            try
            {
                var tagEnumeration = (IEnumerable)((ToolStripMenuItem)sender).Tag;
                if (tagEnumeration == null)
                {
                    return;
                }
                foreach (var obj in tagEnumeration)
                {
                    if (obj is Screen screen1)
                    {
                        screen = screen1;
                    }
                    else if (obj is DockContent)
                    {
                        panel = (DockContent)obj;
                    }
                }

                Screens.SendPanelToScreen(panel, screen);
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddExceptionStackTrace("cMenConnectionPanelScreen_Click: Caught Exception: ",
                                                                ex);
            }
        }
Beispiel #8
0
        public void UnPause()
        {
            isPaused = false;

            //this shoud be previous screen
            Screen = Screens.game;
        }
Beispiel #9
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            MusicManager.Update();

            GameMouse.Update(gameTime);
            Camera.Update(gameTime);

            foreach (BaseScreen screen in ScreensToAdd)
            {
                Screens.Add(screen);
            }

            ScreensToAdd.Clear();

            foreach (BaseScreen screen in Screens)
            {
                // Update before handling input - otherwise if we select something the WhileSelected method will be called straightaway, which is usually undesired
                if (screen.Active)
                {
                    screen.Update(gameTime);
                }
            }

            foreach (BaseScreen screen in ScreensToRemove)
            {
                Screens.Remove(screen);
            }

            ScreensToRemove.Clear();
        }
Beispiel #10
0
        public override void FillEntries()
        {
            var opening = TagType.Opening;

            for (var i = 0; i < Markdown.Length; i += 1)
            {
                if (i + 2 < Markdown.Length &&
                    Markdown[i] == '\\' &&
                    Markdown[i + 1] == '_' &&
                    Markdown[i + 2] == '_')
                {
                    Screens.Add(i);
                    i += 2;
                    continue;
                }
                if (i + 1 >= Markdown.Length || Markdown[i] != '_' || Markdown[i + 1] != '_')
                {
                    continue;
                }
                if (Entries.Count != 0 && Entries.Keys.Max() + 2 == i)
                {
                    Entries.Add(i, opening.Invert());
                    i += 1;
                    continue;
                }
                Entries.Add(i, opening);
                opening = opening.Invert();
                i      += 1;
            }
            if (Entries.Count % 2 != 0)
            {
                Entries.Remove(Entries.Keys.Max());
            }
            CheckForDoubleUnderscoresInsideSingle();
        }
Beispiel #11
0
    public void SetANewScreen(ScreensEnum Screen)
    {
        Screens screens = GetCorrectScreen(Screen);

        if (CurrentScreen == ScreensEnum.GetMoreLives)
        {
            ScreenStack.Push(ScreensEnum.GamePlay);
            PreviousScreen = ScreensEnum.GamePlay;
        }
        else
        {
            if (!screens.CanGoBackFromScreen)
            {
                PreviousScreen = Screen;
                ScreenStack.ClearStack();
            }
            else
            {
                ScreenStack.Push(CurrentScreen);
                PreviousScreen = CurrentScreen;
            }
        }

        ShowScreen(Screen);
    }
Beispiel #12
0
        public override void FillEntries()
        {
            var opening = TagType.Opening;

            for (var i = 0; i < Markdown.Length; i++)
            {
                if (Markdown[i] != '`')
                {
                    continue;
                }
                //check for screened quotes
                if (i >= 1 && Markdown[i - 1] == '\\')
                {
                    Screens.Add(i - 1);
                    continue;
                }
                Entries.Add(i, opening);
                opening = opening.Invert();
            }
            if (Entries.Count % 2 != 0)
            {
                Entries.Remove(Entries.Keys.Max());
            }
            if (!insideTagsScreened)
            {
                ScreenInsideTags();
            }
        }
Beispiel #13
0
        private void ScreenInsideTags()
        {
            var finalString = new StringBuilder(Markdown);

            for (var i = 0; i < Entries.Count; i += 2)
            {
                foreach (var symbol in allSpecialSymbols)
                {
                    var offset  = 0;
                    var regexpr = new Regex($@"(?<!\\|{symbol})({symbol})(?:[\p{{P}}\w\s-[{symbol}]])+?(?<!\\)({symbol})");
                    var results = regexpr.Matches(finalString.ToString(), Entries.ElementAt(i).Key);
                    foreach (var result in results)
                    {
                        var match = result as Match;
                        finalString.Insert(match.Groups[1].Index + offset, "\\");
                        finalString.Insert(match.Groups[2].Index + offset + 1, "\\");
                        offset += 2;
                    }
                }
            }
            Entries.Clear();
            Screens.Clear();
            Markdown           = finalString.ToString();
            insideTagsScreened = true;
            FillEntries();
        }
Beispiel #14
0
        /// <summary>
        /// Gets the screen that contains the specified <paramref name="point"/>,
        /// or the closest screen to the point if it is outside the bounds of all screens.
        /// </summary>
        /// <returns>The screen encompassing or closest the specified point.</returns>
        /// <param name="point">Point to find the screen.</param>
        public static Screen FromPoint(PointF point)
        {
            var screens = Screens.ToArray();

            foreach (var screen in screens)
            {
                if (screen.Bounds.Contains(point))
                {
                    return(screen);
                }
            }

            Screen foundScreen   = null;
            float  foundDistance = float.MaxValue;

            foreach (var screen in screens)
            {
                var diff     = RectangleF.Distance(screen.Bounds, point);
                var distance = (float)Math.Sqrt(diff.Width * diff.Width + diff.Height * diff.Height);
                if (distance < foundDistance)
                {
                    foundScreen   = screen;
                    foundDistance = distance;
                }
            }
            return(foundScreen ?? PrimaryScreen);
        }
Beispiel #15
0
    /*-------------------*/
    // On Initialisation //
    void Awake()
    {
        mScreens = new Canvas[(int)Screens.NumScreens];
        //Identifying screens in the scene.
        Canvas[] screens = GetComponentsInChildren <Canvas>();
        for (int count = 0; count < screens.Length; ++count)
        {
            for (int slot = 0; slot < mScreens.Length; ++slot)
            {
                if (mScreens[slot] == null && ((Screens)slot).ToString() == screens[count].name)
                {
                    mScreens[slot] = screens[count];
                    break;
                }
            }
        }

        //Disabling all the screens except the title screen.
        if (mScreens.Length > 2)
        {
            for (int screen = 1; screen < mScreens.Length; ++screen)
            {
                mScreens [screen].enabled = false;
            }
        }

        //Set the curent screen to the titlescreen.
        mCurrentScreen = Screens.MenuScreen;
    }
Beispiel #16
0
        public MenuScreen(GraphicsDevice graphicsDevice, ContentManager content, ScreenManager screens, InputManager input)
            : base(graphicsDevice, content, screens, input)
        {
            // Load the background texture and coin animation.
            m_background = Content.Load <Texture2D>("Menu/Background");
            m_coinAnim   = new Animation(Content.Load <Texture2D>("Menu/CoinAnim"), (1 / 8f), 8, 1);

            // Load the tank 3D model and set its initial angle of rotation.
            m_tankModel = Content.Load <Model>("Splash/Tank");
            m_tankAngle = 0;

            // Create and load the menu buttons.
            m_startButton  = new Button(Content, "Menu/Buttons/Start", new Vector2(300, 600));
            m_editorButton = new Button(Content, "Menu/Buttons/Editor", new Vector2(500, 600));

            m_helpButton = new Button(Content, "Menu/Buttons/Help", new Vector2(700, 600), () => {
                // Load the help screen.
                Screens.Push(new HelpScreen(this));
            });

            m_exitButton = new Button(Content, "Menu/Buttons/Exit", new Vector2(900, 600), () => {
                // If all screens are removed, the game will exit.
                Screens.Clear();
            });

            // Set screen to be visible.
            m_visible           = true;
            m_backgroundVisible = true;
        }
        public BossArm(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Player player, int level, bool left)
            : base(screenManager, position, parentRoom, player)
        {
            collisionOffsetX = 0;
            collisionOffsetY = 0;
            collisionBox.x = (int)position.X + collisionOffsetX;
            collisionBox.y = (int)position.Y + collisionOffsetY;
            collisionBox.width = 32;
            collisionBox.height = 32;
            currentSourceRect = BossArmSource;
            countTowardsEnemyCount = false;
            if (left)
                currentAnim = 0;
            else
                currentAnim = 1;

            animCount = 2;
            animSpeed = 0f;
            isHittable = false;
            isHurtingOnContact = true;
            health = 3;
            maxHealth = 3;
            maxSpeed = 3f;

            this.level = level;
        }
Beispiel #18
0
 private void TransitionTo(Screens screen)
 {
     mPreviousScreen = mCurrentScreen;
     mScreens[(int)mCurrentScreen].enabled = false;
     mScreens[(int)screen].enabled         = true;
     mCurrentScreen = screen;
 }
Beispiel #19
0
        public override void SetGameScreen <T>()
        {
            var screen = Screens.First(a => a is T);

            Screen = screen;
            Screen.PositionMembers();
        }
        public HealthPickup(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Texture2D spriteSheet)
            : base(screenManager, position, parentRoom, spriteSheet)
        {
            Random rand = new Random();
            if (rand.Next(0, 100) < 25)
                health = 2;

            if (health == 2)
            {
                sourceRect.X = 8 * 16;
                sourceRect.Y = 6 * 16;
            }
            else
            {
                sourceRect.X = 9 * 16;
                sourceRect.Y = 6 * 16;
            }

            sourceRect.Width = 16;
            sourceRect.Height = 16;

            collisionBox.x = (int)position.X;
            collisionBox.y = (int)position.Y;
            collisionBox.width = 32;
            collisionBox.height = 32;
        }
Beispiel #21
0
    /// <summary>
    /// Generic UI changing function for net messages
    /// </summary>
    /// <param name="screen">The UI action to perform</param>
    public void SetScreenFor(Screens screen)
    {
        Logger.Log($"Setting screen for {screen}", Category.UI);
        switch (screen)
        {
        case Screens.SlotReset:
            ResetUI();
            break;

        case Screens.Lobby:
            SetScreenForLobby();
            break;

        case Screens.Game:
            SetScreenForGame();
            break;

        case Screens.PreRound:
            SetScreenForPreRound();
            break;

        case Screens.TeamSelect:
            SetScreenForTeamSelect();
            break;

        case Screens.JobSelect:
            SetScreenForJobSelect();
            break;
        }
    }
Beispiel #22
0
 public void OnTap(List <MouseState> states)
 {
     states.ForEach(s =>
     {
         Screens.OnMouse(s);
     });
 }
        public void Update(GameTime gameTime)
        {
            var screens = Screens.ToArray();

            InputManager.Update();

            foreach (var screen in screens)
            {
                try
                {
                    if (screen.IsVisible)
                    {
                        screen.Update(gameTime);
                    }
                }
                catch (NotImplementedException) { }
            }

            if (Screens.Count == 0)
            {
                mGame.Exit();
                return;
            }

            // We want to make sure that at least the lowest screen in the stack is visible
            // Lowest screen has to be visible
            if (!Screens[Screens.Count - 1].IsVisible)
            {
                Screens[Screens.Count - 1].IsVisible = true;
            }

            mSoundManager.Update(gameTime);
        }
Beispiel #24
0
        public Screen AddScreen(string name, bool useAdvanced, Geometry geometry)
        {
            var screen = new Screen(this, name, useAdvanced, geometry);

            Screens.Add(screen);
            return(screen);
        }
        protected override void setup()
        {
            _locator = MockRepository.GenerateMock <IScreenLocator>();

            // Let's say we have a ScreenCollection with open screens
            otherActiveScreen1 = MockRepository.GenerateMock <IScreen>();
            otherActiveScreen2 = MockRepository.GenerateMock <IScreen>();
            theActiveScreen    = MockRepository.GenerateMock <IScreen>();

            Screens.Active = theActiveScreen;
            Screens.Add(otherActiveScreen1);
            Screens.Add(otherActiveScreen2);
            Screens.Add(theActiveScreen);

            // and the requested ScreenSubject does not match any of the screens
            _locator.Expect(x => x.Matches(otherActiveScreen1)).Return(false);
            _locator.Expect(x => x.Matches(otherActiveScreen2)).Return(false);
            _locator.Expect(x => x.Matches(theActiveScreen)).Return(false);

            factory = MockFor <IScreenFactory>();

            newScreen = MockRepository.GenerateMock <IScreen>();
            _locator.Expect(x => x.CreateScreen(factory)).Return(newScreen);


            TheScreenConductor.OpenScreen(_locator);
        }
Beispiel #26
0
 public ScreenElement(Screens screen)
 {
     this.Screen    = screen;
     Panel          = null;
     TransformData  = new RectTransformData();
     ElementInPanel = -1;
 }
Beispiel #27
0
        public ShellPresenter(IBackingStore backingStore, IWorkspacePresenter workspacePresenter)
        {
            _backingStore = backingStore;

            Screens.Add(workspacePresenter);
            Workspace = workspacePresenter;
        }
Beispiel #28
0
        /// <summary> Получить компонент, отвечающий за открытие/закрытие окна </summary>
        private EnableWindowComponent GetScreenEnableComponent(Screens screen)
        {
            EnableWindowComponent enableComponent = null;

            // Получить компонент, отвечающий за открытие/закрытие окна
            switch (screen)
            {
            case Screens.Loading:
                enableComponent = _loadingScreen.EnableComponent;
                break;

            case Screens.Error:
                enableComponent = _errorScreen.EnableComponent;
                break;

            case Screens.Photos:
                enableComponent = _photosScreen.EnableComponent;
                break;

            case Screens.Welcome:
                enableComponent = _welcomeScreen.EnableComponent;
                break;

            default:
                enableComponent = null;
                break;
            }

            return(enableComponent);
        }
Beispiel #29
0
        //private string[] langChoose = new string[]
        //{
        //        "English",
        //        "Español", // spanish
        //        "Português", // portuguese
        //        "Engelsk", // danish
        //        "Svenska", // swedish
        //        "Bokmål", //Norway
        //        "Français", // french
        //        "Italiano", //Italian
        //        "Català" // calatalan
        //};

        //private int langPointer = 0;


        public OptionsScreen(GameStateManager manager, Screens screenName, string caller)
            : base(manager, screenName)
        {
            _caller = caller;

            BuildControls();
        }
        private void DoTransferSearchNavigation(Screens screen)
        {
            switch (screen)
            {
            case Screens.Login:
                MouseController.PerformButtonClick(ButtonTypes.Login);
                Thread.Sleep(20000);
                break;

            case Screens.Home:
                MouseController.PerformButtonClick(ButtonTypes.TransferNavigate);
                Thread.Sleep(5000);
                break;

            case Screens.TransferHome:
                MouseController.PerformButtonClick(ButtonTypes.SearchTransferMarket);
                Thread.Sleep(5000);
                break;

            case Screens.TransferSearch:
                _continueNavigation = false;
                break;

            case Screens.Inconclusive:
                break;

            case Screens.TransferResults:
                //This should never happen
                throw new InvalidOperationException();

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Beispiel #31
0
    // Start is called before the first frame update
    void Start()
    {
        screen = Screens.NORMAL;

        // StartB = GameObject.Find("Canvas").transform.GetChild(0).gameObject;
        StartB.GetComponent <Button>().onClick.AddListener(() => StartState());

        //  CreditB = GameObject.Find("Canvas").transform.GetChild(1).gameObject;
        CreditB.GetComponent <Button>().onClick.AddListener(() => CreditsState());

        // OptionsB = GameObject.Find("Canvas").transform.GetChild(2).gameObject;
        OptionsB.GetComponent <Button>().onClick.AddListener(() => OptionsState());

        //ExitB = GameObject.Find("Canvas").transform.GetChild(3).gameObject;
        ExitB.GetComponent <Button>().onClick.AddListener(() => ExitState());

        // XB = GameObject.Find("Canvas").transform.GetChild(4).gameObject;
        XB.GetComponent <Button>().onClick.AddListener(() => NormalState());
        XB.SetActive(false);

        forchestopeningbutton.GetComponent <Button>().onClick.AddListener(() => displaychesttext());

        credits.SetActive(false);
        optionstext.SetActive(false);
        here.SetActive(false);
        chest.SetActive(false);
        forchestopeningbutton.SetActive(false);
        afterText.SetActive(false);

        open         = chest.GetComponent <Animator>();
        open.enabled = false;
        //open.cullingMode = AnimatorCullingMode.CullCompletely;
    }
        protected double _timeOfDeath; //time of death

        #endregion Fields

        #region Constructors

        public MortalPhysicalObject(Screens.GameScreen gameScreen, float maxHealth, double animateDeathTime)
            : base(gameScreen)
        {
            _health = maxHealth;
                _maxHealth = maxHealth;
                _animateDeathTime = animateDeathTime;
        }
Beispiel #33
0
        public void Update(GameTime gameTime)
        {
            ScaledResolution.Update();

            var screens = Screens.ToArray();

            if (_doInit)
            {
                _doInit = false;

                foreach (var screen in screens)
                {
                    screen.Init(GuiRenderer, true);
                }
            }

            FocusManager.Update(gameTime);

            foreach (var screen in screens)
            {
                if (!(screen is IGameState) && screen != null)
                {
                    screen.Update(gameTime);
                }
            }

            // DebugHelper.Update(gameTime);
        }
 public Ship(Screens.GameplayScreen gameplayScreen, Vector3 respawnPoint)
     : base(gameplayScreen, 10f, 0d, 8d, respawnPoint)
 {
     //The follow code is to test the weapons
     _frontWeapon = new TestGun(gameplayScreen, this);
     _rightWeapon = new TestGun(gameplayScreen, this);
 }
        private void ActivateScreen(Screens screen)
        {
            currentScreen = screen;

            switch (screen)
            {
            case Screens.FlightList:
                ActivateItem(_container.GetInstance <FlightListViewModel>());
                break;

            case Screens.PlaneSchedule:
                ActivateItem(_container.GetInstance <PlaneScheduleViewModel>());
                break;

            case Screens.CreateTicket:
                ActivateItem(_container.GetInstance <CreateTicketViewModel>());
                break;

            case Screens.Report:
                ActivateItem(_container.GetInstance <ReportViewModel>());
                break;

            case Screens.Setting:
                ActivateItem(_container.GetInstance <SettingViewModel>());
                break;

            case Screens.DashBoard:
            default:
                ActivateItem(_container.GetInstance <DashboardViewModel>());
                break;
            }
            Title         = Titles[screen];
            ButtonTracker = new Thickness(0, 146 + (51 * (int)screen), 0, 571 - (51 * (int)screen));
        }
Beispiel #36
0
        public Boss(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Player player, int level)
            : base(screenManager, position, parentRoom, player)
        {
            collisionOffsetX = 0;
            collisionOffsetY = 0;
            collisionBox.x = (int)position.X + collisionOffsetX;
            collisionBox.y = (int)position.Y + collisionOffsetY;
            collisionBox.width = 32;
            collisionBox.height = 32;
            currentSourceRect = BossBody;

            animCount = 4;
            animSpeed = 0.1f;
            isHurtingOnContact = true;
            health = 6;
            maxHealth = 6;
            maxSpeed = 1.1f;
            //invincibleCountdownSpeed = -0.02f;

            if (screenManager.RNG.Next(100) < 50)
                velocity.X = maxSpeed;
            else
                velocity.X = -maxSpeed;

            this.level = level;

            leftArm = new BossArm(screenManager, position, parentRoom, player, level, true);
            rightArm = new BossArm(screenManager, position, parentRoom, player, level, false);
            parentRoom.addEnemy(leftArm);
            parentRoom.addEnemy(rightArm);
        }
    public void changeScreen(Screens screen)
    {
        currentScreen.SetActive(false);
        switch (screen)
        {
        case Screens.MAIN:
            currentScreen = mainScreen;
            updateTexts();
            checkIdles();
            break;

        case Screens.GAME:
            currentScreen = gameScreen;
            gameCount++;
            break;

        case Screens.END:
            currentScreen = endScreen;
            setEndScreenMoney();
            break;

        case Screens.RETURN:
            currentScreen = returnScreen;
            setReturnScreenMoney();
            break;
        }
        currentScreen.SetActive(true);
    }
    public void GameOverScreen()
    {
        // event muze prijit vicekrat
        if (currentScreen != Screens.gameOver) {
            audio.Play();

            // zamerne bez pause, jen player
            player.disableControls = true;

            touchedUpOnDeath = false;

            currentScreen = Screens.gameOver;

            prefabText.text = "GAME OVER";
            gameOverText = Instantiate (prefabText, new Vector3 (0, -20, 5), Quaternion.Euler (90, 0, 0)) as TextMesh;
            gameOverText.fontSize = 40;

            prefabText.text = "Touch to play again";
            subText = Instantiate(prefabText, new Vector3(0, -20, -5), Quaternion.Euler (90, 0, 0)) as TextMesh;
            subText.fontSize = 20;

            // presun pocitadel doprostred, aby byly videt
            scoreText.transform.position = new Vector3(-15, -20, 0);
            scoreText.fontSize = 250;
            timeText.transform.position = new Vector3(15, -20, 0);
            timeText.fontSize = 250;
        }
    }
Beispiel #39
0
 public Interface(Game game)
     : base(game)
 {
     this.DrawOrder=99;
     currentScreen = Screens.MainMenu;
     lastScreen = Screens.BLANK;
     dm = Game.GraphicsDevice.Adapter.SupportedDisplayModes.ToArray<DisplayMode>();
 }
        public Player(Screens.GameplayScreen gameplayScreen, Vector3 respawnPoint)
        {
            if (this.PlayersShip == null)
                this.PlayersShip = new Ship(gameplayScreen, respawnPoint, gameplayScreen, this);

            //if(this._playersIndex == null)
            //    this._playersIndex = PlayerIndex. next available index. (perhaps, somehow);
        }
        protected Vector3 _rotation; //rotating on each axis.

        #endregion Fields

        #region Constructors

        public VisualObject3D(Screens.GameScreen gameplayScreen)
            : base(MoritoFighterGame.MoritoFighterGameInstance)
        {
            GameScreen = gameplayScreen;

            //for now we will just default to our only camera for all 3D objects.
            ReferenceCamera = MoritoFighterGame.MoritoFighterGameInstance.Camera1;
        }
Beispiel #42
0
 public Item(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Texture2D spriteSheet)
     : base(screenManager)
 {
     this.parentRoom = parentRoom;
     this.spriteSheet = spriteSheet;
     this.position = position;
     spriteRect.width = 32;
     spriteRect.height = 32;
 }
        public RespawnablePhysicalObject(Screens.GameScreen gameScreen, float maxHealth,
                double animateDeathTime, double respawnTime, Vector3 respawnPoint)
            : base(gameScreen, maxHealth, animateDeathTime)
        {
            _respawnTime = respawnTime;
                _respawnPoint = respawnPoint;

                Position = respawnPoint;
        }
        public void showScreen(Screens s)
        {
            Control c = controls[s];

            c.Parent = this;
            c.Dock = DockStyle.Fill;
            c.BringToFront();
            c.Show();
        }
Beispiel #45
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     IsMouseVisible = true;
     currentScreen = Screens.startScreen;
     graphics.PreferredBackBufferWidth = 800;
     graphics.PreferredBackBufferHeight = 450;
     collisionManager = new CollisionManager(400.0f);
 }
        private string _text; // can represent damage, health, or a weapon name

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Constructor for damage 2d
        /// </summary>
        public CombatText(bool isGood, float amount, GameTime gameTime, Vector2 pos, Screens.GameplayScreen screen, Camera cam)
        {
            camRef = cam;
            CombatColor = isGood ? Color.Blue : Color.Red;
            Text = amount.ToString();
            ExpireTime = gameTime.TotalGameTime.Seconds;
            Position = camRef.Relative3Dto2D(pos);
            Font = screen.ScreenManager.Game.Content.Load<SpriteFont>("Fonts\\monofont");
            Origin = new Vector2(0, 0);
        }
 /// <summary>
 /// Constructor for name 2d
 /// </summary>
 public CombatText(string name, GameTime gameTime, Vector2 pos, Screens.GameplayScreen screen, Camera cam)
 {
     camRef = cam;
     CombatColor = Color.Green;
     Text = name;
     ExpireTime = gameTime.TotalGameTime.Seconds;
     Position = camRef.Relative3Dto2D(pos);
     Font = screen.ScreenManager.Game.Content.Load<SpriteFont>("Fonts\\monofont");
     Origin = new Vector2(0, 0);
 }
Beispiel #48
0
        public Player(Game1 game, ShipObject ship, Screens.Levels.Level level)
        {
            _level = level;
            _ship = ship;
            _game = game;

            _power = new PowerbarObject(game, new Vector2(_ship.Cannon.Location.X, _ship.Cannon.Location.Y - 80));

            Bullets = 3;
            Life = 5; 
        }
        public EnemyEntity(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Player player)
            : base(screenManager)
        {
            this.position = position;
            spriteRect.x = 0;
            spriteRect.y = 0;
            spriteRect.width = 32;
            spriteRect.height = 32;

            this.parentRoom = parentRoom;
            this.player = player;
        }
        public RandomEffectItem(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Texture2D spriteSheet)
            : base(screenManager, position, parentRoom, spriteSheet)
        {
            sourceRect.X = 5 * 16;
            sourceRect.Y = 7 * 16;
            sourceRect.Width = 16;
            sourceRect.Height = 16;

            collisionBox.x = (int)position.X;
            collisionBox.y = (int)position.Y;
            collisionBox.width = 32;
            collisionBox.height = 32;
        }
        public Ship(Screens.GameScreen gameScreen, Vector3 respawnPoint, Screens.GameplayScreen gpScreen, Player player)
            : base(gameScreen, 10f, 0d, 8d, respawnPoint)
        {
            // ship should know who owns it
            _owner = player;
            gameplayScreen = gpScreen;

            //The follow code is to test the weapons
            _frontWeapon = new TestGun(gameScreen, this);
            _rightWeapon = new RemoteMineLauncher(gameScreen, this);
            _leftWeapon = new TestGun(gameScreen, this);
            _backWeapon = new TestGun(gameScreen, this);
        }
Beispiel #52
0
        /// <summary>
        /// Changes the current screen.
        /// This is usually registered to an event but can be 
        /// called directly.
        /// </summary>
        /// <param name="screen">The screen you want to load</param>
        public static void ChangeScene(object screen)
        {
            Screens s = (Screens)screen;

              try
              {
            Game1.nextScreen = s;
              }
              catch (Exception e)
              {
            Game1.Trace("Game1 | changeScene: ERROR: ", "" + e.Message);
              }
        }
Beispiel #53
0
        /// <summary>
        /// Changes the current screen.
        /// This is usually registered to an event but can be 
        /// called directly.
        /// </summary>
        /// <param name="screen">The screen you want to load</param>
        public static void ChangeScene(object screen)
        {
            Screens s = (Screens)screen;

              try
              {
            Game1.nextScreen = s;
            Game1.Trace("Game1 | changeScene: ", "Go to " + s.ToString() + " pressed");
              }
              catch (Exception e)
              {
            Game1.Trace("Game1 | changeScene: ERROR: ", "" + e.Message);
              }
        }
 void CameraMove(Screens screen)
 {
     switch (screen)
     {
         case Screens.Title :
             gameObject.transform.localPosition = new Vector3(-20.0f, 0, -10.0f);
             break;
         case Screens.Game:
             gameObject.transform.localPosition = new Vector3(  0.0f, 0, -10.0f);
             break;
         case Screens.Result:
             gameObject.transform.localPosition = new Vector3( 20.0f, 0, -10.0f);
             break;
     }
 }
Beispiel #55
0
        public Pokening()
        {
            Graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            this.Window.Title = "Pokening";

            CurrentScreen = Screens.WorldScreen;

            WorldScreen = new WorldScreen();
            FightingScreen = new FightingScreen();

            // Window size
            this.Graphics.PreferredBackBufferWidth = Properties.WindowWidth;
            this.Graphics.PreferredBackBufferHeight = Properties.WindowHeight;
        }
 void MoveBlackCurtain(Screens screen)
 {
     switch (screen)
     {
         case Screens.Title:
             this.startPoint = new Vector3( 0.0f,  0.0f, 0.0f);
             break;
         case Screens.Game:
             this.startPoint = new Vector3( 0.0f, 15.0f, 0.0f);
             break;
         case Screens.Result:
             this.startPoint = new Vector3(20.0f, 15.0f, 0.0f);
             break;
     }
     this.blackCurtain.transform.localPosition = this.startPoint;
 }
        public Slime(Screens.ScreenManager screenManager, Vector2 position, Map.Room parentRoom, Player player )
            : base(screenManager, position, parentRoom, player)
        {
            collisionOffsetX = 4 * 2;
            collisionOffsetY = 5 * 2;
            collisionBox.x = (int)position.X + collisionOffsetX;
            collisionBox.y = (int)position.Y + collisionOffsetY;
            collisionBox.width = 16;
            collisionBox.height = 12;
            currentSourceRect = SlimeRect;

            animCount = 2;
            animSpeed = 0.02f;
            isHurtingOnContact = true;

            timer = (float)screenManager.RNG.NextDouble();
        }
	public void SetScreen(Screens screen){
		if (screen == Screens.Last) {
			SetScreen(_lastScreen);
		} else {

			_lastScreen = CurrentScreen;
            CurrentScreen = screen;

			MainMenuScreenInst.gameObject.SetActive (screen == Screens.MainMenu);
			TestManagerInst.gameObject.SetActive (screen == Screens.Game);
            BackImage.gameObject.SetActive(screen == Screens.Game);
            TestProgress.Instance.gameObject.SetActive(screen == Screens.Game);
            ConclusionInst.gameObject.SetActive(screen == Screens.End);
            
            BackButt.gameObject.SetActive (screen != Screens.MainMenu && screen != Screens.End);
		}
	}
Beispiel #59
0
        public void changeScreen(Screens screen)
        {
            if (curentScreen != null)
            {
                curentScreen.Dispose();
                curentScreen = null;
            }

            switch (screen)
            {
                case Screens.TEST_SCREEN:
                    curentScreen = new CombatScreen(this);
                    break;
                default:
                    break;
            }
        }
        public void changeToScreen(Screens s)
        {
            if (actualScreen != null)
                actualScreen.UnloadContent();

            switch (s)
            {
                case Screens.FilmList:
                    actualScreen = new FilmList(this);
                    break;
                default:
                    actualScreen = new MainMenu(this);
                    break;
            }

            if (actualScreen != null)
                actualScreen.Initialize();
        }