Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Part_1;
- public class Projectile extends Thread {
- int x;
- int y;
- int dx = 1;
- int dy = 7;
- int explodeTime = 15;
- public void run() {
- while (true) {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // Move forward
- x = x + dx;
- y = y + dy;
- dy = dy -1;
- if (y == 0) {
- ////////////
- }
- // if (x = 15) or (y = 15) {
- // x = 0; y = 0;
- // }
- }
- }
- public void explode() {
- System.out.println("EXPLOSION");
- }
- public void reset() {
- dy = 0;
- dx = 0;
- }
- public String t0String() {
- return "X="+x+" y="+y;
- // if (timerSeconds
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement