public virtual void DeveloperActivity() { // Z -- Zoolevel if (InputManager.Keyboard.KeyPushed(Keys.Z)) MoveToScreen(typeof(ZooLevel).FullName); // R -- Reset Character if (InputManager.Keyboard.KeyPushed(Keys.R)) { EnableKeys(); DisableLayers = true; Boden.Y = -50; CurrentLayer = 1; PlatformerCharacterBase.getInstance().Y = 75; PlatformerCharacterBase.getInstance().SpriteInstance.TextureScale = 0.5f; PlatformerCharacterBase.getInstance().Collision.Height = CollisionHeightLayerFront; PlatformerCharacterBase.getInstance().Collision.Width = CollisionWidthLayerFront; Manager.CharacterFallingInHole = false; if (!PlatformerCharacterBase.isChild()) { DisableLayers = false; TheodorChild Temp = new TheodorChild(); Temp.X = PlatformerCharacterBase.getInstance().X; Temp.Y = PlatformerCharacterBase.getInstance().Y; PlatformerCharacterBase.updateinstance(Temp); } } // Numbers -- GoTo: 1-Empfang, 2-Flur if (InputManager.Keyboard.KeyPushed(Keys.D1)) MoveToScreen(typeof(Empfang).FullName); if (InputManager.Keyboard.KeyPushed(Keys.D2)) MoveToScreen(typeof(Flur).FullName); if (InputManager.Keyboard.KeyPushed(Keys.D3)) MoveToScreen(typeof(Schlafraum).FullName); if (InputManager.Keyboard.KeyPushed(Keys.D4)) MoveToScreen(typeof(Credits).FullName); // F3/F4 -- Zeigt Debugger Werte an if (InputManager.Keyboard.KeyPushed(Keys.F3)) { if (!DebuggerOn) DebuggerOn = true; } if (InputManager.Keyboard.KeyPushed(Keys.F4)) { if (DebuggerOn) DebuggerOn = false; } if (!DebuggerOn) { FlatRedBall.Debugging.Debugger.Write(""); } if (DebuggerOn) { string resultStringY = "Character Y: " + PlatformerCharacterBase.getInstance().Y; string resultStringX = "Character X: " + PlatformerCharacterBase.getInstance().X; string resultStringCollisionH = "Collision H: " + PlatformerCharacterBase.getInstance().Collision.Height; string resultStringCollisionW = "Collision W: " + PlatformerCharacterBase.getInstance().Collision.Width; string resultStringLayer = "CurrentLayer:" + CurrentLayer.ToString(); string resultStringL3 = "LayerBackDisable:" + DisableLayerBack.ToString(); string resultStringLa = "LayersDisable:" + DisableLayers.ToString(); string resultStringSwitch = "isSwitching:" + Manager.isSwitching.ToString(); string resultStringCameraX = "CameraX:" + SpriteManager.Camera.X.ToString(); string resultStringLayerCount = "BodenY:" + Boden.Y; string resultStringChainName = "Animation:" + PlatformerCharacterBase.getInstance().SpriteInstance.CurrentChainName; string resultStringCharacterYVelocity = "Theo Y Velocity:" + PlatformerCharacterBase.getInstance().YVelocity; string resultStringVolume = "Volume: " + Microsoft.Xna.Framework.Media.MediaPlayer.Volume; string resultStringCheckX = "CheckX: " + Manager.CheckPointX.ToString(); string resultStringCheckY = "CheckY: " + Manager.CheckPointY.ToString(); string resultStringFlashAlpha = "FlashAlpha: " + FlashInstance.SpriteInstanceBlack.Alpha.ToString(); FlatRedBall.Debugging.Debugger.Write(resultStringX + "\n" + resultStringY + "\n" + resultStringCollisionH + "\n" + resultStringCollisionW + "\n" + resultStringLayer + "\n" + resultStringL3 + "\n" + resultStringLa + "\n" + resultStringSwitch + "\n" + resultStringCameraX + "\n" + resultStringLayerCount + "\n" + resultStringChainName + "\n" + resultStringCharacterYVelocity + "\n" + resultStringVolume + "\n" + resultStringCheckX + "\n" + resultStringCheckY + "\n" + resultStringFlashAlpha); } }
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; } }