aboutsummaryrefslogtreecommitdiff
path: root/NoteField.java
blob: b54e33a053f40e5827dd3a8d81f373bd291b34c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
    }
}