Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Image;
- public class Enemy {
- private float x, y, vx, vy;
- private Image i;
- private Level l;
- // constructor
- public Enemy(Image i, float x, float y, Level l) {
- this.i = i;
- this.x = (int) (750 * Math.random());
- this.y = y;
- this.l = l;
- }
- // get x position
- public float getX() {
- return x;
- }
- // get y position
- public float getY() {
- return y;
- }
- // set Enemy x position
- public void setX(float x) {
- this.x = x;
- }
- // set Enemy y position
- public void setY(float y) {
- this.y = y;
- }
- // get horizontal velocity
- public float getVelocityX() {
- return vx;
- }
- // get vertical velocity
- public float getVelocityY() {
- return vy;
- }
- // set horizontal velocity
- public void setVelocityX(float vx) {
- this.vx = vx;
- }
- // set vertical velocity
- public void setVelocityY(float vy) {
- this.vy = vy;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement