From f89d776c40eb49992b5d65ed8cfa111328e75208 Mon Sep 17 00:00:00 2001 From: sowgro Date: Thu, 25 May 2023 08:34:18 -0400 Subject: rename gameplay package --- src/gameplay/Timer.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/gameplay/Timer.java (limited to 'src/gameplay/Timer.java') diff --git a/src/gameplay/Timer.java b/src/gameplay/Timer.java new file mode 100644 index 0000000..1de576b --- /dev/null +++ b/src/gameplay/Timer.java @@ -0,0 +1,24 @@ +/*Name: Guitar Hero Project + *Description: Contains the method used to determine how long the user has been playing, + * used to determine when to send notes + */ +package gameplay; + + +public class Timer +{ + private long timeStart = System.currentTimeMillis(); + private int bpm; + + public Timer(int newBpm) { + bpm = newBpm; + } + + public Timer() { + bpm = 60000; + } + + public double time() { + return ((double)(System.currentTimeMillis()-timeStart))*(bpm/60000.0); + } +} -- cgit v1.2.3