Ejemplo n.º 1
0
 public DanceScene(String scriptname)
 {
     this.script = ContentScript.FromFile(scriptname);
     this.textures = new TextureContext();
     this.sequences = new DanceSequenceProtocol();
     this.background = new DanceBackground();
     this.ui = new IngameUI();
 }
        public DanceSceneAnimationBundle(TextureContext textures, Song song)
        {
            this.opponent = new Dictionary<InputState.Move, ButtonAnimation>();
            this.player = new Dictionary<PlayerProgress.Rating, Dictionary<InputState.Move, ButtonAnimation>>();
            this.player[PlayerProgress.Rating.OK] = new Dictionary<InputState.Move, ButtonAnimation>();
            this.player[PlayerProgress.Rating.GOOD] = new Dictionary<InputState.Move, ButtonAnimation>();
            this.player[PlayerProgress.Rating.PERFECT] = new Dictionary<InputState.Move, ButtonAnimation>();
            this.fail = new Dictionary<InputState.Move, ButtonAnimation>();

            long length = (long)song.beatTimeInMs;
            this.setup(this.opponent, textures, Color.LightBlue, length);
            this.setup(this.player[PlayerProgress.Rating.OK], textures, Color.Yellow, length);
            this.setup(this.player[PlayerProgress.Rating.GOOD], textures, Color.Green, length);
            this.setup(this.player[PlayerProgress.Rating.PERFECT], textures, Color.Lime, length);

            this.setup(this.fail, textures, Color.Black, length, new string[]{"btn_fail"});
        }
 private void setup(Dictionary<InputState.Move, ButtonAnimation> animationSet,
         TextureContext textures, Color color, long length,
         string[] textureNames)
 {
     animationSet[InputState.Move.UP] = new ButtonAnimation(
         textures.getRaw(textureNames[0 % textureNames.Length]), new Vector2(0, -1 * CENTER_OFFSET + Y_OFFSET), color, length);
     animationSet[InputState.Move.LEFT] = new ButtonAnimation(
         textures.getRaw(textureNames[1 % textureNames.Length]), new Vector2(-1 * CENTER_OFFSET, Y_OFFSET), color, length);
     animationSet[InputState.Move.RIGHT] = new ButtonAnimation(
         textures.getRaw(textureNames[2 % textureNames.Length]), new Vector2(CENTER_OFFSET, Y_OFFSET), color, length);
     animationSet[InputState.Move.DOWN] = new ButtonAnimation(
         textures.getRaw(textureNames[3 % textureNames.Length]), new Vector2(0, CENTER_OFFSET + Y_OFFSET), color, length);
 }
 private void setup(Dictionary<InputState.Move, ButtonAnimation> animationSet, 
         TextureContext textures, Color color, long length)
 {
     this.setup(animationSet, textures, color, length,
         new string[]{"btn_up", "btn_left", "btn_right", "btn_down"});
 }