public DirectionalIndicator(
                ContentUtil content, 
                InputState.Move move,
                float beatTimeInMs,
                float travelSpeed)
        {
            this.recordings = new List<RecordedStart>();
            this.color = Color.White;
            this.move = move;
            this.beatTimeInMs = beatTimeInMs;
            this.travelSpeed = travelSpeed;
            String texName = "hud/arrow_" + move.ToString().ToLower();
            this.texture = new ScaledTexture(
                content.load<Texture2D>(texName), TEXTURE_SCALE);
            switch (move) {
                case InputState.Move.UP:
                    this.direction = new Vector2(0, 1);
                    break;
                case InputState.Move.DOWN:
                    this.direction = new Vector2(0, -1);
                    break;
                case InputState.Move.LEFT:
                    this.direction = new Vector2(1, 0);
                    break;
                case InputState.Move.RIGHT:
                    this.direction = new Vector2(-1, 0);
                    break;
            }

            this.isMoving = false;
        }
Esempio n. 2
0
        public void initialize(ContentUtil content, SceneActivationParameters parameters)
        {
            HighscoreParams stageParams = (HighscoreParams) parameters.parameters;
            this.stageName = stageParams.stage;
            this.nextScore = stageParams.newScore;

            this.showInputSound = new Sound("menu/select", content);
            this.createSound = new Sound("menu/click", content);

            this.background = content.load<Texture2D>(null == stageParams.background ?
                "bgr_highscore" : stageParams.background);

            this.lineBackground = new ScaledTexture(content.load<Texture2D>(
                null == stageParams.background ? "hud/highscore_line" : stageParams.background+"_line"),
                .4f);

            this.scores = new HighscoreList();
            this.scores.loadForScene(stageName);
            this.exit = false;

            this.nameInput = new TextInput();

            /*if (null == this.nextScore) {
                this.nextScore = new PlayerProgress();
                this.nextScore.score = 4321;
            }*/
            if (null != this.nextScore) {
                this.nameInput.setMessage("You scored "
                        + this.nextScore.score
                        + ". Please enter your name.");
                this.showInputSound.play();
                this.nameInput.startListening();
            }

            //this.scores.add(new Scoring("Batman", this.nextScore.score, true));
            this.initTime = Environment.TickCount;
        }
Esempio n. 3
0
 public override void initialize(Sound click, Sound select,
             ScaledTexture texDeactivated, ScaledTexture texActivated)
 {
     base.initialize(click, select, texDeactivated, texActivated);
     this.active = false;
     this.selectedIndex = 0;
     foreach (MenuItem item in this.items) {
         item.initialize(click, select, texDeactivated, texActivated);
     }
 }
Esempio n. 4
0
 public virtual void initialize(Sound click, Sound select,
             ScaledTexture texDeactivated, ScaledTexture texActivated)
 {
     this.clickSound = click;
     this.selectSound = select;
     this._nextScene = false;
     this.selected = false;
     this.texDeactivated = texDeactivated;
     this.texActivated = texActivated;
 }
Esempio n. 5
0
 private ScaledTexture[][] loadButtonTextures(ContentUtil content)
 {
     ScaledTexture[][] textures = new ScaledTexture[4][];
     for (int i = 0; i < textures.Length; i++) {
         textures[i] = new ScaledTexture[2];
         textures[i][0] = new ScaledTexture(
             content.load<Texture2D>("menu/button" + (i + 1) + "_deactivated"),
             .5f);
         textures[i][1] = new ScaledTexture(
             content.load<Texture2D>("menu/button" + (i + 1) + "_activated"),
             .5f);
     }
     return textures;
 }