public void SpawnGirls() { micrograme = GetComponent <Microgame> (); num = Random.Range(min, max + 1); for (int i = 0; i < num; i++) { float x = Random.Range(minX, maxX); float y = Random.Range(minY, maxY); Vector2 pos = new Vector2(x, y); GameObject PartyGirl = Instantiate(girl, pos, Quaternion.identity); micrograme.OnInstantiateObject(PartyGirl); } int boyNum = Random.Range(boyMin, boyMax + 1); for (int i = 0; i < boyNum; i++) { float x = Random.Range(minX, maxX); float y = Random.Range(minY, maxY); Vector2 pos = new Vector2(x, y); GameObject DistractingBoi = Instantiate(boy, pos, Quaternion.identity); micrograme.OnInstantiateObject(DistractingBoi); } gameStarted = true; }
void shuffleBatches() { for (int i = 0; i < microgamePool.microgameBatches.Length; i++) { Microgame[] pool = microgamePool.microgameBatches[i].pool; int choice; Microgame hold; for (int j = 0; j < pool.Length; j++) { choice = Random.Range(j, pool.Length); if (choice != j) { hold = pool[j]; pool[j] = pool[choice]; pool[choice] = hold; } } } if (revisiting && useAllBossesWhenRevisiting) { var bossMicrogames = MicrogameCollection.instance.BossMicrogames; var randomBossData = bossMicrogames[Random.Range(0, bossMicrogames.Count)]; selectedBossMicrogame = new Microgame(randomBossData.microgameId, microgamePool.bossMicrogame.baseDifficulty); } else { selectedBossMicrogame = microgamePool.bossMicrogame; } }
public override Microgame getMicrogame(int num) { Microgame microgame = new Microgame(microgameId); microgame.microgameId = microgameId; return(microgame); }
public override Microgame getMicrogame(int num) { Microgame microgame = new Microgame(microgameId); microgame.microgameId = !string.IsNullOrEmpty(forceMicrogame) ? forceMicrogame : microgameId; return(microgame); }
// Use this for initialization void Start() { microgame = GetComponent <Microgame>(); // Get Main Camera height and width camHeight = microgame.Camera.orthographicSize * 2f; camWidth = camHeight * Camera.main.aspect; }
// Use this for initialization void Start() { _microgame = GetComponent <Microgame>(); _Man.sprite = _UpPosition; randomizeRange(); _PushupsRemaining = _PushupsRequired + Random.Range(0, _PushupVariance); }
public override Interruption[] getInterruptions(int num) { Microgame microgame = getMicrogame(num); int index = getIndex(num); //Boss over if (!revisiting && bossWon) { return(new Interruption[0].add(wonStage)); } else if (roundsCompleted > 0 && num == roundStartIndex) { //TODO more after-boss stuff if (bossWon) { if (StageController.instance.getLife() < getMaxLife()) { StageController.instance.setLife(StageController.instance.getLife() + 1); return(new Interruption[0].add(oneUp)); } //TODO separate next round after oneUp when we have music } return(new Interruption[0].add(nextRound)); } //Boss Intro if (microgame.microgameId.Equals(microgamePool.bossMicrogame.microgameId)) { if (getMicrogame(num - 1).microgameId.Equals(microgamePool.bossMicrogame.microgameId)) //Not first boss attempt { return(new Interruption[0]); } else { return(new Interruption[0].add(bossIntro)); } } //Speed up check for (int i = 0; i < microgamePool.speedUpTimes.Length; i++) { if (microgamePool.speedUpTimes[i] == index) { return(new Interruption[0].add(speedUp)); } } return(new Interruption[0]); }
int getMicrogameDifficulty(int index) { Microgame microgame = microgamePool[index]; if (!difficultyIncreaseOn) { return(microgame.baseDifficulty); } int difficulty = round + microgame.baseDifficulty - 1; if (difficulty > 3) { difficulty = 3; } return(difficulty); }
public void RegisterMicrogame(Microgame game) { var name = game.gameObject.scene.name; for (int x = 0; x < _LoadingMicrogames.Length; x++) { if (!name.Equals(_LoadingMicrogames[x])) { continue; } Debug.Assert(_LoadedMicrogames[x] == null); _LoadingMicrogames[x] = null; _LoadedMicrogames[x] = game; game.StartMicrogame(_Players[x]); return; } }
public void DeregisterMicrogame(Microgame game, bool won) { for (int x = 0; x < _LoadedMicrogames.Length; x++) { if (_LoadedMicrogames[x] == game) { if (won) { _Players[x].UIAnimator.SetTrigger("win"); } else { _Players[x].UIAnimator.SetTrigger("lose"); } npcs[x] = null; _LoadedMicrogames[x] = null; return; } } }
// Use this for initialization void Start() { _microgame = GetComponent <Microgame>(); _currentDirection = SpriteDirection.right; if (_microgame.Owner.PlayerNumber == PlayerID.One) { _YellowDancingImage.gameObject.SetActive(true); } else { _BlueDancingImage.gameObject.SetActive(true); } _HitsRemaining = _HitsRequired + Random.Range(0, _HitsVariance); // Get Main Camera height and width camHeight = _microgame.Camera.orthographicSize * 2f; camWidth = camHeight * Camera.main.aspect; }
/// <summary> /// Gets microgame difficulty for this specific instance /// </summary> /// <param name="microgame"></param> /// <param name="num"></param> /// <returns></returns> public abstract int getMicrogameDifficulty(Microgame microgame, int num);
bool isSelectedBoss(Microgame microgame) => microgame.microgameId.Equals(selectedBossMicrogame.microgameId);
// Use this for initialization void Start() { micrograme = GetComponent <Microgame> (); }
public override int getMicrogameDifficulty(Microgame microgame, int num) { return(Mathf.Min(roundsCompleted + 1, 3)); }
public override Microgame getMicrogame(int num) { Microgame microgame = microgamePool[num - roundStartIndex]; return(microgame); }
void startMicrogame() { Microgame microgame = microgamePool[getMicrogameIndex()]; microgame.asyncOperation.allowSceneActivation = true; }
public override int getMicrogameDifficulty(Microgame microgame, int num) { return(forceDifficulty < 1 ? ((num % 3) + 1) : forceDifficulty); }
public override int getMicrogameDifficulty(Microgame microgame, int num) { return((num % 3) + 1); }