Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package paxdevgame;
  2.  
  3. public class Background {
  4.    
  5.     private int bgX, bgY, speedX;
  6.    
  7.     public int getBgX() {
  8.         return bgX;
  9.     }
  10.     public int getBgY() {
  11.         return bgY;
  12.     }
  13.     public int getSpeedX() {
  14.         return speedX;
  15.     }
  16.     public void setBgX(int bgX) {
  17.         this.bgX = bgX;
  18.     }
  19.     public void setBgY(int bgY) {
  20.         this.bgY = bgY;
  21.     }
  22.     public void setSpeedX(int speedX) {
  23.         this.speedX = speedX;
  24.     }  
  25.    
  26.     public Background (int x, int y){
  27.            bgX = x;
  28.            bgY = y;
  29.            speedX = 0;
  30.         }
  31.    
  32.     public void update() {
  33.            bgX += speedX;
  34.  
  35.            if (bgX <= -2160){
  36.               bgX += 4320;
  37.            }
  38.         }
  39.    
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement