Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>main
parent
5a5eb5f2fb
commit
0f94b0396d
Binary file not shown.
@ -1,18 +0,0 @@ |
||||
package sig.engine; |
||||
|
||||
import java.io.File; |
||||
|
||||
public class Background extends Sprite{ |
||||
|
||||
public static Sprite BACKGROUND_1 = new Background(0.02,new File(new File("..","backgrounds"),"back1.gif")); |
||||
public static Sprite BACKGROUND_2 = new Background(0.02,new File(new File("..","backgrounds"),"back2.gif")); |
||||
public static Sprite BACKGROUND_3 = new Background(0.05,new File(new File("..","backgrounds"),"back3.gif")); |
||||
|
||||
double scrollAmt; //How many pixels to scroll the background per pixel of offset provided.
|
||||
|
||||
Background(double scrollAmt,File filename) { |
||||
super(filename); |
||||
this.scrollAmt=scrollAmt; |
||||
} |
||||
|
||||
} |
@ -1,5 +1,33 @@ |
||||
package sig.map; |
||||
|
||||
import sig.engine.Sprite; |
||||
|
||||
public enum Background { |
||||
DEFAULT |
||||
BACKGROUND1(Sprite.BACKGROUND1,0.02), |
||||
BACKGROUND2(Sprite.BACKGROUND2,0.02), |
||||
BACKGROUND3(Sprite.BACKGROUND3,0.05); |
||||
|
||||
Sprite background; |
||||
double scrollSpd; //Amount of pixels to move the background based on pixel offset provided.
|
||||
|
||||
Background(Sprite background,double scrollSpd) { |
||||
this.background=background; |
||||
this.scrollSpd=scrollSpd; |
||||
} |
||||
|
||||
public byte[] getPixels() { |
||||
return background.getBi_array(); |
||||
} |
||||
|
||||
public int getWidth() { |
||||
return background.getWidth(); |
||||
} |
||||
|
||||
public int getHeight() { |
||||
return background.getHeight(); |
||||
} |
||||
|
||||
public double getScrollSpeed() { |
||||
return scrollSpd; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue