Last active
October 27, 2015 23:53
-
-
Save AnnaBoro/603c70d33cb164badb94 to your computer and use it in GitHub Desktop.
lesson4-Bullet-Frame4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lesson4; | |
/** | |
* Created by anna on 27.10.15. | |
*/ | |
public class Bullet { | |
private int x = -100; | |
private int y = -100; | |
private int speed = 5; | |
private int direction; | |
public Bullet(int x, int y, int direction) { | |
this.x = x; | |
this.y = y; | |
this.direction = direction; | |
} | |
public int getX() { | |
return x; | |
} | |
public int getY() { | |
return y; | |
} | |
public int getSpeed() { | |
return speed; | |
} | |
public int getDirection() { | |
return direction; | |
} | |
public void updateX(int i) { | |
x += i; | |
} | |
public void updateY(int i) { | |
y += i; | |
} | |
public void destroy() { | |
x = -100; | |
y = -100; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment