Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

Commit

Permalink
Metronome icon follows BPM
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislo27 committed Jun 20, 2017
1 parent 1710bc7 commit 6290504
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/chrislo27/rhre/editor/EditorStageSetup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ class EditorStageSetup(private val screen: EditorScreen) {

override fun render(batch: SpriteBatch, alpha: Float) {
if (screen.editor.remix.tickEachBeat) {
val time = 1.25f
val time = if (screen.editor.remix.playingState == PlayingState.PLAYING)
(120f / screen.editor.remix.tempoChanges.getTempoAt(screen.editor.remix.beat))
else 1.25f
this.textureRegion = metronomeFrames[(MathHelper.getSawtoothWave(
System.currentTimeMillis() - start + (time / metronomeFrames.size * 1000).toInt(), time)
* metronomeFrames.size)
Expand Down

0 comments on commit 6290504

Please sign in to comment.