Create test backgrounds
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
1a042429ce
commit
5a5eb5f2fb
BIN
backgrounds/back1.gif
Normal file
BIN
backgrounds/back1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
BIN
backgrounds/back2.gif
Normal file
BIN
backgrounds/back2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
BIN
backgrounds/back3.gif
Normal file
BIN
backgrounds/back3.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
BIN
maps/world1.map
BIN
maps/world1.map
Binary file not shown.
@ -20,6 +20,10 @@ public class DrawLoop {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<RabiClone.OBJ.size();i++) {
|
||||
RabiClone.OBJ.get(i).drawBackground(p);
|
||||
}
|
||||
|
||||
for (int i=0;i<RabiClone.OBJ.size();i++) {
|
||||
RabiClone.OBJ.get(i).draw(p);
|
||||
}
|
||||
|
||||
18
src/sig/engine/Background.java
Normal file
18
src/sig/engine/Background.java
Normal file
@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -47,6 +47,9 @@ public abstract class Object implements GameEntity{
|
||||
this.spr = spr;
|
||||
}
|
||||
|
||||
public void drawBackground(byte[] p) {
|
||||
}
|
||||
|
||||
public void drawOverlay(byte[] p) {
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +39,15 @@ public class LevelRenderer extends Object{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(byte[] p) {
|
||||
for (int y=0;y<RabiClone.BASE_HEIGHT;y++) {
|
||||
for (int x=0;x<RabiClone.BASE_WIDTH;x++) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawMapTileForEditorMode(int x, int y) {}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user