Guest User

Untitled

a guest
Mar 21st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. import enigma.console.Console;
  2. import enigma.console.TextAttributes;
  3. import enigma.console.TextWindow;
  4. import enigma.core.Enigma;
  5.  
  6. import java.awt.*;
  7.  
  8. public class BigCity {
  9. static Console console = Enigma.getConsole("Big City", 80, 25, 16, 2);
  10. static TextWindow tw = console.getTextWindow();
  11. static char[][] map = new char[21][57];
  12. public static void createMap() {
  13. String mapCode =
  14. "#########################################################\n" +
  15. "#A══════#####B═══════════╗#####C═════╦═══════════D#######\n" +
  16. "#║###########║###########║#####║#####║###########║#######\n" +
  17. "#║###########║###########║#####║#####║###########║#######\n" +
  18. "#║###########║###########║#####║▓▓▓▓▓║###########║#######\n" +
  19. "#║###########║###########║#####║▓▓▓▓▓║###########║#######\n" +
  20. "#║###########║###########║#####║▓▓▓▓▓║###########║#######\n" +
  21. "#E═══════════F═════╦═════╩═════G▓▓▓▓▓╠═════╦═════H═════╗#\n" +
  22. "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
  23. "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
  24. "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
  25. "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
  26. "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
  27. "#I═════╦═════J═════╬═══════════K═════╬═════L#####╔═════╝#\n" +
  28. "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
  29. "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
  30. "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
  31. "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
  32. "▓▓▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
  33. "▓══════M═════N═════╝▓▓▓▓▓══════O═════╩═════P═════╩══════▓\n" +
  34. "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓";
  35. // Change later
  36. mapCode = mapCode.replaceAll("#", "#");
  37. mapCode = mapCode.replaceAll("▓", "#");
  38.  
  39. // Filling up static map array
  40. String [] mapArray = mapCode.split("\n");
  41. for (int i = 0; i<21;i++){
  42. for (int j= 0; j<57;j++){
  43. map[i][j]=mapArray[i].charAt(j);
  44. }
  45. }
  46. }
  47.  
  48. public static void update() {
  49. // Draw values on screen
  50. // Print Map
  51. for (int i = 0 ; i<21;i++){
  52. for (int j=0;j<57;j++){
  53. tw.setCursorPosition(j,i);
  54. if (map[i][j]=='#')
  55. console.setTextAttributes(new TextAttributes(Color.gray));
  56. else
  57. console.setTextAttributes(new TextAttributes(Color.white));
  58. System.out.print(map[i][j]);
  59. }
  60. }
  61. // Print buses and passengers
  62.  
  63. // Print right-side infos
  64.  
  65. // Print time
  66. }
  67.  
  68. public static void tick() {
  69. // Updates all values.
  70. }
  71.  
  72. public static void main(String[] args) {
  73. createMap();
  74. while(true){
  75. tick();
  76. update();
  77. }
  78. }
  79. }
Add Comment
Please, Sign In to add comment