diff options
author | Aidan Ross <aross02@fairport.org> | 2023-05-24 17:02:47 -0400 |
---|---|---|
committer | Aidan Ross <aross02@fairport.org> | 2023-05-24 17:02:47 -0400 |
commit | cc6ed32bb9da1319834d06d78cee7a8c4050334e (patch) | |
tree | 4da7daa578e7bd8e3a0b44bbb3698c54cdbb97b2 /src/fallTest/Timer.java | |
parent | 7bec9556788656ab643d5621d0598c258a54e2ef (diff) | |
download | NPEhero-cc6ed32bb9da1319834d06d78cee7a8c4050334e.tar.gz NPEhero-cc6ed32bb9da1319834d06d78cee7a8c4050334e.tar.bz2 NPEhero-cc6ed32bb9da1319834d06d78cee7a8c4050334e.zip |
Instead of timestamps, notes are now sent in by beats, which are based off of the song's bpm.
Diffstat (limited to 'src/fallTest/Timer.java')
-rw-r--r-- | src/fallTest/Timer.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fallTest/Timer.java b/src/fallTest/Timer.java index 2ad7efe..d8fd2e3 100644 --- a/src/fallTest/Timer.java +++ b/src/fallTest/Timer.java @@ -8,8 +8,13 @@ package fallTest; public class Timer { private long timeStart = System.currentTimeMillis(); - - public int time() { - return (int)(System.currentTimeMillis()-timeStart); + private int bpm; + + public Timer(int newBpm) { + bpm = newBpm; + } + + public double time() { + return ((double)(System.currentTimeMillis()-timeStart))*(bpm/60000.0); } } |