diff options
author | Aidan Ross <aross02@fairport.org> | 2023-05-09 12:24:36 +0000 |
---|---|---|
committer | Aidan Ross <aross02@fairport.org> | 2023-05-09 12:24:36 +0000 |
commit | 107ef4c16d8007559a4de7c68f590df92f8f415f (patch) | |
tree | cf7034c268042ba4ae3a7a381e08cec13d665f98 /NoteField.java | |
parent | 0ae3c4ebc744de27dfaffa73c30659724b66dc29 (diff) | |
download | NPEhero-107ef4c16d8007559a4de7c68f590df92f8f415f.tar.gz NPEhero-107ef4c16d8007559a4de7c68f590df92f8f415f.tar.bz2 NPEhero-107ef4c16d8007559a4de7c68f590df92f8f415f.zip |
Here's all the classes I needed to make the lane test work.
Diffstat (limited to 'NoteField.java')
-rw-r--r-- | NoteField.java | 34 |
1 files changed, 34 insertions, 0 deletions
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; + } +} |