diff --git a/maps/world1.map b/maps/world1.map index 88ae8c9..0798e2e 100644 Binary files a/maps/world1.map and b/maps/world1.map differ diff --git a/src/sig/engine/Object.java b/src/sig/engine/Object.java index 493e847..75edcbd 100644 --- a/src/sig/engine/Object.java +++ b/src/sig/engine/Object.java @@ -82,6 +82,12 @@ public abstract class Object implements GameEntity{ return panel.KEYS.getOrDefault(key,false); } + protected void KeyPressed(int key) { + } + + protected void KeyReleased(int key) { + } + protected boolean MouseHeld(int mb) { return panel.MOUSE.getOrDefault(mb,false); } diff --git a/src/sig/engine/Panel.java b/src/sig/engine/Panel.java index b026861..02a9cf1 100644 --- a/src/sig/engine/Panel.java +++ b/src/sig/engine/Panel.java @@ -421,12 +421,18 @@ public class Panel extends JPanel implements Runnable,KeyListener { @Override public void keyPressed(KeyEvent e) { KEYS.put(e.getKeyCode(),true); + for (int i=0;i=0&&index=0&&index=this.map.backgrounds.length) { + return Background.DEFAULT; + } else { + return Background.values()[this.map.backgrounds[index]]; + } + } + + public void setBackground(int x,int y,Background background) { + int index = (y/Tile.TILE_SCREEN_COUNT_Y)*(Map.MAP_WIDTH/Tile.TILE_WIDTH)+x/Tile.TILE_SCREEN_COUNT_X; + if (index>=0&&index