aboutsummaryrefslogtreecommitdiff
path: root/NoteTest.java
diff options
context:
space:
mode:
authorAidan Ross <aross02@fairport.org>2023-05-03 12:56:39 +0000
committerAidan Ross <aross02@fairport.org>2023-05-03 12:56:39 +0000
commitff2fa62df5e80f9ef053297afdd65254b5044d60 (patch)
tree33ed6c3b45b2bb131b55b0a53f7a61804fa345d9 /NoteTest.java
parentbbd867a635cb931a7cd36ddc960ab1a3911ae827 (diff)
downloadNPEhero-ff2fa62df5e80f9ef053297afdd65254b5044d60.tar.gz
NPEhero-ff2fa62df5e80f9ef053297afdd65254b5044d60.tar.bz2
NPEhero-ff2fa62df5e80f9ef053297afdd65254b5044d60.zip
Very rudimentary code for making an object fall from the top of the screen
Diffstat (limited to '')
-rw-r--r--NoteTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/NoteTest.java b/NoteTest.java
new file mode 100644
index 0000000..dd38b72
--- /dev/null
+++ b/NoteTest.java
@@ -0,0 +1,35 @@
+/*Name:
+ *Date:
+ *Period:
+ *Teacher:
+ *Description:
+ */
+package cs;
+import java.awt.*;
+
+public class NoteTest
+{
+ private boolean failed = false;
+ private int lane;
+ private final int NOTESPEED = 1;
+ private int yPos = SongPlayer.HEIGHT;
+
+ public void gameTick() {
+ if (!failed) {
+ if (yPos > 0) {
+ yPos -= NOTESPEED;
+ }
+ else {
+ failed = true;
+ }
+ }
+ }
+
+ public boolean getFailed() {
+ return failed;
+ }
+
+ public int getY() {
+ return yPos;
+ }
+}