diff --git a/bin/RabiClone.jar b/bin/RabiClone.jar index a5c1e01..e420111 100644 Binary files a/bin/RabiClone.jar and b/bin/RabiClone.jar differ diff --git a/src/sig/RabiClone.java b/src/sig/RabiClone.java index 49242c4..8703e0c 100644 --- a/src/sig/RabiClone.java +++ b/src/sig/RabiClone.java @@ -49,9 +49,9 @@ public class RabiClone{ public static int BASE_WIDTH = 512; public static int BASE_HEIGHT = 288; - public static int EVENT_BOUNDARY_RANGE = 8; + public static final int EVENT_BOUNDARY_RANGE = 8; public static int SIZE_MULTIPLIER = 1; - public static Point MOUSE_POS; + public static final Point MOUSE_POS = new Point(0,0); public static boolean PLAYER_COLLISION[] = new boolean[RabiClone.BASE_WIDTH*RabiClone.BASE_HEIGHT]; public static boolean ENEMY_COLLISION[] = new boolean[RabiClone.BASE_WIDTH*RabiClone.BASE_HEIGHT]; @@ -105,8 +105,6 @@ public class RabiClone{ p = new Panel(f); - MOUSE_POS = p.mousePos; - p.init(); f.add(p); diff --git a/src/sig/engine/Panel.java b/src/sig/engine/Panel.java index eb7bd53..89ddd87 100644 --- a/src/sig/engine/Panel.java +++ b/src/sig/engine/Panel.java @@ -45,7 +45,6 @@ public class Panel extends JPanel implements Runnable,KeyListener { final long TARGET_FRAMETIME = 8333333l; public double nanaX = 0; public double nanaY = 0; - public Point mousePos=new Point(0,0); public int button = 0; public HashMap MOUSE = new HashMap<>(); public static byte[] generalPalette = new byte[]{ @@ -129,7 +128,7 @@ public class Panel extends JPanel implements Runnable,KeyListener { @Override public void mousePressed(MouseEvent e) { MOUSE.put(e.getButton(),true); - mousePos.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); + RabiClone.MOUSE_POS.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); //System.out.println("Mouse List: "+MOUSE); for(int i=0; i=((int)(this.getX()/RabiClone.BASE_WIDTH)*RabiClone.BASE_WIDTH)/Tile.TILE_WIDTH && + y<((int)(this.getY()/RabiClone.BASE_HEIGHT+1)*RabiClone.BASE_HEIGHT)/Tile.TILE_HEIGHT && y>=((int)(this.getY()/RabiClone.BASE_HEIGHT)*RabiClone.BASE_HEIGHT)/Tile.TILE_HEIGHT + ) { + if (!RabiClone.CURRENT_MAP.getDataTile(x,y).getEvent().performScreenLoad(x*Tile.TILE_WIDTH,y*Tile.TILE_HEIGHT)) { + RabiClone.CURRENT_MAP.ModifyDataTile(x, y, DataTile.NULL); + } + } } } if ((staggerTimer-=updateMult)<=0) {