public IEnumerator OnUpdate() { yield return(new WaitForSeconds(3)); DataDump.Set("LocalPetGrowthStage", 0); bool isFinished = false; ScreenFader.FadeInThen(() => { //Juicer.ShakeCamera(0.5f); //MessageController.AddMessage("yo."); //MessageController.AddMessage("this is game peanutbutters."); //MessageController.AddMessage("it goes great with game jams."); //MessageController.AddMessage("you may have noticed the camera and music change. very easy to do with cinemachine and the juicer.", postAction: () => //{ // GameConductor.CameraStateTrigger("NextState"); //}); //MessageController.AddMessage("these bois are moving with the simplemover script. it's an easy way to get some nice motion with little effort. useful for pickups, simple enemies, etc.", postAction: () => //{ // GameConductor.CameraStateTrigger("NextState"); //}); //MessageController.AddMessage("this is a fun script called textjacker. it jacks up text.", postAction: () => //{ // GameConductor.CameraStateTrigger("NextState"); //}); //MessageController.AddMessage("after this message finishes, the game will transition to the next game state. a basic player object will be created."); GameConductor.CameraStateTrigger("NextState"); isFinished = true; }); do { yield return(new WaitForSeconds(1)); } while (!isFinished); }
public IEnumerator OnUpdate() { GameConductor.ResetPlayer(); GameConductor.UnfreezePlayer(); GameConductor.PerformScheduleCallbacks(11, 0); _daycard.SetActive(true); _daycard.GetComponentInChildren <Text>().text = DataDump.Get <string>("Day") + " evening"; yield return(new WaitForSeconds(4)); _daycard.SetActive(false); bool isFinished = false; ScreenFader.FadeInThen(() => { GameConductor.FreezePlayer(); MessageController.AddMessage("Hmm. Haven't seen you around before.", postAction: () => GameConductor.CameraStateTrigger("NextState")); MessageController.AddMessage("Welcome to The Deja Brew."); MessageController.AddMessage("... oh? You need a place to stay?"); MessageController.AddMessage("We got a room in the back when you're ready to hit the hay."); MessageController.AddMessage("Literally -- it's all we got.", postAction: () => { GameConductor.CameraStateTrigger("FocusPlayer"); GameConductor.UnfreezePlayer(); isFinished = true; }); MessageController.AddMessage("Enjoy the band and meet some of the regulars. We usually get a few characters in here."); }); do { yield return(new WaitForSeconds(1)); } while (!isFinished); }
public static void AdvanceDay() { string nextDay = _days.Dequeue(); DataDump.Set("Day", nextDay); _days.Enqueue(nextDay); }
/// <summary> /// just the top type /// </summary> /// <returns></returns> public PetType CalculatePetType() { int berries = DataDump.Get <int>("LocalPetBerriesEaten"); int cookies = DataDump.Get <int>("LocalPetCookiesEaten"); int fish = DataDump.Get <int>("LocalPetFishEaten"); return(new[] {
public IState Update() { if (progression == 0 || progression == 2) { timer -= Time.deltaTime; } if (progression == 0 && timer < 0) { progression++; dockingShip = GameObject.Instantiate(dockingShip, sd.transform.position + spawnerOffset + Vector3.up * -5, Quaternion.identity); } if (progression == 1 && DataDump.GetInt("PlayerDocked") > 0) { DialogueQueue.AddMessage("Well done!"); DialogueQueue.AddMessage("This was an entry to Ludum Dare 39: Running out of Power, created by Zak Reynolds in 48 hours."); DialogueQueue.AddMessage("Thanks for playing!"); progression++; timer = 15; var st = GameObject.FindWithTag("MainCamera").GetComponent <SmoothTrack>(); st.target = dockingShip.transform; st.smoothTime = 0.5f; st.positionOffset = new Vector3(13, 5, -45); } if (progression == 2) { if (timer < 0) { // TODO: End progression++; DialogueQueue.AddMessage("END GAME\nESC to quit\nBACKSPACE to restart", 20); return(this); } } return(this); }
private void SetTime() { string minutePrefix = niceMinute < 10 ? "0" : ""; DataDump.Set("Time", $"{niceHour}:{minutePrefix}{niceMinute}"); GameConductor.PerformScheduleCallbacks(niceHour, niceMinute); }
public void Feed(int type) { CloseFoodMenu(); Juicer.Instance.PlayEatSFX(); int foodLeft = DataDump.Get <int>(((FoodType)type).ToString()) - 1; DataDump.Set <int>(((FoodType)type).ToString(), foodLeft); string dataName = $"LocalPet{((FoodType)type).ToString()}Eaten"; int petEaten = DataDump.Get <int>(dataName) + 1; DataDump.Set(dataName, petEaten); int fullness = DataDump.Get <int>("LocalPetFullness") + 1; DataDump.Set("LocalPetFullness", fullness); if (fullness > FullnessDeath) { // go to the die StartCoroutine(Die()); return; } if (fullness > FullnessTolerance) { // play sick animation } }
private static void Main() { var command = Menu.HelpCommand; while (!string.IsNullOrEmpty(command) && !command.Equals(Menu.ExitCommand)) { switch (command) { case Menu.HelpCommand: Console.WriteLine(Menu.MenuPrint); break; case Menu.StartUdpCommand: UdpStarter.Start(); break; case Menu.StopUdpCommand: _dataDump = UdpStarter.Stop(); break; case Menu.SaveDataDumpCommand: FileHelper.SaveToFile(_dataDump, Settings.FileDataDumpName); break; case Menu.LoadDataDumpCommand: _dataDump = FileHelper.GetFromFile <DataDump>(Settings.FileDataDumpName); break; } command = Console.ReadLine(); } }
public void CalculateTimes(string name) { List <object> values = new List <object>(); values.Add(name); DataDump.Initialize(); calculateTimes(values); }
public UdpStarter(int port) { _port = port; _dataDump = new DataDump { Data = new Dictionary <DateTime, Price>() }; }
private IEnumerator Sprout() { Juicer.ShakeCamera(1); yield return(new WaitForSeconds(2)); DataDump.Set("LocalPetGrowthStage", 5); Juicer.ShakeCamera(3); }
public List <CalendarEntry> GetCalendarEntriesByMonth(int month) { var dataDump = new DataDump(); List <CalendarEntry> calendarEntries = dataDump.GetDataDump(); var calendarEntriesToDisplay = calendarEntries.Where(c => c.Date.Month == month).Select(d => d).ToList(); return(calendarEntriesToDisplay); }
private IEnumerator Rebirth() { Juicer.ShakeCamera(1); yield return(new WaitForSeconds(2)); DataDump.Set("LocalPetGrowthStage", 0); DataDump.Set("LocalPetPokes", 0); Juicer.ShakeCamera(3); }
public List <CalendarEntry> GetCalendarEntriesForMonthById(string id) { var dataDump = new DataDump(); List <CalendarEntry> calendarEntries = dataDump.GetDataDump(); var month = calendarEntries.Where(c => c.Id.ToString() == id).Select(d => d.Date.Month).FirstOrDefault(); var calendarEntriesToDisplay = calendarEntries.Where(c => c.Date.Month == month).Select(d => d).ToList(); return(calendarEntriesToDisplay); }
public void SetFoodMenu() { for (int i = 0; i <= 2; ++i) { var foodType = (FoodType)i; int amount = DataDump.Get <int>(foodType.ToString()); FoodButtons[i].SetActive(amount > 0); } }
private IEnumerator Grow() { Juicer.ShakeCamera(0.5f); MessageController.AddMessage("it's growing!!"); ImpulseMover.GoHomeHack(); yield return(new WaitForSeconds(3)); DataDump.Set("LocalPetGrowthStage", 3); Juicer.ShakeCamera(3); }
private void OnTriggerEnter(Collider other) { if (other.tag.Equals("Player")) { DialogueQueue.AddMessage("Great hit!", 2); sentMessage = true; Doomed(); DataDump.SetInt("TrainingTargetsHit", DataDump.GetInt("TrainingTargetsHit") + 1); } }
public void OnEnter() { GameConductor.CameraStateTrigger("Initialize"); MusicBox.ChangeMusic(Song.Game.ToInt()); DataDump.Set("Berries", 0); DataDump.Set("BerriesDiscovered", false); DataDump.Set("Cookies", 0); DataDump.Set("CookiesDiscovered", false); DataDump.Set("Fish", 0); DataDump.Set("FishDiscovered", false); GameConductor.SetShowHud(true); }
public static int GetInt(string key) { if (!instance) { instance = GameObject.Find("GameDirector").GetComponent <DataDump>(); } if (!instance.dumbStupidDump.ContainsKey(key)) { instance.dumbStupidDump.Add(key, 0); } return(instance.dumbStupidDump[key]); }
private void OnTriggerEnter(Collider other) { if (other.tag.Equals("UpperBounds")) { inSpace = true; DialogueQueue.AddMessage("You're too close to the sun, Icarus!"); } if (other.tag.Equals("DockingBay")) { DataDump.SetInt("PlayerDocked", 1); DockingSequence(); } }
private void OnTriggerEnter(Collider other) { if (other.tag.Equals("PlayerBullet")) { GobPool.Destroy(other.gameObject); bossHP--; DataDump.SetInt("BossHP", bossHP); if (bossHP < 0) { Doomed(); } } }
private IEnumerator Die() { CloseFoodMenu(); Juicer.ShakeCamera(1); MessageController.AddMessage("oh no..."); ImpulseMover.GoHomeHack(); yield return(new WaitForSeconds(3)); int nextGrowthTime = CurrentTime + (MinutesSpentDead * 60); DataDump.Set("LocalPetNextGrowthTime", nextGrowthTime); DataDump.Set("LocalPetGrowthStage", (int)GrowthStage.Dead); Juicer.ShakeCamera(3); }
public static void SetInt(string key, int value) { if (!instance) { instance = GameObject.Find("GameDirector").GetComponent <DataDump>(); } if (!instance.dumbStupidDump.ContainsKey(key)) { instance.dumbStupidDump.Add(key, value); } else { instance.dumbStupidDump[key] = value; } }
public void OnEnter() { player = GameObject.Instantiate(PlayerPrototype); player.transform.position = PlayerSpawnLocation; Juicer.CreateFx(0, PlayerSpawnLocation); Juicer.ShakeCamera(0.5f); MusicBox.ChangeMusic((int)Song.Boss); DataDump.Set("HP", maxHP); DataDump.Set("ScaledHP", 1.0f); var cam = GameObject.Find("CinemachineStateCamera/GameCam").GetComponent <CinemachineVirtualCamera>(); cam.Follow = player.transform; cam.LookAt = player.transform; GameConductor.SetShowHud(true); }
private void OnTriggerEnter(Collider other) { if (other.tag.Equals("Player")) { DialogueQueue.AddMessage("Gah! Shoot them, don't ram them you maniac!", 2); sentMessage = true; Doomed(); } if (other.tag.Equals("PlayerBullet")) { DialogueQueue.AddMessage("Boom! Way to go!", 2); sentMessage = true; Doomed(); DataDump.SetInt("TrainingTargetsShot", DataDump.GetInt("TrainingTargetsShot") + 1); } }
public void TimeStep() { GrowthStage stage = (GrowthStage)DataDump.Get <int>("LocalPetGrowthStage"); switch (stage) { case GrowthStage.Baby: case GrowthStage.Juvi: int fullness = DataDump.Get <int>("LocalPetFullness") - 1; if (fullness <= 0) { // go to the die StartCoroutine(Die()); MessageController.AddMessage("oof"); MessageController.AddMessage("it starved to death"); MessageController.AddMessage("gather the food that's laying around"); MessageController.AddMessage("make sure to click the pet"); MessageController.AddMessage("and then the type of food"); MessageController.AddMessage("it will be dead for a minute.."); MessageController.AddMessage("but it always comes back"); return; } if (fullness == FullnessTolerance / 2) { // go to the complain MessageController.AddMessage("it's getting hungry.."); } if (fullness == 3) { // go to the complain MessageController.AddMessage("it's about to starve!"); } DataDump.Set("LocalPetFullness", fullness); break; } if (stage == GrowthStage.Baby && DataDump.Get <int>("LocalPetNextGrowthTime") < CurrentTime) { // go to the grow StartCoroutine(Grow()); } if (stage == GrowthStage.Dead && DataDump.Get <int>("LocalPetNextGrowthTime") < CurrentTime) { StartCoroutine(Sprout()); } }
private IEnumerator Hatch() { Juicer.ShakeCamera(1); yield return(new WaitForSeconds(2)); DataDump.Set("LocalPetGrowthStage", 2); DataDump.Set("LocalPetFullness", InitialFullness); DataDump.Set("LocalPetBerriesEaten", 0); DataDump.Set("LocalPetCookiesEaten", 0); DataDump.Set("LocalPetFishEaten", 0); DataDump.Set("LocalPetHappiness", 0); DataDump.Set("LocalPetAnnoyance", 0); int nextGrowthTime = CurrentTime + (MinutesSpentAsChild * 60); DataDump.Set("LocalPetNextGrowthTime", nextGrowthTime); Juicer.ShakeCamera(3); }
public IState Update() { if (Input.GetKeyDown(KeyCode.Space)) { // TODO: skip } if (progression == 0 && DataDump.GetInt("TrainingTargetsHit") >= ramCount) { DialogueQueue.AddMessage("Well done! Now try shooting them. Remember to move between the gun and engine using 'A' and 'D'."); progression++; var targets = GameObject.FindGameObjectsWithTag("TrainingTarget"); foreach (var t in targets) { t.GetComponent <TrainingTarget>().Doomed(); } engineTrainingSpawner.SetActive(false); shootTrainingSpawner = GameObject.Instantiate(shootTrainingSpawner, sd.transform.position + spawnerOffset, Quaternion.FromToRotation(Vector3.up, Vector3.left)); shootTrainingSpawner.GetComponent <SmoothTrack>().target = sd.transform; } if (progression == 1 && DataDump.GetInt("TrainingTargetsShot") >= shootCount) { var targets = GameObject.FindGameObjectsWithTag("TrainingTargetShoot"); foreach (var t in targets) { t.GetComponent <TrainingTargetShoot>().Doomed(); } shootTrainingSpawner.SetActive(false); DialogueQueue.AddMessage("Nice shooting! You're pretty much a professional at this point."); DialogueQueue.AddMessage("Deliver the package safely. There might be a few birds on the way to watch out for, but nothing to worry about."); DialogueQueue.AddMessage("..."); progression++; } if (progression == 2) { timer -= Time.deltaTime; if (timer < 0) { progression++; return(new BirdsState()); } } return(this); }
public void submitFeedback() { if (username == "") { username = "******"; } DataDump.Initialize(); List <object> surveyAnswers = new List <object>(); surveyAnswers.Add(username); surveyAnswers.Add(answers[0]); surveyAnswers.Add(answers[1]); for (int i = 0; i < 3; i++) { surveyAnswers.Add(textAnswers[i]); } DataDump.CreateEntry("A", "F", surveyAnswers, 1); CameraScript.Instance.CalculateTimes(username); }
private void OnTriggerEnter(Collider other) { if (other.tag.Equals("PlayerBullet")) { GobPool.Destroy(other.gameObject); DataDump.SetInt("BirdsKilled", DataDump.GetInt("BirdsKilled") + 1); var df = GobPool.Instantiate(deadFacade); df.transform.SetPositionAndRotation(transform.position, Quaternion.identity); Doomed(); } if (other.tag.Equals("Player")) { DataDump.SetInt("BirdsKilled", DataDump.GetInt("BirdsKilled") + 1); other.GetComponent <ShipDriver>().TakeDamage(1); var df = GobPool.Instantiate(deadFacade); df.transform.SetPositionAndRotation(transform.position, Quaternion.identity); Doomed(); } }