Make up to half a screen away preload events
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
52aa0053ae
commit
48fb23865d
@ -42,6 +42,7 @@ public class RabiClone {
|
|||||||
|
|
||||||
public static int BASE_WIDTH = 512;
|
public static int BASE_WIDTH = 512;
|
||||||
public static int BASE_HEIGHT = 288;
|
public static int BASE_HEIGHT = 288;
|
||||||
|
public static int EVENT_BOUNDARY_RANGE = 8;
|
||||||
public static int SIZE_MULTIPLIER = 1;
|
public static int SIZE_MULTIPLIER = 1;
|
||||||
public static Point MOUSE_POS;
|
public static Point MOUSE_POS;
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@ package sig.objects;
|
|||||||
|
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
|
|
||||||
import javax.xml.crypto.Data;
|
|
||||||
|
|
||||||
import sig.RabiClone;
|
import sig.RabiClone;
|
||||||
import sig.engine.Action;
|
import sig.engine.Action;
|
||||||
import sig.engine.Alpha;
|
import sig.engine.Alpha;
|
||||||
@ -31,11 +29,11 @@ public class LevelRenderer extends Object{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(double updateMult) {
|
public void update(double updateMult) {
|
||||||
for (int y=(int)(this.getY()/Tile.TILE_HEIGHT);y<(int)(RabiClone.BASE_HEIGHT/Tile.TILE_HEIGHT+this.getY()/Tile.TILE_HEIGHT+1);y++) {
|
for (int y=(int)(this.getY()/Tile.TILE_HEIGHT)-RabiClone.EVENT_BOUNDARY_RANGE;y<(int)(RabiClone.BASE_HEIGHT/Tile.TILE_HEIGHT+this.getY()/Tile.TILE_HEIGHT+1+RabiClone.EVENT_BOUNDARY_RANGE);y++) {
|
||||||
if (y<0||y>Map.MAP_HEIGHT) {
|
if (y<0||y>Map.MAP_HEIGHT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int x=(int)(0+this.getX()/Tile.TILE_WIDTH);x<(int)(RabiClone.BASE_WIDTH/Tile.TILE_WIDTH+this.getX()/Tile.TILE_WIDTH+1);x++) {
|
for (int x=(int)(0+this.getX()/Tile.TILE_WIDTH)-RabiClone.EVENT_BOUNDARY_RANGE;x<(int)(RabiClone.BASE_WIDTH/Tile.TILE_WIDTH+this.getX()/Tile.TILE_WIDTH+1+RabiClone.EVENT_BOUNDARY_RANGE);x++) {
|
||||||
if (x<0||x>Map.MAP_WIDTH) {
|
if (x<0||x>Map.MAP_WIDTH) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user