Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import enigma.console.Console;
- import enigma.console.TextAttributes;
- import enigma.console.TextWindow;
- import enigma.core.Enigma;
- import java.awt.*;
- public class BigCity {
- static Console console = Enigma.getConsole("Big City", 80, 25, 16, 2);
- static TextWindow tw = console.getTextWindow();
- static char[][] map = new char[21][57];
- public static void createMap() {
- String mapCode =
- "#########################################################\n" +
- "#A══════#####B═══════════╗#####C═════╦═══════════D#######\n" +
- "#║###########║###########║#####║#####║###########║#######\n" +
- "#║###########║###########║#####║#####║###########║#######\n" +
- "#║###########║###########║#####║▓▓▓▓▓║###########║#######\n" +
- "#║###########║###########║#####║▓▓▓▓▓║###########║#######\n" +
- "#║###########║###########║#####║▓▓▓▓▓║###########║#######\n" +
- "#E═══════════F═════╦═════╩═════G▓▓▓▓▓╠═════╦═════H═════╗#\n" +
- "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
- "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
- "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
- "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
- "#║###########║▓▓▓▓▓║###########║▓▓▓▓▓║#####║###########║#\n" +
- "#I═════╦═════J═════╬═══════════K═════╬═════L#####╔═════╝#\n" +
- "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
- "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
- "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
- "#######║▓▓▓▓▓║▓▓▓▓▓║###########║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
- "▓▓▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓║▓▓▓▓▓▓▓\n" +
- "▓══════M═════N═════╝▓▓▓▓▓══════O═════╩═════P═════╩══════▓\n" +
- "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓";
- // Change later
- mapCode = mapCode.replaceAll("#", "#");
- mapCode = mapCode.replaceAll("▓", "#");
- // Filling up static map array
- String [] mapArray = mapCode.split("\n");
- for (int i = 0; i<21;i++){
- for (int j= 0; j<57;j++){
- map[i][j]=mapArray[i].charAt(j);
- }
- }
- }
- public static void update() {
- // Draw values on screen
- // Print Map
- for (int i = 0 ; i<21;i++){
- for (int j=0;j<57;j++){
- tw.setCursorPosition(j,i);
- if (map[i][j]=='#')
- console.setTextAttributes(new TextAttributes(Color.gray));
- else
- console.setTextAttributes(new TextAttributes(Color.white));
- System.out.print(map[i][j]);
- }
- }
- // Print buses and passengers
- // Print right-side infos
- // Print time
- }
- public static void tick() {
- // Updates all values.
- }
- public static void main(String[] args) {
- createMap();
- while(true){
- tick();
- update();
- }
- }
- }
Add Comment
Please, Sign In to add comment