Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title Movement Simulator
- setlocal enabledelayedexpansion
- color f0
- :menu
- cls
- echo 1) Play Maps
- echo 2) Create Maps
- set /p menuchoice=">> "
- if %menuchoice% equ 1 goto playmaps
- if %menuchoice% equ 2 goto createmaps
- goto menu
- :playmaps
- cls
- set prompt=1
- set /p nameof="Map Name: "
- call %nameof%.bat
- :Play_map
- cls
- set space=
- set wall=Û
- set /a lssl=%length%-2
- set /a lssw=%width%-1
- set /a numn=%width%+1
- set /a area=%length%*%width%
- set /a aare=%area%-%lssw%
- For /L %%g in (1,1,%area%) do (
- set g%%g=
- if %%g leq %width% set g%%g=%wall%
- if %%g geq %aare% set g%%g=%wall%
- )
- For /L %%f in (1,1,%lssl%) do (
- set g!numn!=%wall%
- set /a numn+=%lssw%
- set g!numn!=%wall%
- set /a numn+=1
- )
- set gmov=0
- set guy=
- set g%gpos%=%guy%
- set wpressed=false
- call %nameof%.bat
- :prompt1
- call :echo_display1
- choice wasdl
- goto :ch%errorlevel%
- :move
- set /a gpos=%gpos%%unum1%
- if !g%gpos%! equ %wall% set /a gpos=%gpos%%unum2% && goto prompt%prompt%
- set g%gpos%=%guy%
- set /a gpos=%gpos%%unum2%
- set g%gpos%=%space%
- set /a gpos=%gpos%%unum1%
- goto prompt%prompt%
- :ch1
- set unum1="-%width%"
- set unum2="+%width%"
- goto move
- :ch2
- set unum1="-1"
- set unum2="+1"
- goto move
- :ch3
- set unum1="+%width%"
- set unum2="-%width%"
- goto move
- :ch4
- set unum1="+1"
- set unum2="-1"
- goto move
- :ch5
- goto menu
- :echo_display1
- cls
- set /a "start1=1","end1=%width%"
- For /L %%i in (1,1,%length%) do set line%%i=
- For /L %%L in (1,1,%length%) do (
- For /L %%w in (!start1!,1,!end1!) do set line%%L=!line%%L!!g%%w!
- echo !line%%L!
- set /a start1+=%width%
- set /a end1+=%width%
- )
- goto :eof
- :createmaps
- cls
- set gmov=0
- set wpressed=false
- set prompt=2
- set /p width="Width: "
- set /p length="Length: "
- set wall=#
- set guy=
- set space=
- set /a lssl=%length%-2
- set /a lssw=%width%-1
- set /a numn=%width%+1
- set /a area=%length%*%width%
- set /a aare=%area%-%lssw%
- For /L %%g in (1,1,%area%) do (
- set g%%g=
- if %%g leq %width% set g%%g=%wall%
- if %%g geq %aare% set g%%g=%wall%
- )
- For /L %%f in (1,1,%lssl%) do (
- set g!numn!=%wall%
- set /a numn+=%lssw%
- set g!numn!=%wall%
- set /a numn+=1
- )
- set cursorloopv=1
- :cursor_loop
- if not "!g%cursorloopv%!" equ " " (
- set /a cursorloopv+=1
- goto cursor_loop
- )
- set gpos=%cursorloopv%
- set g%gpos%=%guy%
- set guyy=
- :prompt2
- call :echo_display1
- echo.
- echo 1) set emptyspace = Û
- echo 2) set emptyspace =
- echo 3) Place smiley (once)
- echo 4) Save Map
- choice wasdl1234
- goto :ch%errorlevel%
- :ch6
- set space=Û
- goto prompt2
- :ch7
- set space=
- goto prompt2
- :ch8
- set space=%guyy%
- set ppos=%gpos%
- goto prompt2
- :ch9
- set g%gpos%=
- echo.
- echo.
- set /p nname="Name of map: "
- cls
- echo Saving . . .
- set anumber=1
- :saving1
- if "!g%anumber%!" equ "#" set g%anumber%=
- set /a anumber+=1
- if not %anumber% gtr %area% goto saving1
- set anumber=1
- :saving2
- if not "!g%anumber%!" equ " " call :saving3
- set /a anumber+=1
- if not %anumber% gtr %area% goto saving2
- (
- echo set width=%width%
- echo set length=%length%
- echo set gpos=%ppos%
- )>>%nname%.bat
- echo Finished Saving Map %nname%
- echo.
- pause
- goto menu
- :saving3
- echo set g%anumber%=!g%anumber%!>>%nname%.bat
- goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement