Example #1
0
    public void draw(gameFlow flow)
    {
        int[] scoreDigits = ToIntArr(score);
        int[] bestDigits  = ToIntArr(bestScore);

        if (flow == gameFlow.gameOver)
        {
            for (int i = 0; i < scoreDigits.Length; i++)
            {
                sb.Draw(digits, new Vector2(xPosScore[scoreDigits.Length - i], yPos), new Rectangle((digits.Width / 10) * scoreDigits[scoreDigits.Length - 1 - i], 0, digits.Width / 10, digits.Height), Color.White);
            }

            for (int i = 0; i < bestDigits.Length; i++)
            {
                sb.Draw(digits, new Vector2(xPosBest[bestDigits.Length - i], yPos), new Rectangle((digits.Width / 10) * bestDigits[bestDigits.Length - 1 - i], 0, digits.Width / 10, digits.Height), Color.White);
            }
        }
        else
        {
            for (int i = 0; i < scoreDigits.Length; i++)
            {
                sb.Draw(digits, new Vector2(xPosScore[scoreDigits.Length - i] - 694, 0), new Rectangle((digits.Width / 10) * scoreDigits[scoreDigits.Length - 1 - i], 0, digits.Width / 10, digits.Height), Color.White);
            }
        }
    }
Example #2
0
 protected override void Initialize()
 {
     base.Initialize();
     flow = gameFlow.startMenu;
     graphics.PreferredBackBufferWidth  = Global.winWidth;
     graphics.PreferredBackBufferHeight = Global.winHeight;
     graphics.ApplyChanges();
     Window.Title = "Desert Eagle";
     InputHandler.update();
 }
Example #3
0
 protected override void Initialize()
 {
     base.Initialize();
     flow = gameFlow.gameOn;
     graphics.PreferredBackBufferWidth  = Global.winWidth;
     graphics.PreferredBackBufferHeight = Global.winHeight;
     graphics.ApplyChanges();
     Window.Title = "Desert Eagle";
     GeneticAlgorithm.Initiate();
     GeneticAlgorithm.CreateFirstGen();
     InitBirds();
     InputHandler.update();
 }
Example #4
0
 protected override void Initialize()
 {
     base.Initialize();
     neatManager = new Manager();
     neatManager.Start();
     Global.game = this;
     flow        = gameFlow.gameOn;
     graphics.PreferredBackBufferWidth  = Global.winWidth;
     graphics.PreferredBackBufferHeight = Global.winHeight;
     graphics.ApplyChanges();
     Window.Title = "Desert Eagle";
     InputHandler.update();
 }
Example #5
0
    void OnBecameInvisible()
    {
        if (lost == false)
        {
            gf = GameObject.Find("scriptCarrier").GetComponent <gameFlow> ();

            if (this.transform.position.x < gf.camera.transform.position.x)
            {
                gf.defeat();
            }
            else if (this.transform.position.x > gf.camera.transform.position.x)
            {
                this.transform.position = new Vector3(this.transform.position.x - 0.1f, this.transform.position.y, this.transform.position.z);
            }
            lost = true;
        }
    }
Example #6
0
 public static void setGame(gameFlow f)
 {
     DesertEagle.flow = f;
 }