Exemple #1
0
 void Awake()
 {
     chainMovement = GameObject.Find("SpawnController")
                     .GetComponent <ChainMovement>();
     explosion = GameObject.Find("ExplosionController")
                 .GetComponent <ExplosionController>();
 }
Exemple #2
0
    void Awake()
    {
        chainMovement  = GetComponent <ChainMovement>();
        gameController = GameObject.Find("GameController")
                         .GetComponent <GameController> ();

        villain = GameObject.Find("JamODrum")
                  .GetComponent <VillainController>();

        villain.RegisterMagicStartAction(() => {
            forwardPercentagePerSecond *= 0.02f;
            spawnInterval *= 50f;
        });
        villain.RegisterMagicEndAction(() => {
            forwardPercentagePerSecond *= 50f;
            spawnInterval *= 0.02f;
        });
        gameController.OnGameStart += () => {
            spawnLock = false;
        };
        gameController.OnVillainWin += () => {
            spawnLock = true;
        };
        gameController.OnHeroWin += () => {
            spawnLock = true;
        };
    }
Exemple #3
0
	void Awake () {
		chainMovement = GetComponent<ChainMovement>();
		gameController = GameObject.Find ("GameController")
			.GetComponent<GameController> ();

		villain = GameObject.Find ("JamODrum")
			.GetComponent<VillainController>();
		
		villain.RegisterMagicStartAction (() => {
			forwardPercentagePerSecond *= 0.02f;
			spawnInterval *= 50f;
		});
		villain.RegisterMagicEndAction (() => {
			forwardPercentagePerSecond *= 50f;
			spawnInterval *= 0.02f;
		});
		gameController.OnGameStart += () => {
			spawnLock = false;
		};
		gameController.OnVillainWin += () => {
			spawnLock = true;
		};
		gameController.OnHeroWin += () => {
			spawnLock = true;
		};
	}
Exemple #4
0
        private void Start()
        {
            //Application.targetFrameRate = 30;

            _movement = new ChainMovement(_balls)
            {
                Speed        = _speed,
                Friction     = _friction,
                MaxSpeed     = _maxSpeed,
                SelfFriction = _selfFriction
            };

            _movement.CollisionAccepted += args =>
            {
                var groupCount = GroupCount(args.Id, _balls.Count - 1,
                                            j => j + 1,
                                            (k, i) => _balls[k].Type == _balls[i].Type);
                if (groupCount > 2)
                {
                    RemoveGroup(args.Id, args.Id + groupCount - 1);
                }
            };

            var types = _prototype.GetComponent <BallDecorator>().Types;

            _ballsFactory.SetCount(_ballsCount)
            .SetPrototype(_prototype)
            .SetTypes(types);

            //TODO remove this
            var testobj = _prototype.Clone() as Ball;

            testobj.Move(_prototype.Size * _ballsCount * 3);
            _balls.Add(testobj);
            testobj = _prototype.Clone() as Ball;
            testobj.Move(_prototype.Size * (_ballsCount * 3 + 1));
            _balls.Add(testobj);
            testobj = _prototype.Clone() as Ball;
            testobj.Move(_prototype.Size * (_ballsCount * 3 + 2));
            _balls.Add(testobj);
            testobj = _prototype.Clone() as Ball;
            testobj.Move(_prototype.Size * (_ballsCount * 4));
            testobj.Type = 0;
            _balls.Add(testobj);

            _balls.Reverse();
        }
Exemple #5
0
	void Awake () {
		chainMovement = GameObject.Find ("SpawnController")
			.GetComponent <ChainMovement>();
		explosion = GameObject.Find ("ExplosionController")
			.GetComponent<ExplosionController>();
	}