public void setFields(HeartManager hm, Timer timer, ScoreScreen scoreScreen)
 {
     heartManager            = hm;
     timer._abstractGameMode = this;
     this.timer       = timer;
     this.scoreScreen = scoreScreen;
 }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        scoreScreen = GameObject.Find ("ScoreScreen").GetComponent<ScoreScreen> ();

        if (Score == eScore.Green) {
            switch (ScoreScreen.greenLivesSelection) {
            case 0:
                maxLives = 3;
                break;

            case 1:
                maxLives = 5;
                break;
            }
            scoreScreen.greenLives = maxLives;
        } else {
            switch (ScoreScreen.orangeLivesSelection) {
            case 0:
                maxLives = 3;
                break;

            case 1:
                maxLives = 5;
                break;
            }
            scoreScreen.orangeLives = maxLives;
        }

        score = 0;
        lives = maxLives;
        currentMultiplier = 1;
    }
예제 #3
0
    private void FinishScene()
    {
        int PlayerId;

        if (UserPanel.instance.Element != null)
        {
            PlayerId = UserPanel.instance.Element.ID;
        }
        else
        {
            PlayerId = 0;
        }
        Score score = BaseRepository.getAll <Score>().FirstOrDefault(s => s.PlayerId == PlayerId && s.SceneId == this.scene.ID);

        if (score == null)
        {
            score = BaseRepository.add <Score>();
        }
        score.PlayerId  = PlayerId;
        score.Points    = this.Points;
        score.SceneId   = this.scene.ID;
        score.MaxCombo  = this.MaxCombo;
        score.MissCount = this.MissCount;
        score.Ranking   = 0;
        score.TurnCount = this.TurnCount - 1; // The last one does not count ;)
        score.Accuracy  = this.Accuracy;
        score.Speed     = this.Speed;
        ScoreScreen scr = (ScoreScreen)SpeedClickDirector.instance.GetScreen(Screens.ScoreScreen);

        scr.score     = score;
        scr.scene     = this.scene;
        scr.IsNewPlay = true;
        UserPanel.instance.Show();
        SpeedClickDirector.instance.ShowScreen(scr, true);
    }
예제 #4
0
 // Use this for initialization
 void Start()
 {
     score             = 0;
     lives             = maxLives;
     currentMultiplier = 1;
     scoreScreen       = GameObject.Find("ScoreScreen").GetComponent <ScoreScreen> ();
 }
예제 #5
0
 void changeEntry(int Number)
 {
     if (!scoreScreen)
     {
         scoreScreen = GameObject.FindGameObjectWithTag("ScoreScreen").GetComponent <ScoreScreen>();
     }
     scoreScreen.changeEntry(Number);
 }
예제 #6
0
파일: Game1.cs 프로젝트: nsparisi/n3-games
        public void GoToEndScreen()
        {
            //main logic components
            mainGame = new Blob();
            ScoreScreen gameLogic = new ScoreScreen();

            mainGame.AddComponent(gameLogic);
        }
예제 #7
0
파일: Original.cs 프로젝트: kdkoerts/KRYD2
    public Original(Game1 game) : base(game)
    {
        bulletScreen = new BulletScreen(game);
        hitScreen    = new HitScreen(game);
        roundScreen  = new RoundScreen(game);
        scoreScreen  = new ScoreScreen(game);

        AddDucks(1);
    }
예제 #8
0
    public void Load()
    {
        ScoreScreen scr = (ScoreScreen)SpeedClickDirector.instance.GetScreen(Screens.ScoreScreen);

        scr.score     = this.score;
        scr.scene     = this.scene;
        scr.IsNewPlay = false;
        SpeedClickDirector.instance.ShowScreen(scr, true);
    }
예제 #9
0
 private void Start()
 {
     _gameMode3X3 = new GameMode3x3();
     heartManager = GetComponent <HeartManager>();
     timer        = Instantiate(timer);
     scoreScreen  = Instantiate(scoreScreen);
     _gameMode3X3.setFields(heartManager, timer, scoreScreen);
     _gameMode3X3.startGame();
 }
예제 #10
0
 /* Killed by Boundary of Death
  */
 public void fragged(int target)
 {
     if (!scoreScreen)
     {
         scoreScreen = GameObject.FindGameObjectWithTag("ScoreScreen").GetComponent <ScoreScreen>();
     }
     lives [target - 1] = Lives_count;
     networkView.RPC("KillPlayer", RPCMode.All, 0, target);
     scoreScreen.UpdateScoreDB(target);
 }
예제 #11
0
    public void Explode()
    {
        GlobalVariables.Instance.barrelsDestroyed++;
        ScoreUI.instance.setScore(ScoreScreen.calcTot());
        GameObject go = Instantiate(explosion);

        go.transform.position = this.transform.position;
        go.GetComponent <DamageDealer>().Damage = explosionDamage;
        Destroy(this.gameObject);
    }
예제 #12
0
    ///Initialization
    void Start()
    {
        scoreScreen = GameObject.FindGameObjectWithTag("ScoreScreen").GetComponent <ScoreScreen>();
        playerCount = BasicFunctions.amountPlayers;
        players     = new List <playerController>();
        lives       = new List <int>();

        for (int i = 0; i < playerCount; i++)
        {
            lives.Add(Lives_count);
        }
    }
예제 #13
0
 public void setKillTimer(int target)
 {
     if (networkView.isMine)
     {
         if (!scoreScreen)
         {
             scoreScreen = GameObject.FindGameObjectWithTag("ScoreScreen").GetComponent <ScoreScreen>();
         }
         scoreScreen.target   = target;
         scoreScreen.showKill = 2f;
     }
 }
예제 #14
0
 public void setScreenTimer(int shooter)
 {
     if (networkView.isMine)
     {
         if (!scoreScreen)
         {
             scoreScreen = GameObject.FindGameObjectWithTag("ScoreScreen").GetComponent <ScoreScreen>();
         }
         scoreScreen.shooter   = shooter;
         scoreScreen.time2show = time2death;
     }
 }
예제 #15
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);

            // TODO: use this.Content to load your game content here
            textureManager = new TextureManager(this.Content);
            audioManager   = new AudioManager(this.Content);
            scoreManager   = new ScoreManager();

            waterBackground = new Texture2D(graphics.GraphicsDevice, WIDTH, 8 * 52);
            Color[] data = new Color[WIDTH * 8 * 52];
            for (int i = 0; i < data.Length; ++i)
            {
                data[i] = new Color(0, 4, 76);
            }
            waterBackground.SetData(data);

            blackBackground = new Texture2D(graphics.GraphicsDevice, WIDTH, HEIGHT);
            data            = new Color[WIDTH * HEIGHT];
            for (int i = 0; i < data.Length; ++i)
            {
                data[i] = new Color(0, 0, 0);
            }
            blackBackground.SetData(data);

            timeCounter = new Texture2D(graphics.GraphicsDevice, 374, 26);
            data        = new Color[timeCounter.Width * timeCounter.Height];
            timeCounter.SetData(data);

            timeBackground = new Texture2D(graphics.GraphicsDevice, 28 * 7, 26);
            data           = new Color[timeBackground.Width * timeBackground.Height];
            for (int i = 0; i < data.Length; ++i)
            {
                data[i] = new Color(0, 0, 0);
            }
            timeBackground.SetData(data);

            gameOverBackground = new Texture2D(graphics.GraphicsDevice, 28 * 9, 26);
            data = new Color[gameOverBackground.Width * gameOverBackground.Height];
            for (int i = 0; i < data.Length; ++i)
            {
                data[i] = new Color(0, 0, 0);
            }
            gameOverBackground.SetData(data);

            eightBitFont = Content.Load <SpriteFont>("Font/8bit");

            m_MainScreen    = new MainScreen(this.Content, new EventHandler(MainScreenEvent));
            m_GameScreen    = new GameScreen(this.Content, new EventHandler(GameScreenEvent));
            m_ScoreScreen   = new ScoreScreen(this.Content, new EventHandler(ScoreScreenEvent));
            m_CurrentScreen = m_MainScreen;
        }
예제 #16
0
 public void setEndScreenTimer(int winner)
 {
     if (networkView.isMine)
     {
         if (!scoreScreen)
         {
             scoreScreen = GameObject.FindGameObjectWithTag("ScoreScreen").GetComponent <ScoreScreen>();
         }
         //scoreScreen.time2show = 1000f;
         scoreScreen.winner = winner;
         scoreScreen.showScoreScreen();
     }
 }
예제 #17
0
    public void EndGame()
    {
        rb.isKinematic = true;

        _finalDistance = (int)rb.position.x - _startX;
        _finalScore    = _score;

        rb.position = transform.position;
        rb.velocity = Vector2.zero;

        ScoreScreen ss = Instantiate(scoreScreen, Camera.main.transform).GetComponent <ScoreScreen>();

        ss.gameObject.transform.localPosition = new Vector3(0, 0, 1);
        ss.Begin(new int[] { _finalDistance, _finalScore, _max_multiplier, _num_flies, _num_edges });

        // write scores to file
        Logger log = gameObject.GetComponent <Logger>();

        log.printToFile(_finalDistance, _finalScore, _max_multiplier, _num_flies, _num_edges);
    }
예제 #18
0
    private void Update()
    {
        if (goDown)
        {
            if (lava.transform.position.y > orgPos.y)
            {
                lava.transform.position -= new Vector3(0, 1f * Time.deltaTime);
            }
            else
            {
                EventDialogue.Instance.startNext(1);
                goDown = false;
            }
        }

        if (!eventHasStarted)
        {
            return;
        }

        if (lava.transform.position.y < lavaTarget.transform.position.y)
        {
            lava.transform.position += new Vector3(0, 0.5f * Time.deltaTime);
        }
        else
        {
            Destroy(inst.gameObject);
            //lava.transform.position = orgPos;
            if (!isLavaAtTop)
            {
                Timer.Instance.StartTimer("fsfdsfs", 5f, () =>
                {
                    goDown = true;
                    GlobalVariables.Instance.lavaSurvived++;
                    ScoreUI.instance.setScore(ScoreScreen.calcTot());
                });
                eventHasStarted = false;
                isLavaAtTop     = true;
            }
        }
    }
예제 #19
0
        public static void changeScreen(UserControl current, string next)
        {
            //tmp is set to the form that this control is on
            Form tmp = current.FindForm();

            tmp.Controls.Remove(current);
            UserControl ns = null;

            switch (next)
            {
            case "GameScreen":
                ns = new GameScreen();
                break;

            case "InstructionScreen":
                ns = new InstructionScreen();
                break;

            case "MenuScreen":
                ns = new MenuScreen();
                break;

            case "OptionScreen":
                ns = new OptionScreen();
                break;

            case "ScoreScreen":
                ns = new ScoreScreen();
                break;

            case "GameOverScreen":
                ns = new GameOverScreen();
                break;
            }

            ns.Size     = new Size(controlWidth, controlHeight);
            ns.Location = startCentre;
            tmp.Controls.Add(ns);
            ns.Focus();
        }
예제 #20
0
        public static void NextLevel()
        {
            CancellationTokenSource.Cancel();
            Thread.Sleep(100);
            CancellationTokenSource = new CancellationTokenSource();

            if (Level != null)
            {
                Console.Clear();
            }

            GameScreen.SetLevelScreen();

            var nextLevel = (LevelType)Enum.Parse(typeof(LevelType),
                                                  _currentLevel > 9 ?
                                                  "_" + _currentLevel :
                                                  "_0" + _currentLevel);

            IsGameLevelRunning = true;
            Level = new Level(nextLevel);
            Level.Write();
            ScoreScreen.SideScreen(Level.Player1, Level.Type, Level.AITanks);
        }
예제 #21
0
 // Use this for initialization
 void Start()
 {
     score = 0;
     lives = maxLives;
     currentMultiplier = 1;
     scoreScreen = GameObject.Find ("ScoreScreen").GetComponent<ScoreScreen> ();
 }
예제 #22
0
        private void AttachEvents(IEntity entity)
        {
            entity.MoveEvent += () =>
            {
                if (CheckPositionInMatrix(entity.Position))
                {
                    entity.IsHidden = false;
                    var  obstacles = GetObstacles(entity);
                    bool result    = !obstacles.Any() && CheckPositionInMatrix(entity.GetDirectionPosition());
                    foreach (var obstacle in obstacles)
                    {
                        result = entity.ApplyAffection(obstacle);
                        if (!result)
                        {
                            break;
                        }
                    }

                    if (entity is Player)
                    {
                        this._playerPosition = entity.Position;
                    }

                    if (entity is AI)
                    {
                        this.SpawnNextAI();
                    }

                    if (result)
                    {
                        //SetTankPosition(entity);
                    }

                    if (!IsPositionOccupied(entity))
                    {
                        return(false);
                    }

                    return(result);
                }
                else if (entity.EntityType == EntityType.Item)
                {
                    entity.IsDestroyed = true;
                    entity.Position    = this.GetPreviousPosition(entity);
                    if (!entity.IsHidden)
                    {
                        entity.Clear();
                    }
                    this.Layout[entity.Position.X, entity.Position.Y] = new Item(ItemType.Nothing, entity.Position);
                }
                return(false);
            };

            entity.DestroyEvent += () =>
            {
                if (entity is ITank)
                {
                    var tank = entity as ITank;

                    if (tank is AI)
                    {
                        Statistics.DestroyTankPoints(tank.Type);
                    }

                    if (tank.Lives > 0)
                    {
                        if (tank is Player)
                        {
                            this.Spawn(tank);
                        }
                    }
                    else if (Statistics.Player1Points % 50 == 0)
                    {
                        if (tank is AI)
                        {
                            this.SpawnItem(tank);
                        }
                    }

                    ScoreScreen.SideScreen(this.Player1, this.Type, this.AITanks);
                }
                else if (!(entity is Item) || (entity as Item).Type != ItemType.Projectile)
                {
                    this.Layout[entity.Position.X, entity.Position.Y] = new Item(ItemType.Nothing, entity.Position);
                }
                return(true);
            };

            if (entity is AI)
            {
                (entity as AI).AIDownEvent += () =>
                {
                    Entities.Remove(entity);
                    this.AIsSpawned--;
                    SpawnNextAI();
                };
            }
            return;
        }
예제 #23
0
 public void Death()
 {
     GlobalVariables.Instance.aliensDeath++;
     ScoreUI.instance.setScore(ScoreScreen.calcTot());
 }
예제 #24
0
 void Awake()
 {
     SScreen = this;
 }
예제 #25
0
 public static void ScoreScreen()
 {
     ScoreScreen Score = new ScoreScreen();
 }
예제 #26
0
 public void RegisterScoreScreenPanel(ScoreScreen _ss)
 {
     scoreScreenReference = _ss;
 }
예제 #27
0
 // Use this for initialization
 void Start()
 {
     level = GameObject.Find("ScoreScreen");
     number = level.GetComponent<ScoreScreen>();
 }
예제 #28
0
 void Start()
 {
     Application.targetFrameRate = 60;
     scoreScreen = GameObject.Find("Score Screen").GetComponent <ScoreScreen>();
     SavingSystem.InitialSave(scoreScreen);
 }
 // Use this for initialization
 void Start()
 {
     scoreMenu = GetComponent<ScoreScreen>() as ScoreScreen;
 }