-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFallBackground.java
42 lines (36 loc) · 919 Bytes
/
FallBackground.java
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
35
36
37
38
39
40
41
42
//This is unneeded now. See FallDown.java, and FallDownBoard.java for the game.
import java.awt.Color;
import wheels.users.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class FallBackground{
private Rectangle background;
FallDownBoard f;
public FallBackground(){
background = new Rectangle(Color.black);
f = new FallDownBoard(25,15);
background.setLocation(210,20);
background.setSize(270,450);
f.fillPlats(3);
f.display(210,20,18);
}
public FallDownBoard getBoard(){
return f;
}
public static void main(String[] args){
FallBackground app = new FallBackground();
}
public void keyPressed (KeyEvent ke) {
switch (ke.getKeyCode()){
case KeyEvent.VK_LEFT:
f.moveLeft();
break;
case KeyEvent.VK_RIGHT:
f.moveRight();
break;
case KeyEvent.VK_ENTER:
f.start();
break;
}
}
}