Advertisement
SmartGenius

Labyrinth 1 Batch Game

May 18th, 2012
2,284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 4.69 KB | None | 0 0
  1. @Echo off
  2. @title The Labyrinth - SmartGenius
  3. Mode con cols=45 lines=16
  4. Setlocal enabledelayedexpansion
  5.  
  6. :: Batch Game - The Labyrinth
  7. :: Coded by SmartGenius
  8. :: Using Graphic Command (colous) by Bolivianito
  9.  
  10. :Game_Vars
  11. Set /a "LimX=44","LimY=15","IniX=1","IniY=1","MovX=0","MovY=0","Points=0"
  12. Set "Bound=[8]$219"
  13. Set "Space=[0] "
  14. Set "Player=$001"
  15. Set "Point=[5]$207"
  16. Set "Exit=[10]$176"
  17.  
  18. :Game_Init
  19. For /l %%a in (%IniX%,1,%LimX%) do (
  20. For /l %%b in (%IniY%,1,%LimY%) do (
  21. Set X%%aY%%b=%Space%))
  22. Call :Game_Level
  23. Call :Display
  24. Set "X14Y4=%Player%"
  25. Set Curpos=X14Y4
  26. Call :Color "%Player%" "12 0"
  27. Goto :Game_Move
  28.  
  29. :Display
  30. For /l %%d in (%IniX%,1,%LimY%) do (
  31. Set Lin_%%d=
  32. For /l %%e in (%IniX%,1,%LimX%) do Set Lin_%%d=!Lin_%%d!!X%%eY%%d!)
  33. For /l %%f in (%IniY%,1,%LimY%) do (Colous Writesec "!Lin_%%f!")
  34. Goto :Eof
  35.  
  36. :Game_Move
  37. Colous Readkey
  38. If "%ErrorLevel%"=="100" (call :Mov "X" "+")
  39. If "%ErrorLevel%"=="97" (call :Mov "X" "-")
  40. If "%ErrorLevel%"=="115" (call :Mov "Y" "+")
  41. If "%ErrorLevel%"=="119" (call :Mov "Y" "-")
  42. If "%ErrorLevel%"=="88" (Goto :Win)
  43. If "%ErrorLevel%"=="120" (Goto :Win)
  44. Goto :Game_Move
  45.  
  46. :Mov
  47. For /f "tokens=1,2 delims=X,Y" %%p in ("%CurPos%") do (Set "MovX=%%p"&Set "MovY=%%q")
  48. if "!Mov%~1!"=="!Lim%~1!" Goto :Eof
  49. Set /a Mov%~1%~2=1
  50. Set "NMovY=!X%MovX%Y%MovY%!"
  51. If Defined S_X%MovX%Y%MovY% (Set "S_X%MovX%Y%MovY%="&Set /a Points+=10)
  52. If "!NMovY!"=="%Bound%" (Goto :Eof)
  53. If "!NMovY!"=="%Exit%" (Goto :Win)
  54. If "!NMovY!"=="%Point%" (Set /a Points+=5)
  55. Set "X%MovX%Y%MovY%=%Player%"
  56. Set "%CurPos%=%Space%"
  57. Call :Color "A" "0 0"
  58. Set "CurPos=X%MovX%Y%MovY%"
  59. Call :Color "%Player%" "12 0"
  60. Goto :Eof
  61.  
  62. :Color
  63. For /f "tokens=1,2 delims=X,Y" %%p in ("%CurPos%") do (Set "ColX=%%p"&Set "ColY=%%q")
  64. Colous %~2 %ColX%,%ColY% %~1
  65. Colous Cursoroff
  66. Goto :Eof
  67.  
  68. :Win
  69. Cls
  70. Echo.
  71. Echo.
  72. If %Points% GEQ 200 (Echo. Excelent %Nick%, You Get 3 Extra Lives&Set /a Lives+=3)
  73. If %Points% GEQ 150 (If %Points% LEQ 195 (Echo. Well Done %Nick%, You Get 2 Extra Lives&Set /a Lives+=2))
  74. If %Points% GEQ 100 (If %Points% LEQ 145 (Echo. You Did it %Nick%, You Get 1 Extra Live&Set /a Lives+=1))
  75. If %Points% LSS 100 (Echo. Level Completed %Nick%, No Lives Won)
  76. Echo. You Get %Points% Points
  77. Echo.
  78. Echo. Press any key...
  79. Pause>nul
  80. Goto :Eof
  81.  
  82. :Game_Level
  83. For %%a in (X7Y10,X8Y6,X9Y2,X9Y6,X9Y14,X10Y14,X13Y8,X18Y6,X18Y10,X18Y12,X20Y12,X23Y9,X27Y7,X29Y2,X38Y10,X41Y6,X43Y14) do (
  84. Set "%%a=%Point%")
  85. For %%a in (
  86. X1Y1,X1Y2,X1Y3,X1Y4,X1Y5,X1Y6,X1Y7,X1Y8,X1Y9,X1Y10,X1Y11,X1Y12,X1Y13,X2Y1,X2Y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Y13,X24Y15,
  99. X25Y1,X25Y2,X25Y5,X25Y11,X25Y13,X25Y15,X26Y1,X26Y4,X26Y5,X26Y6,X26Y7,X26Y8,X26Y9,
  100. X26Y10,X26Y11,X26Y13,X26Y15,X27Y1,X27Y6,X27Y9,X27Y13,X27Y15,X28Y1,X28Y2,X28Y3,X28Y4,
  101. X28Y6,X28Y7,X28Y9,X28Y11,X28Y12,X28Y13,X28Y15,X29Y1,X29Y4,X29Y6,X29Y9,X29Y13,X29Y15,
  102. X30Y1,X30Y2,X30Y4,X30Y6,X30Y8,X30Y9,X30Y11,X30Y13,X30Y15,X31Y2,X31Y4,X31Y6,X31Y9,
  103. X31Y11,X31Y15,X32Y2,X32Y4,X32Y6,X32Y7,X32Y9,X32Y11,X32Y12,X32Y13,X32Y14,X32Y15,X33Y2,
  104. X33Y4,X33Y9,X33Y13,X34Y2,X34Y4,X34Y6,X34Y7,X34Y8,X34Y9,X34Y11,X34Y13,X35Y2,X35Y4,
  105. X35Y11,X35Y13,X35Y14,X35Y15,X36Y1,X36Y2,X36Y4,X36Y6,X36Y7,X36Y8,X36Y9,X36Y11,X36Y15,
  106. X37Y1,X37Y4,X37Y9,X37Y10,X37Y11,X37Y13,X37Y15,X38Y1,X38Y3,X38Y4,X38Y6,X38Y7,X38Y9,
  107. X38Y11,X38Y13,X38Y15,X39Y1,X39Y3,X39Y7,X39Y9,X39Y11,X39Y12,X39Y13,X39Y15,X40Y1,X40Y3,
  108. X40Y5,X40Y7,X40Y9,X40Y13,X40Y15,X41Y1,X41Y3,X41Y4,X41Y5,X41Y7,X41Y9,X41Y11,X41Y15,
  109. X42Y1,X42Y5,X42Y6,X42Y7,X42Y9,X42Y10,X42Y11,X42Y12,X42Y14,X42Y15,X43Y1,X43Y2,X43Y3,
  110. X43Y9,X43Y12,X43Y15,X44Y3,X44Y4,X44Y5,X44Y6,X44Y7,X44Y8,X44Y9,X44Y12,X44Y13,X44Y14,X44Y15
  111. ) do (Set "%%a=%Bound%")
  112. For %%a in (X2Y2,X2Y7,X2Y9,X16Y12,X18Y8,X20Y2,X20Y9,X25Y6,X26Y2,X36Y10,X40Y4,X41Y10) do (Set S_%%a=%Point%)
  113. For %%a in (X20Y14) do (Set "%%a=%Exit%")
  114. Goto :Eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement