Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.List;
- import java.util.concurrent.atomic.AtomicReference;
- class BoulderDash
- {
- // private static Element[][] array;
- private static Player player;
- private static GUI gui;
- private static Element[][] field1;
- private static Boulder boulder;
- private static Monster monster;
- private static int roundCount;
- public static void main(String[] args)
- {
- List<List<String>> fields = MapProvider.loadMaps();
- MapParser mapParser = new MapParser();
- AtomicReference<Player> ref = new AtomicReference<Player>();
- field1 = mapParser.parseMap(fields.get(0),ref);
- player = ref.get();
- gui = new GUI();
- gui.setLevel(1, field1);
- //PlayerMovement();
- roundCount = 0;
- while(player.isAlive())
- {
- GUI.Key key = gui.step();
- player.setKey(key);
- player.performTurn();
- gui.update(field1, player.getScore());
- if (roundCount == 10)
- {
- for(int i = mapParser.getLine()-1; i >= 0; i--)
- {
- for(int j = mapParser.getColumn()-1; j >= 0; j--)
- {
- field1[i][j].performTurn();
- gui.update(field1, player.getScore());
- }
- }
- roundCount = 0;
- }
- roundCount++;
- }
- }
- /* public static void PlayerMovement ()
- {
- while(player.isAlive())
- {
- GUI.Key key = gui.step();
- player.setKey(key);
- player.performTurn();
- gui.update(field1, player.getScore());
- }
- } */
- }
Add Comment
Please, Sign In to add comment