diff --git a/MerchantRPGCSE2102/src/controller/RPGame.java b/MerchantRPGCSE2102/src/controller/RPGame.java index 7894242..e8b9867 100644 --- a/MerchantRPGCSE2102/src/controller/RPGame.java +++ b/MerchantRPGCSE2102/src/controller/RPGame.java @@ -21,7 +21,7 @@ public class RPGame { private ArrayList playerInventoryList = new ArrayList(); // the player's inventory list private Player _player; private Merchant _merchant1, _merchant2, _merchant3; - private boolean _movement; + public boolean _movement; private int _currentDay; private int _transactionLimit; diff --git a/MerchantRPGCSE2102/src/view/MapUI.java b/MerchantRPGCSE2102/src/view/MapUI.java index bb04f55..f422ac5 100644 --- a/MerchantRPGCSE2102/src/view/MapUI.java +++ b/MerchantRPGCSE2102/src/view/MapUI.java @@ -24,6 +24,7 @@ public class MapUI extends JPanel { public RPGame game; private PlayerSprite player; private ArrayList merchants = new ArrayList(); + private boolean _tranState=game._movement; public MapUI(Map map,RPGame Game) { @@ -100,11 +101,22 @@ public void addMerchantSprite(int row, int col) { public void createPlayerSprite(int row, int col) { player = new PlayerSprite(this, row, col); } + + public void changeState(){ + + } /** * Moves the PlayerSprite as well as the Map's instance of Player */ public void move() { + //check transaction + if (_tranState=false){ + + } + else{ + + player.move(); // Every 30 pixels, the player will move to a new Vertex @@ -128,6 +140,7 @@ public void move() { map.movePlayer("south"); player.setChangeInY(1); } + } } public Map getMap() {