void MakeBackground() { float thickness = 25f; float distanceBetween = 10f; float borderWidth = Futile.screen.width; float borderHeight = Futile.screen.height; TweenFlow flow = new TweenFlow(); TweenConfig config = new TweenConfig() .floatProp("alpha", 0.15f); float delayBetweenTweenStarts = 0.2f; for (int i = 0; borderWidth > 0 && borderHeight > 0; i++) { TBorderLayer layer = new TBorderLayer(borderWidth, borderHeight, 25f, new Color(0.75f, 0.2f, 0.2f, 1.0f)); layer.x = (distanceBetween + thickness) * i; layer.y = (distanceBetween + thickness) * i; layer.alpha = 0.0f; AddChild(layer); borderWidth = borderWidth - distanceBetween * 2f - thickness * 2f; borderHeight = borderHeight - distanceBetween * 2f - thickness * 2f; flow.insert(delayBetweenTweenStarts * i, new Tween(layer, 0.3f, config)); } Go.addTween(flow); flow.play(); }
public TDreamScene(DreamSceneType dreamSceneType) : base("") { FSoundManager.PlayMusic("celesta"); TParallaxScene parallaxScene = new TParallaxScene(Color.white); parallaxScene.AddLayerWithImageName("Atlases/clouds", 1.0f, 0, true); parallaxScene.foregroundVelocity = -100f; AddChild(parallaxScene); parallaxScene.StartUpdating(); TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); AddChild(borderLayer); this.dreamSceneType = dreamSceneType; TMain.labelDisplayLayer.shouldIncreaseHoldDurationBasedOnStringLength = true; TMain.labelDisplayLayer.fontColor = Color.black; if (this.dreamSceneType == DreamSceneType.DreamSceneOne) { TMain.labelDisplayLayer.AddStringsToQueue(new string[] { "Suddenly, I fall asleep", "In my dream,\nI reminisce about\ncreating the\nperfect last name", "Help me piece together\nour last name!"}); } else if (this.dreamSceneType == DreamSceneType.DreamSceneTwo) { TMain.labelDisplayLayer.AddStringsToQueue(new string[] { "Oh no, all this running\nhas made me fall\nasleep again!", "This time, I dream\nabout how much\nI love you", "Help me quantify just how\nmuch I love you!"}); } TMain.labelDisplayLayer.defaultHoldDuration = 3.0f; TMain.labelDisplayLayer.labelShowType = LabelShowType.SlideFromTop; TMain.labelDisplayLayer.labelHideType = LabelHideType.SlideToBottom; }
public TClickHeartsScene() : base("") { FSoundManager.PlayMusic("reverbPiano"); Go.validateTargetObjectsEachTick = false; FSoundManager.PlaySound("harpDescend"); MakeBackground(); MakeUIElements(); hearts = new List <FSprite>(); heartShowerHearts = new List <FSprite>(); for (int i = 0; i < 200; i++) { FSprite heart = new FSprite("heart.psd"); heart.color = new Color(0.75f, Random.Range(0, 0.3f), Random.Range(0, 0.3f), 1.0f); heart.isVisible = false; heart.alpha = Random.Range(0.6f, 1.0f); heart.rotation = Random.Range(0, 359); heart.scale = Random.Range(0.1f, 1.0f); heartShowerHearts.Add(heart); AddChild(heart); } TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); AddChild(borderLayer); }
public TClickHeartsScene() : base("") { FSoundManager.PlayMusic("reverbPiano"); Go.validateTargetObjectsEachTick = false; FSoundManager.PlaySound("harpDescend"); MakeBackground(); MakeUIElements(); hearts = new List<FSprite>(); heartShowerHearts = new List<FSprite>(); for (int i = 0; i < 200; i++) { FSprite heart = new FSprite("heart.psd"); heart.color = new Color(0.75f, Random.Range(0, 0.3f), Random.Range(0, 0.3f), 1.0f); heart.isVisible = false; heart.alpha = Random.Range(0.6f, 1.0f); heart.rotation = Random.Range(0, 359); heart.scale = Random.Range(0.1f, 1.0f); heartShowerHearts.Add(heart); AddChild(heart); } TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); AddChild(borderLayer); }
public TDreamScene(DreamSceneType dreamSceneType) : base("") { FSoundManager.PlayMusic("celesta"); TParallaxScene parallaxScene = new TParallaxScene(Color.white); parallaxScene.AddLayerWithImageName("Atlases/clouds", 1.0f, 0, true); parallaxScene.foregroundVelocity = -100f; AddChild(parallaxScene); parallaxScene.StartUpdating(); TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); AddChild(borderLayer); this.dreamSceneType = dreamSceneType; TMain.labelDisplayLayer.shouldIncreaseHoldDurationBasedOnStringLength = true; TMain.labelDisplayLayer.fontColor = Color.black; if (this.dreamSceneType == DreamSceneType.DreamSceneOne) { TMain.labelDisplayLayer.AddStringsToQueue(new string[] { "Suddenly, I fall asleep", "In my dream,\nI reminisce about\ncreating the\nperfect last name", "Help me piece together\nour last name!" }); } else if (this.dreamSceneType == DreamSceneType.DreamSceneTwo) { TMain.labelDisplayLayer.AddStringsToQueue(new string[] { "Oh no, all this running\nhas made me fall\nasleep again!", "This time, I dream\nabout how much\nI love you", "Help me quantify just how\nmuch I love you!" }); } TMain.labelDisplayLayer.defaultHoldDuration = 3.0f; TMain.labelDisplayLayer.labelShowType = LabelShowType.SlideFromTop; TMain.labelDisplayLayer.labelHideType = LabelHideType.SlideToBottom; }
public TPeopleScene(GoalType goalType) : base("") { FSprite background = SquareMaker.Square(Futile.screen.width, Futile.screen.height); background.color = Color.black; background.x = Futile.screen.halfWidth; background.y = Futile.screen.halfHeight; AddChild(background); startOverLabel = new FLabel("SoftSugar", "Any key or click\nto start completely over"); startOverLabel.x = Futile.screen.halfWidth; startOverLabel.y = Futile.screen.halfHeight; startOverLabel.alpha = 0; AddChild(startOverLabel); everythingContainer = new FContainer(); AddChild(everythingContainer); parallaxScene = new TParallaxScene(new Color(0.7f, 0.9f, 1.0f, 1.0f)); parallaxScene.foregroundVelocity = universalVelocity; parallaxScene.AddLayerWithImageName("mountains0.png", 0.15f, 0, true); parallaxScene.AddLayerWithImageName("mountains1.png", 0.3f, 0, true); parallaxScene.AddLayerWithImageName("cloud.psd", 0.2f, Futile.screen.halfHeight + 100f, false); parallaxScene.AddLayerWithImageName("ground.psd", 1.0f, 0, true); parallaxScene.StartUpdating(); everythingContainer.AddChild(parallaxScene); FSprite fog = SquareMaker.Square(Futile.screen.width, Futile.screen.height); fog.x = Futile.screen.halfWidth; fog.y = Futile.screen.halfHeight; fog.color = Color.black; fog.alpha = 0.5f; everythingContainer.AddChild(fog); this.goalType = goalType; tutorialIsDone = TMain.goalOneTutorialIsDone; if (this.goalType == GoalType.GoalOne) goalDistance = 20000f; else if (this.goalType == GoalType.GoalTwo) goalDistance = 30000f; else if (this.goalType == GoalType.GoalThree) goalDistance = 50000f; FSoundManager.PlayMusic("jazz"); SetupHeartTokens(); SetupUIElements(); SetupTutorial(); SetupHeartShower(); SetupFinalNote(); if (this.goalType == GoalType.GoalTwo) { FLabel label = new FLabel("SoftSugar", "\"I hope Dana's around\nhere somewhere!\""); label.x = Futile.screen.halfWidth; label.y = Futile.screen.height - 100f; everythingContainer.AddChild(label); Tween tween = new Tween(label, 0.3f, new TweenConfig() .setDelay(3.0f) .floatProp("y", Futile.screen.height + 200f) .setEaseType(EaseType.SineInOut)); Go.addTween(tween); tween.play(); } else if (this.goalType == GoalType.GoalThree) { FLabel label = new FLabel("SoftSugar", "\"Will I ever survive\nwithout her?\""); label.x = Futile.screen.halfWidth; label.y = Futile.screen.height - 100f; everythingContainer.AddChild(label); Tween tween = new Tween(label, 0.3f, new TweenConfig() .setDelay(3.0f) .floatProp("y", Futile.screen.height + 200f) .setEaseType(EaseType.SineInOut)); Go.addTween(tween); tween.play(); } whit = new TWalkingCharacter("whitHead.png"); whit.x = 130f; whit.y = 250f; everythingContainer.AddChild(whit); whit.StartWalking(); TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); everythingContainer.AddChild(borderLayer); }
public TMergeNamesScene() : base("Name Destroy Scene") { FSoundManager.PlayMusic("reverbPiano"); TDiagBarsLayer diagLayer = new TDiagBarsLayer(); AddChild(diagLayer); TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); AddChild(borderLayer); InitButtons(); trebellaFinalPositions = new List<Vector2>(); float startingZero = 100f; float horizontalDistance = (Futile.screen.width - startingZero * 2f) / 9f; for (int i = 0; i < 8; i++) { trebellaFinalPositions.Add(new Vector2(startingZero + horizontalDistance * (i + 1), Futile.screen.halfHeight)); } unsolidifiedTrebellaLetters = new List<FLabel>(); hearts = new List<FSprite>(); for (int i = 0; i < 100; i++) { FSprite heart = new FSprite("heart.psd"); heart.scale = Random.Range(0.1f, 0.3f); float secondaryColorAmt = Random.Range(0.0f, 0.3f); heart.color = new Color(1.0f, secondaryColorAmt, secondaryColorAmt, 1.0f); heart.rotation = Random.Range(0.0f, 359.0f); hearts.Add(heart); } List<string>blackallStrings = new List<string>(); blackallStrings.Add("B"); blackallStrings.Add("L"); blackallStrings.Add("A"); blackallStrings.Add("C"); blackallStrings.Add("K"); blackallStrings.Add("A"); blackallStrings.Add("L"); blackallStrings.Add("L"); blackallLetters = InitLetters(blackallStrings, "Burnstown", -30f); List<string>tesserStrings = new List<string>(); tesserStrings.Add("T"); tesserStrings.Add("E"); tesserStrings.Add("S"); tesserStrings.Add("S"); tesserStrings.Add("E"); tesserStrings.Add("R"); tesserLetters = InitLetters(tesserStrings, "SoftSugar", Futile.screen.height + 30f); List<string>trebellaStrings = new List<string>(); trebellaStrings.Add("T"); trebellaStrings.Add("R"); trebellaStrings.Add("E"); trebellaStrings.Add("B"); trebellaStrings.Add("E"); trebellaStrings.Add("L"); trebellaStrings.Add("L"); trebellaStrings.Add("A"); trebellaLetters = InitLetters(trebellaStrings, "Exotica", Futile.screen.height + 30f); }
public TPeopleScene(GoalType goalType) : base("") { FSprite background = SquareMaker.Square(Futile.screen.width, Futile.screen.height); background.color = Color.black; background.x = Futile.screen.halfWidth; background.y = Futile.screen.halfHeight; AddChild(background); startOverLabel = new FLabel("SoftSugar", "Any key or click\nto start completely over"); startOverLabel.x = Futile.screen.halfWidth; startOverLabel.y = Futile.screen.halfHeight; startOverLabel.alpha = 0; AddChild(startOverLabel); everythingContainer = new FContainer(); AddChild(everythingContainer); parallaxScene = new TParallaxScene(new Color(0.7f, 0.9f, 1.0f, 1.0f)); parallaxScene.foregroundVelocity = universalVelocity; parallaxScene.AddLayerWithImageName("mountains0.png", 0.15f, 0, true); parallaxScene.AddLayerWithImageName("mountains1.png", 0.3f, 0, true); parallaxScene.AddLayerWithImageName("cloud.psd", 0.2f, Futile.screen.halfHeight + 100f, false); parallaxScene.AddLayerWithImageName("ground.psd", 1.0f, 0, true); parallaxScene.StartUpdating(); everythingContainer.AddChild(parallaxScene); FSprite fog = SquareMaker.Square(Futile.screen.width, Futile.screen.height); fog.x = Futile.screen.halfWidth; fog.y = Futile.screen.halfHeight; fog.color = Color.black; fog.alpha = 0.5f; everythingContainer.AddChild(fog); this.goalType = goalType; tutorialIsDone = TMain.goalOneTutorialIsDone; if (this.goalType == GoalType.GoalOne) { goalDistance = 20000f; } else if (this.goalType == GoalType.GoalTwo) { goalDistance = 30000f; } else if (this.goalType == GoalType.GoalThree) { goalDistance = 50000f; } FSoundManager.PlayMusic("jazz"); SetupHeartTokens(); SetupUIElements(); SetupTutorial(); SetupHeartShower(); SetupFinalNote(); if (this.goalType == GoalType.GoalTwo) { FLabel label = new FLabel("SoftSugar", "\"I hope Dana's around\nhere somewhere!\""); label.x = Futile.screen.halfWidth; label.y = Futile.screen.height - 100f; everythingContainer.AddChild(label); Tween tween = new Tween(label, 0.3f, new TweenConfig() .setDelay(3.0f) .floatProp("y", Futile.screen.height + 200f) .setEaseType(EaseType.SineInOut)); Go.addTween(tween); tween.play(); } else if (this.goalType == GoalType.GoalThree) { FLabel label = new FLabel("SoftSugar", "\"Will I ever survive\nwithout her?\""); label.x = Futile.screen.halfWidth; label.y = Futile.screen.height - 100f; everythingContainer.AddChild(label); Tween tween = new Tween(label, 0.3f, new TweenConfig() .setDelay(3.0f) .floatProp("y", Futile.screen.height + 200f) .setEaseType(EaseType.SineInOut)); Go.addTween(tween); tween.play(); } whit = new TWalkingCharacter("whitHead.png"); whit.x = 130f; whit.y = 250f; everythingContainer.AddChild(whit); whit.StartWalking(); TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); everythingContainer.AddChild(borderLayer); }
public TMergeNamesScene() : base("Name Destroy Scene") { FSoundManager.PlayMusic("reverbPiano"); TDiagBarsLayer diagLayer = new TDiagBarsLayer(); AddChild(diagLayer); TBorderLayer borderLayer = new TBorderLayer(Futile.screen.width, Futile.screen.height, 5f, new Color(0.2f, 0.2f, 0.2f, 1.0f)); AddChild(borderLayer); InitButtons(); trebellaFinalPositions = new List <Vector2>(); float startingZero = 100f; float horizontalDistance = (Futile.screen.width - startingZero * 2f) / 9f; for (int i = 0; i < 8; i++) { trebellaFinalPositions.Add(new Vector2(startingZero + horizontalDistance * (i + 1), Futile.screen.halfHeight)); } unsolidifiedTrebellaLetters = new List <FLabel>(); hearts = new List <FSprite>(); for (int i = 0; i < 100; i++) { FSprite heart = new FSprite("heart.psd"); heart.scale = Random.Range(0.1f, 0.3f); float secondaryColorAmt = Random.Range(0.0f, 0.3f); heart.color = new Color(1.0f, secondaryColorAmt, secondaryColorAmt, 1.0f); heart.rotation = Random.Range(0.0f, 359.0f); hearts.Add(heart); } List <string> blackallStrings = new List <string>(); blackallStrings.Add("B"); blackallStrings.Add("L"); blackallStrings.Add("A"); blackallStrings.Add("C"); blackallStrings.Add("K"); blackallStrings.Add("A"); blackallStrings.Add("L"); blackallStrings.Add("L"); blackallLetters = InitLetters(blackallStrings, "Burnstown", -30f); List <string> tesserStrings = new List <string>(); tesserStrings.Add("T"); tesserStrings.Add("E"); tesserStrings.Add("S"); tesserStrings.Add("S"); tesserStrings.Add("E"); tesserStrings.Add("R"); tesserLetters = InitLetters(tesserStrings, "SoftSugar", Futile.screen.height + 30f); List <string> trebellaStrings = new List <string>(); trebellaStrings.Add("T"); trebellaStrings.Add("R"); trebellaStrings.Add("E"); trebellaStrings.Add("B"); trebellaStrings.Add("E"); trebellaStrings.Add("L"); trebellaStrings.Add("L"); trebellaStrings.Add("A"); trebellaLetters = InitLetters(trebellaStrings, "Exotica", Futile.screen.height + 30f); }