/// <summary> /// The layer's active move, if any. If setting, the given move will be performed as long as it's on /// the given layer. /// </summary> /// <param name="layer"></param> /// <returns></returns> public Move this[MoveLayer layer] { get { return(Get(layer)); } set { if (value.Layer == layer) { Perform(value); } } }
public static bool EndMove(this HedgehogController controller, MoveLayer layer) { var moveManager = controller.GetComponent <MoveManager>(); if (moveManager == null) { return(false); } return(moveManager.End(layer)); }
public void Initialize() { _moveLayerList = new List <MoveLayer>(); foreach (Transform child in transform) { MoveLayer moveLayer = child.GetComponent <MoveLayer>(); if (moveLayer != null) { _moveLayerList.Add(moveLayer); } } BackgroundObj.Initialize(); _moveLayerList.ForEach(moveLayer => moveLayer.Initialize()); }
private void Awake() { THIS = this; GetHitNext = GetCandyPrefab[Random.Range(0, GetCandyPrefab.Length)]; GetHitGem = GetHitNext; BubleCursor.sprite = GetHitNext.GetComponent <SpriteRenderer>().sprite; //BubleCursor.GetComponent<HitCandy>() = GetHitGem; bubble2 = GetHitGem; GetHitNext = GetCandyPrefab[Random.Range(0, GetCandyPrefab.Length)]; //if (GetHitGem != null) //{ // HitsCand.Add(GetHitGem); //} //if (bubble2 != null) //{ // HitsCand.Add(bubble2); //} }
private bool DrawTileMap(DevicePanel d, int _x, int _y, int transparency, System.Drawing.Color color) { if (ErrorKilled) { return(false); } try { int x = _x - (platform_width / 2); int y = _y - (platform_height / 2); if (MoveLayer != null) { if (TileMap == null || TileMap != MoveLayer.Tiles || TilesNeedUpdate || PlatformImage == null) { TilesNeedUpdate = false; if (PlatformImage != null) { PlatformImage.Dispose(); PlatformImage = null; } TileMap = MoveLayer.Tiles; var bitmap = new System.Drawing.Bitmap(MoveLayer.Width * Methods.Solution.SolutionConstants.TILE_SIZE, MoveLayer.Height * Methods.Solution.SolutionConstants.TILE_SIZE); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap); MoveLayer.Draw(g); PlatformImage = Methods.Drawing.TextureCreator.FromBitmap(d._device, bitmap); g.Clear(System.Drawing.Color.Transparent); bitmap.Dispose(); g.Dispose(); } d.DrawBitmap(PlatformImage, x, y, platform_x, platform_y, platform_width, platform_height, false, transparency, false, false, 0, color); } return(true); } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message); ErrorKilled = true; return(false); } }
public Bumpers(Game game, int priority) : base(game, priority) { _game = game; _bumperHits = 0; _bumperSounds = 1; _bumperLevel = 1; _bumperAwardRange1 = Range.GetRange(10, 500, 10); _bumperAwardRange2to4 = Range.GetRange(25, 500, 25); _bumperAwardRange5 = Range.GetRange(100, 500, 25); bubbaLayer = AssetService.Animations["bubbaJoe"]; BloodSplat = AssetService.Animations["BloodSplat"]; BloodSplat.repeat = false; BloodSplat.hold = false; MoveBlood = new MoveLayer(BloodSplat, targetY: 300, framesLength: BloodSplat.frames.Length); TextBubbaLabel = _game.BaseMode.SetStatus("bubba", "", 2, "spellED", composite: false); TextBumperLabel = _game.BaseMode.SetStatus("bumpers", "", 2, "ed_common", composite: false); TextBumperLevelsLabel = _game.BaseMode.SetStatus("level", "", 2, "ed_common", composite: false); }
private void OnAddSequence(object x) { if (x == null) { return; } var seqType = (SequenceType)x; Sequence seq = null; switch (seqType) { case SequenceType.LastScores: var lastScores = new LastScores() { SequenceName = "LastScores", duration = 3.0m }; seq = new Sequence() { LastScores = lastScores }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.LastScores); Sequences.Add(new SequenceItemViewModel(seq.LastScores)); break; case SequenceType.Combo: var combo = new Combo() { SequenceName = "Combo", duration = 3.0m }; seq = new Sequence() { Combo = combo }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.Combo); Sequences.Add(new SequenceItemViewModel(seq.Combo)); break; case SequenceType.TextLayer: var txtLayr = new TextLayer() { SequenceName = "TextLayer", duration = 3.0m }; seq = new Sequence() { text_layer = txtLayr }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.text_layer); Sequences.Add(new SequenceItemViewModel(seq.text_layer)); break; case SequenceType.PanningLayer: var panning_layer = new PanningLayer() { SequenceName = "panning_layer", duration = 3.0m }; seq = new Sequence() { panning_layer = panning_layer }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.panning_layer); Sequences.Add(new SequenceItemViewModel(seq.panning_layer)); break; case SequenceType.RandomText: var rndText = new RandomText() { SequenceName = "RandomText", duration = 3.0m }; seq = new Sequence() { RandomText = rndText }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.RandomText); Sequences.Add(new SequenceItemViewModel(seq.RandomText)); break; case SequenceType.Animation: var attAnim = new AttractAnimation() { AnimName = "Animation", duration = 3.0m }; seq = new Sequence() { AttractAnimation = attAnim }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.AttractAnimation); Sequences.Add(new SequenceItemViewModel(seq.AttractAnimation)); break; case SequenceType.HighScores: var hiScore = new HighScores() { SequenceName = "HighScores", duration = 1.0m }; seq = new Sequence() { HighScores = hiScore }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.HighScores); Sequences.Add(new SequenceItemViewModel(seq.HighScores)); break; case SequenceType.Credits: var credits = new Credits() { SequenceName = "Credits", duration = 3.0m }; seq = new Sequence() { Credits = credits }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.Credits); Sequences.Add(new SequenceItemViewModel(seq.Credits)); break; case SequenceType.MarkupLayer: var markup = new MarkupLayer() { SequenceName = "MarkupLayer", duration = 3.0m }; seq = new Sequence() { MarkupLayer = markup }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.MarkupLayer); Sequences.Add(new SequenceItemViewModel(seq.MarkupLayer)); break; case SequenceType.ScriptedText: var scriptedText = new ScriptedText() { Name = "ScriptedText", duration = 3.0m }; seq = new Sequence() { ScriptedText = scriptedText }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.ScriptedText); Sequences.Add(new SequenceItemViewModel(seq.ScriptedText)); break; case SequenceType.GroupLayer: var groupLayer = new GroupLayer() { Name = "GroupLayer", duration = 3.0m }; seq = new Sequence() { GroupLayer = groupLayer }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.GroupLayer); Sequences.Add(new SequenceItemViewModel(seq.GroupLayer)); break; case SequenceType.MoveLayer: var moveLayer = new MoveLayer() { SequenceName = "MoveLayer", duration = 3.0m }; seq = new Sequence() { MoveLayer = moveLayer }; this.SelectedSequenceFile.SequenceYaml.Sequences.Add(seq.MoveLayer); Sequences.Add(new SequenceItemViewModel(seq.MoveLayer)); break; default: break; } }
/// <summary> /// Ends the move on the specified layer, if any. /// </summary> /// <param name="layer"></param> /// <returns></returns> public bool End(MoveLayer layer) { return(End(Layers[layer])); }
/// <summary> /// Returns the active move on the specified layer, if any. /// </summary> /// <param name="layer">The specified layer.</param> /// <returns></returns> public Move Get(MoveLayer layer) { return(Layers[layer]); }