public DrawableVitaruPlayer(VitaruPlayer player) : base(player) { this.player = player; //Gross Key stuff keys[Key.Up] = false; keys[Key.Right] = false; keys[Key.Down] = false; keys[Key.Left] = false; keys[Key.Z] = false; keys[Key.X] = false; keys[Key.LShift] = false; keys[Key.RShift] = false; Origin = Anchor.Centre; Position = player.Position; CharacterType = HitObjectType.Player; CharacterHealth = 100; Team = 0; HitboxColor = Color4.Yellow; HitboxWidth = 4; CharacterShoot = shoot; }
protected override IEnumerable <VitaruHitObject> ConvertHitObject(HitObject original, Beatmap beatmap) { var curveData = original as IHasCurve; var endTimeData = original as IHasEndTime; var positionData = original as IHasPosition; var comboData = original as IHasCombo; if (!playerLoaded) { playerLoaded = true; DrawableCharacter.AssetsLoaded = false; VitaruPlayer player; yield return(player = new VitaruPlayer(hitRenderer) { Position = VitaruHitRenderer.DefaultPlayerPosition, StartTime = 0f, }); if (hitRenderer != null) { hitRenderer.Player = player; } } if (curveData != null) { yield return(new Enemy(hitRenderer) { StartTime = original.StartTime, Samples = original.Samples, ControlPoints = curveData.ControlPoints, CurveType = curveData.CurveType, Distance = curveData.Distance, RepeatSamples = curveData.RepeatSamples, RepeatCount = curveData.RepeatCount, Position = positionData?.Position ?? Vector2.Zero, NewCombo = comboData?.NewCombo ?? false, IsSlider = true, }); } else if (endTimeData != null) { yield return(new Enemy(hitRenderer) { StartTime = original.StartTime, Samples = original.Samples, //EndTime = endTimeData.EndTime, //IsSpinner = true, Position = positionData?.Position ?? VitaruPlayfield.BASE_SIZE / 2, }); } else { yield return(new Enemy(hitRenderer) { StartTime = original.StartTime, Samples = original.Samples, Position = positionData?.Position ?? Vector2.Zero, NewCombo = comboData?.NewCombo ?? false, }); } }