public void StartCharacterState(String state, int x) { if (state == "Child") { //--Als Kind starten TheodorChild Temp = new VergissMeinNicht.Entities.TheodorChild(ContentManagerName, false); Temp.Name = "TheodorChildInstance"; PlatformerCharacterBase.updateinstance(Temp); Temp.AddToManagers(LayerFront); } else //if (state == "GrownUp") { // --Als GrownUp starten ("Standard") TheodorGrownUp Temp = new VergissMeinNicht.Entities.TheodorGrownUp(ContentManagerName, false); Temp.Name = "TheodorGrownUpInstance"; PlatformerCharacterBase.updateinstance(Temp); Temp.AddToManagers(LayerFront); } PlatformerCharacterBase.getInstance().X = x; SpriteManager.Camera.X = x; }
void TeddySwitch() { //Makes Button Visible / Invisible in front of a Teddy if (PlatformerCharacterBase.getInstance().X < (Sprite.X + 75) && PlatformerCharacterBase.getInstance().X > (Sprite.X - 75) && FlashInstance.Alpha == 0) { //--Transform Character if (InputManager.Keyboard.KeyPushed(Keys.E)) { switch (Manager.CurrentLevel) { case 1: Manager.SetCheckPoint(this.X, 102.5f); break; case 2: Manager.SetCheckPoint(this.X, 102.5f); break; case 3: break; default: break; } // aktuelle Blickrichtung speichern if (PlatformerCharacterBase.getInstance().DirectionFacing == PlatformerCharacterBase.LeftOrRight.Right) LastDirectionRight = true; else LastDirectionRight = false; tempLayer = LevelBase.CurrentLayer; if (PlatformerCharacterBase.isChild() && Manager.LoadLevel != 0) { if (FlashInstance.Alpha == 0) { FlashInstance.Visible = false; FlashInstance.Alpha = 1; } FlashInstance.Visible = true; FlashInstance.SpriteInstance .Tween("Alpha") .To(0) .During(1) .Using( FlatRedBall.Glue.StateInterpolation.InterpolationType.Linear, FlatRedBall.Glue.StateInterpolation.Easing.Out); TheodorGrownUp Temp = new TheodorGrownUp(); Temp.X = PlatformerCharacterBase.getInstance().X; Temp.Y = PlatformerCharacterBase.getInstance().Y; PlatformerCharacterBase.updateinstance(Temp); PlatformerCharacterBase.UpdateCharacterValues(); UpdateCharacterScale(); if (LastDirectionRight) PlatformerCharacterBase.getInstance().DirectionFacing = PlatformerCharacterBase.LeftOrRight.Right; //Blickrichtung auf Rechts setzen, falls nötig this.Sprite.Texture = creepyteddy; } else if (!PlatformerCharacterBase.isChild()) { if (FlashInstance.Alpha == 0) { FlashInstance.Visible = false; FlashInstance.Alpha = 1; } FlashInstance.Visible = true; FlashInstance.SpriteInstance .Tween("Alpha") .To(0) .During(1) .Using( FlatRedBall.Glue.StateInterpolation.InterpolationType.Linear, FlatRedBall.Glue.StateInterpolation.Easing.Out); TheodorChild Temp = new TheodorChild(); Temp.X = PlatformerCharacterBase.getInstance().X; Temp.Y = PlatformerCharacterBase.getInstance().Y - 140; PlatformerCharacterBase.updateinstance(Temp); PlatformerCharacterBase.UpdateCharacterValues(); UpdateCharacterScale(); if (LastDirectionRight) PlatformerCharacterBase.getInstance().DirectionFacing = PlatformerCharacterBase.LeftOrRight.Right; //Blickrichtung auf Rechts setzen, falls nötig this.Sprite.Texture = teddy; } } if (PlatformerCharacterBase.isChild() && Manager.LoadLevel == 0) UI_Button_EInstance.SpriteInstanceVisible = false; else UI_Button_EInstance.SpriteInstanceVisible = true; // E-Button einblenden } else { UI_Button_EInstance.SpriteInstanceVisible = false; SaveText.Visible = false; InteractText.Visible = false; } }