Create test backgrounds

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent 1a042429ce
commit 5a5eb5f2fb
  1. BIN
      backgrounds/back1.gif
  2. BIN
      backgrounds/back2.gif
  3. BIN
      backgrounds/back3.gif
  4. BIN
      maps/world1.map
  5. 4
      src/sig/DrawLoop.java
  6. 18
      src/sig/engine/Background.java
  7. 3
      src/sig/engine/Object.java
  8. 9
      src/sig/objects/LevelRenderer.java

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

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);
}

@ -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…
Cancel
Save