From 49203cc510dc71f20650e9a4eb0ed717d0df7933 Mon Sep 17 00:00:00 2001 From: Aidan Ross Date: Wed, 10 May 2023 12:16:21 +0000 Subject: Working version of the 5 lane test, with a test map to play as well --- NoteField.java | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 NoteField.java (limited to 'NoteField.java') diff --git a/NoteField.java b/NoteField.java new file mode 100644 index 0000000..b54e33a --- /dev/null +++ b/NoteField.java @@ -0,0 +1,34 @@ +/*Name: Guitar Hero Project + *Description: Contains the information for a single note on the field + */ +package cs; + +public class NoteField +{ + private boolean failed = false; + private final int NOTESPEED = 5; + private int yPos = SongPlayer.HEIGHT; + + public void gameTick() { + if (!failed) { + if (yPos > 0) { + yPos -= NOTESPEED; + } + else { + failed = true; + } + } + } + + public int goalDistance() { + return (yPos-((SongPlayer.HEIGHT)/6)); + } + + public boolean getFailed() { + return failed; + } + + public int getY() { + return yPos; + } +} -- cgit v1.2.3