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 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 void UpdateGoal() { if (totalDistance < goalDistance - 1000f || initiatedSceneSwitch) return; if (goalType == GoalType.GoalOne) { if (faceCoin == null) { faceCoin = new FSprite("danaHappy.png"); faceCoin.x = Futile.screen.width + 100f; faceCoin.y = 250f; everythingContainer.AddChild(faceCoin); everythingContainer.AddChild(whit); // move him to top Tween tween1 = new Tween(faceCoin, 0.5f, new TweenConfig() .floatProp("scaleX", -1.0f) .setEaseType(EaseType.SineInOut)); Tween tween2 = new Tween(faceCoin, 0.5f, new TweenConfig() .floatProp("scaleX", 1.0f) .setEaseType(EaseType.SineInOut)); TweenChain chain = new TweenChain(); chain.setIterations(-1); chain.append(tween1); chain.append(tween2); Go.addTween(chain); chain.play(); } faceCoin.x += Time.fixedDeltaTime * universalVelocity; if (faceCoin.x < 100f) { initiatedSceneSwitch = true; FSoundManager.PlaySound("success"); TMain.SwitchToScene(TMain.SceneType.DreamSceneOne); } } else if (goalType == GoalType.GoalTwo) { if (bigHeartCoin == null) { bigHeartCoin = new FSprite("heart.psd"); bigHeartCoin.scale = 2.0f; bigHeartCoin.x = Futile.screen.width + 100f; bigHeartCoin.color = new Color(1.0f, 0.2f, 0.2f, 1.0f); bigHeartCoin.y = 250f; everythingContainer.AddChild(bigHeartCoin); everythingContainer.AddChild(whit); // move to top Tween tween1 = new Tween(bigHeartCoin, 0.5f, new TweenConfig() .floatProp("scaleX", -1.0f) .setEaseType(EaseType.SineInOut)); Tween tween2 = new Tween(bigHeartCoin, 0.5f, new TweenConfig() .floatProp("scaleX", 1.0f) .setEaseType(EaseType.SineInOut)); TweenChain chain = new TweenChain(); chain.setIterations(-1); chain.append(tween1); chain.append(tween2); Go.addTween(chain); chain.play(); } bigHeartCoin.x += Time.fixedDeltaTime * universalVelocity; if (bigHeartCoin.x < 100f) { initiatedSceneSwitch = true; FSoundManager.StopMusic(); FSoundManager.PlaySound("success"); TMain.SwitchToScene(TMain.SceneType.DreamSceneTwo); } } else if (goalType == GoalType.GoalThree) { if (dana == null) { dana = new TWalkingCharacter("danaHead.png"); dana.x = Futile.screen.width + 100f; dana.y = 250f; everythingContainer.AddChild(dana); dana.StartWalking(); } dana.x += Time.fixedDeltaTime * universalVelocity * 0.25f; if (dana.x < 350f) { start.isVisible = goal.isVisible = false; FSoundManager.PlayMusic("yay"); foundEachother = true; dana.TurnAround(); dana.StopWalking(); whit.StopWalking(); parallaxScene.StopUpdating(); whit.StopCrouching(); StartHeartShower(); } } }
public void UpdateGoal() { if (totalDistance < goalDistance - 1000f || initiatedSceneSwitch) { return; } if (goalType == GoalType.GoalOne) { if (faceCoin == null) { faceCoin = new FSprite("danaHappy.png"); faceCoin.x = Futile.screen.width + 100f; faceCoin.y = 250f; everythingContainer.AddChild(faceCoin); everythingContainer.AddChild(whit); // move him to top Tween tween1 = new Tween(faceCoin, 0.5f, new TweenConfig() .floatProp("scaleX", -1.0f) .setEaseType(EaseType.SineInOut)); Tween tween2 = new Tween(faceCoin, 0.5f, new TweenConfig() .floatProp("scaleX", 1.0f) .setEaseType(EaseType.SineInOut)); TweenChain chain = new TweenChain(); chain.setIterations(-1); chain.append(tween1); chain.append(tween2); Go.addTween(chain); chain.play(); } faceCoin.x += Time.fixedDeltaTime * universalVelocity; if (faceCoin.x < 100f) { initiatedSceneSwitch = true; FSoundManager.PlaySound("success"); TMain.SwitchToScene(TMain.SceneType.DreamSceneOne); } } else if (goalType == GoalType.GoalTwo) { if (bigHeartCoin == null) { bigHeartCoin = new FSprite("heart.psd"); bigHeartCoin.scale = 2.0f; bigHeartCoin.x = Futile.screen.width + 100f; bigHeartCoin.color = new Color(1.0f, 0.2f, 0.2f, 1.0f); bigHeartCoin.y = 250f; everythingContainer.AddChild(bigHeartCoin); everythingContainer.AddChild(whit); // move to top Tween tween1 = new Tween(bigHeartCoin, 0.5f, new TweenConfig() .floatProp("scaleX", -1.0f) .setEaseType(EaseType.SineInOut)); Tween tween2 = new Tween(bigHeartCoin, 0.5f, new TweenConfig() .floatProp("scaleX", 1.0f) .setEaseType(EaseType.SineInOut)); TweenChain chain = new TweenChain(); chain.setIterations(-1); chain.append(tween1); chain.append(tween2); Go.addTween(chain); chain.play(); } bigHeartCoin.x += Time.fixedDeltaTime * universalVelocity; if (bigHeartCoin.x < 100f) { initiatedSceneSwitch = true; FSoundManager.StopMusic(); FSoundManager.PlaySound("success"); TMain.SwitchToScene(TMain.SceneType.DreamSceneTwo); } } else if (goalType == GoalType.GoalThree) { if (dana == null) { dana = new TWalkingCharacter("danaHead.png"); dana.x = Futile.screen.width + 100f; dana.y = 250f; everythingContainer.AddChild(dana); dana.StartWalking(); } dana.x += Time.fixedDeltaTime * universalVelocity * 0.25f; if (dana.x < 350f) { start.isVisible = goal.isVisible = false; FSoundManager.PlayMusic("yay"); foundEachother = true; dana.TurnAround(); dana.StopWalking(); whit.StopWalking(); parallaxScene.StopUpdating(); whit.StopCrouching(); StartHeartShower(); } } }