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; }
private void updateInternal(ExplicitInputState input) { if (this.hasExitState(input)) return; updatePauseState(input); this.song.calculateMetaInfo(); long time = this.song.timeRunningInMs; long deltaT = time - this.lastTime; this.lastTime = time; float measures = this.song.timeRunningInMeasures; float timeInSequence = -1.0f; this.currentSequence = sequences.atMeasure(measures); if (null != this.currentSequence) { timeInSequence = (measures - this.currentSequence.startMeasure) / this.currentSequence.length; if (this.currentSequence.isEnemyActive(measures)) { this.progress.errorInLastSequence = false; this.missed = 0; this.wrong = 0; InputState.Move move = this.currentSequence.getActiveMoveAt(measures); if (this.lastMove != move) this.enemy.activate(move); this.lastMove = move; } } this.background.update(measures, timeInSequence); PlayerProgress.RatedMoves rated = null; bool sequenceComplete = false; if ((null == this.currentSequence || this.currentSequence.playerInputAllowed(measures))) { rated = this.progress.nextRating(measures, this.currentSequence, input); if (rated.hasErrors()) { this.progress.errorInLastSequence = true; this.missed += rated.missed.Count; this.wrong += rated.wrong.Count; } if (input.lastMoveIsNew()) { this.player.activate(input.lastMove); this.progress.score -= rated.wrong.Count * 20; sequenceComplete = this.checkSequenceCompletion(rated, sequenceComplete); } } if (sequenceComplete) { this.progress.score += 100; } this.ui.update(rated, sequenceComplete, time, deltaT); this.player.update(deltaT); this.enemy.update(deltaT); }