Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
lul11003 committed Apr 11, 2015
1 parent cebba3b commit 46c56e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MerchantRPGCSE2102/src/controller/RPGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class RPGame {
private ArrayList<String> playerInventoryList = new ArrayList<String>(); // 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;

Expand Down
13 changes: 13 additions & 0 deletions MerchantRPGCSE2102/src/view/MapUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class MapUI extends JPanel {
public RPGame game;
private PlayerSprite player;
private ArrayList<MerchantSprite> merchants = new ArrayList<MerchantSprite>();
private boolean _tranState=game._movement;


public MapUI(Map map,RPGame Game) {
Expand Down Expand Up @@ -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
Expand All @@ -128,6 +140,7 @@ public void move() {
map.movePlayer("south");
player.setChangeInY(1);
}
}
}

public Map getMap() {
Expand Down

0 comments on commit 46c56e0

Please sign in to comment.