Exemple #1
0
    void Start()
    {
        GameManager.Instance.WorldGenerator = this;

        lastChunkPosX    = -1;
        readyForChunks   = false;
        chunkWidth       = 50;
        chunkHeight      = 14;
        chunkShapes      = new List <BaseChunkShape>();
        biomes           = new List <BaseBiome>();
        chunkGenerator   = new ChunkGenerator();
        coinGenerator    = new CoinGenerator();
        powerupGenerator = new PowerupGenerator();
        enemyGenerator   = new EnemyGenerator();
        worldChunkPrefab = Resources.Load("WorldChunkPrefab");
        platformPrefab   = Resources.Load("Platform_Prefab");
        tilePrefab       = Resources.Load("Tile_Prefab");

        chunkShapes.Add(new FlatShape());
        chunkShapes.Add(new FlatShape2());
        chunkShapes.Add(new PowerupShape1());
        chunkShapes.Add(new GapyShape1());
        chunkShapes.Add(new GapyShape2());
        chunkShapes.Add(new ChrisShape1());

        biomes.Add(new GrassBiome());
        biomes.Add(new CaveBiome());
        biomes.Add(new StormyBiome());
        biomes.Add(new LavaCaveBiome());
        biomes.Add(new WesternBiome());

        GameManager.Instance.ResetGame();
    }
    // Use this for initialization
    void Start()
    {
        bounce_powerup_duration = 0;
        bounce_active           = false;

        //player = GameObject.FindGameObjectWithTag("Player");
        powerup_generator = GameObject.FindGameObjectWithTag("GameController")
                            .GetComponent <PowerupGenerator>();
    }
Exemple #3
0
 void Start()
 {
     player_rb    = GetComponent <Rigidbody>();
     distToGround = GetComponent <Collider>().bounds.extents.z;
     player_rb.collisionDetectionMode = CollisionDetectionMode.Continuous;
     game_timer            = game_controller.GetComponent <GameTimer>();
     powerup_generator     = game_controller.GetComponent <PowerupGenerator>();
     delta_time_multiplier = 1;
 }
Exemple #4
0
    // Use this for initialization
    void Start()
    {
        rPlayer     = GetComponent <Rigidbody>();
        mSpeed      = 0.2f;
        mRateOfFire = 0.2f;
        audioOutput = GetComponent <AudioSource>();
        sPowerUps   = GameObject.FindGameObjectWithTag("Powerup Generator").GetComponent <PowerupGenerator>();
        sOptions    = GameObject.FindGameObjectWithTag("Options").GetComponent <Options>();

        mGunPoweredUp = false;
        mGunTimer     = 5.0f;
        mGunAmmo      = 0;

        mPaused = false;
    }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        //init values
        S = this;
        numInstantiatedSwap = 0;
        numInstantiatedSpeed = 0;
        curSwapLocation = 0;
        turn90 = new Vector3(0,90,0);
        swapGeneration = new Vector3[6];
        instantiatedSwap = new bool[numPowerups];
        instantiatedSpeed = new bool[numPowerups];
        for(int i = 0; i < instantiatedSwap.Length; ++i){
            instantiatedSwap[i] = false;
            instantiatedSpeed[i] = false;
        }
        swapGeneration[0] = new Vector3(162,1.5f,319);
        swapGeneration[1] = new Vector3(121, 1.5f, 241);
        swapGeneration[2] = new Vector3(175, 1.5f, 152);
        swapGeneration[3] = new Vector3(308, 1.5f, 394);
        swapGeneration[4] = new Vector3(308, 1.5f, 455);
        swapGeneration[5] = new Vector3(381, 1.5f, 334);

        foreach (GameObject map in Main.S.MapList)
        {
            foreach (Vector3 newPos in map.GetComponent<Map>().randomPowerupLocations)
            {
                randomGenerations.Add(newPos);
            }
        }
        //end init
        /*
        for (int i = 0; i < numPowerups; ++i){
            //swap powerUps start
            createSwap();
            //swap powerUps end

            //speed powerUps start
            createSpeed();
            //speed powerUps end
        }
        */
        createRandom();
    }