Advertisement
plattina

Bomberman Map Generator

May 6th, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.68 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5.  
  6. namespace CSharp_Shell
  7. {
  8.  
  9.     public static class Program
  10.     {
  11.         public static void Main()
  12.         {
  13.            MapGenerator.Map(12,14,"[]", "[]");
  14.         }
  15.     }
  16.    
  17.     public class MapGenerator
  18.     {
  19.         public static void Map(int lineCount, int columnCount, string wallChar, string blockChar)
  20.         {
  21.             Console.BackgroundColor = ConsoleColor.Green;
  22.             for(int x=0; x <= lineCount; x++)
  23.             {
  24.                 for (int y = 0; y <= columnCount; y++)
  25.                 {
  26.                     if((x == 0 || x == lineCount) || (y==0 || y==columnCount))
  27.                     {
  28.                         Instantiate(ConsoleColor.Blue, "[]");
  29.                     }
  30.                     else if (x %2 ==0 && y % 2 ==0)
  31.                     {
  32.                         Instantiate(ConsoleColor.Black, "[]");
  33.                     }
  34.                     else
  35.                     {
  36.                         Instantiate(ConsoleColor.White, "[]");
  37.                     }
  38.                 }
  39.                 Console.WriteLine();
  40.             }
  41.         }
  42.        
  43.         public static void ReservedBlocks(int posX, int posY)
  44.         {
  45.             int [,] spawnSpots = new int [,]
  46.             {
  47.                 {1,1},
  48.                 {1,2},
  49.                 {2,1}
  50.             };
  51.            
  52.             //percorrer o array e retornar bool
  53.         }
  54.        
  55.         private static void Instantiate(ConsoleColor colorText, string displayText)
  56.         {
  57.             Console.ForegroundColor = colorText;
  58.             Console.Write(displayText);
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement