public override void Added() { base.Added(); Text_Time = new Otter.Text( "", 32 ); { Text_Time.X = X; Text_Time.Y = Y; Text_Time.CenterOrigin(); Text_Time.OutlineColor = Color.Black; Text_Time.OutlineThickness = 2; } Parent.AddGraphic( Text_Time ); // Initialize the fade in/out Alpha = new ClampedSpeedValueClass(); { Alpha.Value = 0; Alpha.Minimum = 0; Alpha.Maximum = 1; Alpha.Speed = FADE_SPEED; } // Update the images to have this initial alpha value foreach ( Graphic graphic in Parent.Graphics ) { graphic.Alpha = Alpha.Value; } }
public override void Added() { base.Added(); // Get reference to GameWands interface for handling Leap Tools GameWands = ( (Scene_GameClass) Scene ).GameWands; Text_Warning = new Otter.Text( "", 32 ); { Text_Warning.X = X; Text_Warning.Y = Y; Text_Warning.CenterOrigin(); Text_Warning.OutlineThickness = 2; } Parent.AddGraphic( Text_Warning ); // Initialize the cable offset Alpha = new ClampedSpeedValueClass(); { Alpha.Value = 0; Alpha.Minimum = 0; Alpha.Maximum = 1; Alpha.Speed = FADE_SPEED; } // Update the images to have this initial alpha value foreach ( Graphic graphic in Parent.Graphics ) { graphic.Alpha = Alpha.Value; } }
public override void Added() { base.Added(); string text = "Loser!"; { if ( Winner ) { text = "Winner!"; } } Text_Outcome = new Otter.Text( text, 96 ); { Text_Outcome.X = X; Text_Outcome.Y = Y; Text_Outcome.CenterOrigin(); Text_Outcome.OriginY = Text_Outcome.Height; Text_Outcome.OutlineThickness = 4; } Parent.AddGraphic( Text_Outcome ); Text_Score = new Otter.Text( Score.ToString(), 96 ); { Text_Score.X = X; Text_Score.Y = Y; Text_Score.CenterOrigin(); Text_Score.OriginY = -Text_Score.Height; Text_Score.OutlineThickness = 4; } Parent.AddGraphic( Text_Score ); // Initialize the cable offset Alpha = new ClampedSpeedValueClass(); { Alpha.Value = 0; Alpha.Minimum = 0; Alpha.Maximum = 1; Alpha.Speed = FADE_SPEED; } // Update the images to have this initial alpha value foreach ( Graphic graphic in Parent.Graphics ) { graphic.Alpha = Alpha.Value; } }
public override void Added() { base.Added(); // Initialize the background Leap cable image Image_LeapCable_Background = new Otter.Image( "../../resources/leap/leapcableback.png" ); { Image_LeapCable_Background.X = X; Image_LeapCable_Background.Y = Y; Image_LeapCable_Background.CenterOrigin(); Image_LeapCable_Background.OriginX = Image_LeapCable_Background.Width + 32; } Parent.AddGraphic( Image_LeapCable_Background ); // Initialize the Leap cable image Image_LeapCable = new Otter.Image( "../../resources/leap/leapcable.png" ); { Image_LeapCable.X = X; Image_LeapCable.Y = Y; Image_LeapCable.CenterOrigin(); Image_LeapCable.OriginX = Image_LeapCable.Width + 32; } Parent.AddGraphic( Image_LeapCable ); // Initialize the Leap controller image Image_Leap = new Otter.Image( "../../resources/leap/leapmotion.png" ); { Image_Leap.X = X; Image_Leap.Y = Y; Image_Leap.CenterOrigin(); Image_Leap.OriginX = 0; } Parent.AddGraphic( Image_Leap ); Text_Warning = new Otter.Text( "Plug in Leap Motion Controller device", 16 ); { Text_Warning.X = X + 55; Text_Warning.Y = Y; Text_Warning.CenterOrigin(); } Parent.AddGraphic( Text_Warning ); // Initialize the cable offset Cable = new ClampedSpeedValueClass(); { Cable.Value = 32; Cable.Minimum = -6; Cable.Maximum = 32; } // Initialize the cable offset Alpha = new ClampedSpeedValueClass(); { Alpha.Value = 0; Alpha.Minimum = 0; Alpha.Maximum = 1; Alpha.Speed = FADE_SPEED; } // Update the images to have this initial alpha value foreach ( Graphic graphic in Parent.Graphics ) { graphic.Alpha = Alpha.Value; } }
public override void Added() { // Add state machine component AddComponent( TragicStateMachine ); // Initialize to the menu state TragicStateMachine.ChangeState( TragicState.Menu ); // Add the game round timer to the manager AddComponent( RoundTime ); AddComponent( ScoreTime ); // Initalize first wizards to offscreen foreach ( WizardClass wizard in CurrentScene.Wizards ) { float wizardoffset = -256; // Offscreen { if ( wizard.Graphic.Angle > 0 ) // Light player { wizardoffset = Game.Instance.Width - wizardoffset; } } wizard.SetPosition( wizardoffset, Game.Instance.HalfHeight ); wizard.Destination = new Vector2( wizard.X, wizard.Y ); wizard.Pause = true; // Pause to stop player movement (nothing to do with Otter Entity pausing, still need some input) } // Initialize the fade in/out Ground_Alpha = new ClampedSpeedValueClass(); { Ground_Alpha.Value = 0; Ground_Alpha.Minimum = 0; Ground_Alpha.Maximum = 1; Ground_Alpha.Speed = FADE_SPEED; } // Initialize the camera shaker ScreenShake = new ScreenShaker(); this.Scene.Add(ScreenShake); // Initialize the tweet finished flag for the wizards TweetFinished = new bool[Scene_GameClass.WIZARDS]; { for ( short wizard = 0; wizard < Scene_GameClass.WIZARDS; wizard++ ) { TweetFinished[wizard] = false; } } // Initialize the match outcome for the wizards Outcome = new MatchOutcome[Scene_GameClass.WIZARDS]; }
public override void Added() { base.Added(); float height = 16; // Initialize the Team Member's image Image_Avatar = new Otter.Image( "../../resources/team/" + Username + ".png" ); { Image_Avatar.Scale = IMAGE_SCALE; Image_Avatar.X = X; Image_Avatar.Y = Y; Image_Avatar.CenterOrigin(); Image_Avatar.OriginY += IMAGE_OFFSET_TEXT; } AddGraphic( Image_Avatar ); // Store the y offset for text elements float offsety = ( IMAGE_OFFSET_TEXT * Image_Avatar.Width * Image_Avatar.ScaleX ); // Initialize the Team Member's twitter username Text_Name = new Otter.Text( Name, FONT_SIZE ); { Text_Name.X = X - offsety; Text_Name.Y = Y; Text_Name.CenterOrigin(); // Add to the offset for the next text offsety += height * TEXT_OFFSET_SCALE; } AddGraphic( Text_Name ); // Initialize the Team Member's role Text_Role = new Otter.Text( Role, FONT_SIZE ); { Text_Role.X = X - offsety; Text_Role.Y = Y; Text_Role.CenterOrigin(); // Add to the offset for the next text offsety += height * TEXT_OFFSET_SCALE; } AddGraphic( Text_Role ); // Add extra offset between name&role, and contact details offsety += Text_Role.Height * TEXT_OFFSET_SCALE / 2; // Initialize the Team Member's twitter username Text_Username = new Otter.Text( "@" + Username, FONT_SIZE ); { Text_Username.X = X - offsety; Text_Username.Y = Y; Text_Username.CenterOrigin(); // Add to the offset for the next text offsety += height * TEXT_OFFSET_SCALE; } AddGraphic( Text_Username ); // Initialize the Team Member's website url Text_Website = new Otter.Text( Website, FONT_SIZE ); { Text_Website.X = X - offsety; Text_Website.Y = Y; Text_Website.CenterOrigin(); // Add to the offset for the next text offsety += height * TEXT_OFFSET_SCALE; } //AddGraphic( Text_Website ); // Initialize the cable offset Alpha = new ClampedSpeedValueClass(); { Alpha.Value = 0; Alpha.Minimum = 0; Alpha.Maximum = 1; Alpha.Speed = FADE_SPEED; } // Update the images to have this initial alpha value foreach ( Graphic graphic in Graphics ) { graphic.Alpha = Alpha.Value; } }