aboutsummaryrefslogtreecommitdiff
path: root/src/fallTest/Timer.java
diff options
context:
space:
mode:
authorAidan Ross <aross02@fairport.org>2023-05-24 17:02:47 -0400
committerAidan Ross <aross02@fairport.org>2023-05-24 17:02:47 -0400
commitcc6ed32bb9da1319834d06d78cee7a8c4050334e (patch)
tree4da7daa578e7bd8e3a0b44bbb3698c54cdbb97b2 /src/fallTest/Timer.java
parent7bec9556788656ab643d5621d0598c258a54e2ef (diff)
downloadNPEhero-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 '')
-rw-r--r--src/fallTest/Timer.java11
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);
}
}