Пример #1
0
 // Update is called once per frame
 void Start()
 {
     gc = GameObject.Find("GameController").GetComponent <GameControl>();
     //  Debug.Log("gc.name");
     pl           = GameObject.Find("Plane").GetComponent <scrollingBackground>(); //Debug.Log("1");
     rbo          = GetComponent <Rigidbody>();
     rbo.velocity = new Vector3(0, 0, pl.scrollSpeed);
 }
Пример #2
0
    //   private float timeSinceLastFlag = 0f;

    void Start()
    {
        if (plane == null)
        {
            plane = (scrollingBackground)Instantiate(this);
        }

        gc          = GameObject.Find("GameController").GetComponent <GameControl>();
        rb          = GetComponent <Rigidbody>();
        rb.velocity = new Vector3(0, 0, scrollSpeed);
        //velocity = rb.velocity.z;
    }
Пример #3
0
        public Stage1(ContentManager content, GraphicsDevice graphics, EnemyList enemies)
        // In general, the initial data needed for the stage to function will be loaded in the constructor.

        {
            activeEnemyList = new List <Enemy>();
            activeFoodList  = new List <Food>();
            this.enemies    = enemies;
            scrollingBackground testBG = new scrollingBackground();

            testBG.Load(graphics, content.Load <Texture2D>("BG\\bg_plain"), content.Load <Texture2D>("BG\\bg_mountain"), content.Load <Texture2D>("BG\\bg_volcano_1"));
            stageBG   = testBG;
            stageTime = new TimeSpan();
            paused    = false;
        }