Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. @echo off
  2. title Movement Simulator
  3. setlocal enabledelayedexpansion
  4. color f0
  5. :menu
  6. cls
  7. echo 1) Play Maps
  8. echo 2) Create Maps
  9. set /p menuchoice=">> "
  10. if %menuchoice% equ 1 goto playmaps
  11. if %menuchoice% equ 2 goto createmaps
  12. goto menu
  13. :playmaps
  14. cls
  15. set prompt=1
  16. set /p nameof="Map Name: "
  17. call %nameof%.bat
  18. :Play_map
  19. cls
  20. set space=
  21. set wall=Û
  22. set /a lssl=%length%-2
  23. set /a lssw=%width%-1
  24. set /a numn=%width%+1
  25. set /a area=%length%*%width%
  26. set /a aare=%area%-%lssw%
  27. For /L %%g in (1,1,%area%) do (
  28. set g%%g=
  29. if %%g leq %width% set g%%g=%wall%
  30. if %%g geq %aare% set g%%g=%wall%
  31. )
  32. For /L %%f in (1,1,%lssl%) do (
  33. set g!numn!=%wall%
  34. set /a numn+=%lssw%
  35. set g!numn!=%wall%
  36. set /a numn+=1
  37. )
  38. set gmov=0
  39. set guy=
  40. set g%gpos%=%guy%
  41. set wpressed=false
  42. call %nameof%.bat
  43. :prompt1
  44. call :echo_display1
  45. choice wasdl
  46. goto :ch%errorlevel%
  47. :move
  48. set /a gpos=%gpos%%unum1%
  49. if !g%gpos%! equ %wall% set /a gpos=%gpos%%unum2% && goto prompt%prompt%
  50. set g%gpos%=%guy%
  51. set /a gpos=%gpos%%unum2%
  52. set g%gpos%=%space%
  53. set /a gpos=%gpos%%unum1%
  54. goto prompt%prompt%
  55. :ch1
  56. set unum1="-%width%"
  57. set unum2="+%width%"
  58. goto move
  59. :ch2
  60. set unum1="-1"
  61. set unum2="+1"
  62. goto move
  63. :ch3
  64. set unum1="+%width%"
  65. set unum2="-%width%"
  66. goto move
  67. :ch4
  68. set unum1="+1"
  69. set unum2="-1"
  70. goto move
  71. :ch5
  72. goto menu
  73. :echo_display1
  74. cls
  75. set /a "start1=1","end1=%width%"
  76. For /L %%i in (1,1,%length%) do set line%%i=
  77. For /L %%L in (1,1,%length%) do (
  78. For /L %%w in (!start1!,1,!end1!) do set line%%L=!line%%L!!g%%w!
  79. echo !line%%L!
  80. set /a start1+=%width%
  81. set /a end1+=%width%
  82. )
  83. goto :eof
  84. :createmaps
  85. cls
  86. set gmov=0
  87. set wpressed=false
  88. set prompt=2
  89. set /p width="Width: "
  90. set /p length="Length: "
  91. set wall=#
  92. set guy=
  93. set space=
  94. set /a lssl=%length%-2
  95. set /a lssw=%width%-1
  96. set /a numn=%width%+1
  97. set /a area=%length%*%width%
  98. set /a aare=%area%-%lssw%
  99. For /L %%g in (1,1,%area%) do (
  100. set g%%g=
  101. if %%g leq %width% set g%%g=%wall%
  102. if %%g geq %aare% set g%%g=%wall%
  103. )
  104. For /L %%f in (1,1,%lssl%) do (
  105. set g!numn!=%wall%
  106. set /a numn+=%lssw%
  107. set g!numn!=%wall%
  108. set /a numn+=1
  109. )
  110. set cursorloopv=1
  111. :cursor_loop
  112. if not "!g%cursorloopv%!" equ " " (
  113. set /a cursorloopv+=1
  114. goto cursor_loop
  115. )
  116. set gpos=%cursorloopv%
  117. set g%gpos%=%guy%
  118. set guyy=
  119. :prompt2
  120. call :echo_display1
  121. echo.
  122. echo 1) set emptyspace = Û
  123. echo 2) set emptyspace =
  124. echo 3) Place smiley (once)
  125. echo 4) Save Map
  126. choice wasdl1234
  127. goto :ch%errorlevel%
  128. :ch6
  129. set space=Û
  130. goto prompt2
  131. :ch7
  132. set space=
  133. goto prompt2
  134. :ch8
  135. set space=%guyy%
  136. set ppos=%gpos%
  137. goto prompt2
  138. :ch9
  139. set g%gpos%=
  140. echo.
  141. echo.
  142. set /p nname="Name of map: "
  143. cls
  144. echo Saving . . .
  145. set anumber=1
  146. :saving1
  147. if "!g%anumber%!" equ "#" set g%anumber%=
  148. set /a anumber+=1
  149. if not %anumber% gtr %area% goto saving1
  150. set anumber=1
  151. :saving2
  152. if not "!g%anumber%!" equ " " call :saving3
  153. set /a anumber+=1
  154. if not %anumber% gtr %area% goto saving2
  155. (
  156. echo set width=%width%
  157. echo set length=%length%
  158. echo set gpos=%ppos%
  159. )>>%nname%.bat
  160. echo Finished Saving Map %nname%
  161. echo.
  162. pause
  163. goto menu
  164. :saving3
  165. echo set g%anumber%=!g%anumber%!>>%nname%.bat
  166. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement