之前看过一个老贴,那上面做了一个动画,说是什么“人有仨急,狂奔厕所中……”,我看那个动画做得挺不错的,于是想把它做成游戏,
没想到真做成了,还挺难的,我自己稍不注意就会Game Over,现在我把这个游戏发给大家分享,也欢迎大家提出修改建议。(我一般在周六下午至周末中午在线。)
三方工具Ckey.exe是为了增加游戏体验,删除它也不要紧,只不过人物奔跑的速度会变快,每按一次方向操纵键都要按一次回车才会生效。
这个游戏小bug很多,也请大家注意。
下面是主程序代码(代码可能有点乱):- @echo off
- setlocal enabledelayedexpansion
- title Rush To Tolite
- mode con lines=21 cols=80
- set fx=q
- set ljq=0
- echo u>b
- if not exist ckey.exe start controlp.bat & goto:main
- start control.bat
- :main
- cls
- for /l %%a in (1,1,9) do (echo=)
- echo ● Rush To Tolite ●
- echo -│- -│-
- echo │/ \│
- echo / Press any key to play \
- pause>nul
- echo=
- set /p level=1 please select the level:
- goto:begin
- :begin
- set bgbl=1
- set bgbc=1
- :load
- cls
- echo p>a
- set x=4
- set y=1
- for /f "delims= tokens=* eol=; usebackq" %%a in ("data\map\level!level!_!bgbl!,!bgbc!.txt") do (
- set %%a
- )
- set "lft1= "
- set "rt1=/"
- set "lft2=/"
- set "rt2= "
- set ctr=1
- :start
- set /a bex=x-2
- set /a bx=x-1
- set /a rfx=x+1
- set /a afx=x+2
- set /a abx=x+3
- set /a fhx=x+4
- set /a rststr=70-afx
- set /a brststr=70-abx
- set /a ty=y-1
- set /a by=y+1
- set /a fy=y+2
- set /a gy=y+3
- if !fx!==q (
- set "lft1= "
- set "rt1=/"
- set "lft2=/"
- set "rt2= "
- ) else (
- set "lft1= "
- set "rt1=\"
- set "lft2=\"
- set "rt2= "
- )
- for /f "delims= tokens=* eol=y usebackq" %%a in ("data\map\level!level!_!bgbl!,!bgbc!.txt") do (
- set %%a
- )
- set /p ufx=<a
- if !ufx!==a set fx=h
- if !ufx!==d set fx=q
- if !ufx!==w goto :jump
- if !ufx!==r goto:load
- if !fx!==q (
- set /a x+=1
- ) else (
- set /a x-=1
- )
- if !fx!==q (
- if "!ln%fy%:~%abx%,1!" == "|" set /a x-=1
- if "!ln%by%:~%abx%,1!" == "|" set /a x-=1
- if "!ln%y%:~%abx%,1!" == "|" set /a x-=1
- ) else (
- if "!ln%fy%:~%bx%,1!" == "|" set /a x+=1
- if "!ln%by%:~%bx%,1!" == "|" set /a x+=1
- if "!ln%y%:~%bx%,1!" == "|" set /a x+=1
- )
- set ln=!ln%y%!
- set ln=!ln%y%:~0,%bx%! ●!ln:~%afx%,%rststr%!
- set ln%y%=!ln!
-
- set ln=!ln%by%!
- set ln=!ln%by%:~0,%bx%!^!lft%ctr%!│^!rt%ctr%!!ln:~%abx%,%brststr%!
- set ln%by%=!ln!
-
- set ln=!ln%fy%!
- set ln=!ln%fy%:~0,%bx%!^!rt%ctr%! ^!lft%ctr%!!ln:~%abx%,%brststr%!
- set ln%fy%=!ln!
- for /l %%a in (1,1,20) do (
- echo ^!ln%%a!
- )
- for /l %%a in (1,1,300) do (ver>nul)
- if !fx!==q (
- if "!ln%gy%:~%bx%,1!" neq "-" (
- goto :fall
- ) else (
- if !ctr!==1 (
- set ctr=2
- ) else (
- set ctr=1
- )
- )
- ) else (
- if "!ln%gy%:~%rfx%,1!" neq "-" (
- goto :fall
- ) else (
- if !ctr!==1 (
- set ctr=2
- ) else (
- set ctr=1
- )
- )
- )
- if !fx!==q (
- if "!ln%gy%:~%rfx%,1!"=="]" set /a bgbl+=1 & set x=1 & goto:asd
- if "!ln%by%:~%afx%,1!"=="]" set /a bgbl+=1 & set x=1 & goto:asd
- if "!ln%y%:~%afx%,1!"=="]" set /a bgbl+=1 & set x=1 & goto:asd
- ) else (
- break
- )
- :asd
- if !fx!==h (
- if "!ln%gy%:~%bx%,1!"=="[" set /a bgbl-=1 & set x=68 & goto:fgh
- if "!ln%by%:~%bex%,1!"=="[" set /a bgbl-=1 & set x=68 & goto:fgh
- if "!ln%y%:~%bex%,1!"=="[" set /a bgbl-=1 & set x=68 & goto:fgh
- ) else (
- break
- )
- :fgh
- if "!ln%gy%:~%rfx%,1!"=="" goto:win
- if "!ln%by%:~%afx%,1!"=="" goto:win
- if "!ln%y%:~%afx%,1!"=="" goto:win
- if "!ln%by%:~%x%,1!"=="" goto:win
- if "!ln%y%:~%x%,1!"=="" goto:win
- if !y! geq 16 if "!ln%gy%:~%x%,1!"=="#" set y=1 & set /a bgbc+=1
- if !y! leq 3 if "!ln%ty%:~%x%,1!"=="#" set y=17 & set /a bgbc-=1
- goto:start
- :fall
- if "!ln%gy%:~%rfx%,1!"=="-" goto:start
- if "!ln%gy%:~%x%,1!"=="-" goto:start
- if "!ln%gy%:~%bx%,1!"=="-" goto:start
- if !y! geq 16 if "!ln%gy%:~%x%,1!"=="#" set y=1 & set /a bgbc+=1
- if "!ln%gy%:~%x%,1!"=="M" goto:die
- if !y! geq 20 goto:die
- set /a y+=1
- set /p ufx=<a
- set /a bex=x-2
- set /a bx=x-1
- set /a rfx=x+1
- set /a afx=x+2
- set /a abx=x+3
- set /a rststr=70-afx
- set /a brststr=70-abx
- set /a ty=y-1
- set /a by=y+1
- set /a fy=y+2
- set /a gy=y+3
- for /f "delims= tokens=* eol=y usebackq" %%a in ("data\map\level!level!_!bgbl!,!bgbc!.txt") do (
- set %%a
- )
- if !ufx!==d (
- if "!ln%fy%:~%rfx%,1!" neq "|" set /a x+=1 & set fx=q & goto:e
- if "!ln%by%:~%rfx%,1!" neq "|" set /a x+=1 & set fx=q & goto:e
- if "!ln%y%:~%x%,1!" neq "|" set /a x+=1 & set fx=q & goto:e
- ) else (
- break
- )
- if !ufx!==a (
- if "!ln%fy%:~%bx%,1!" neq "|" set /a x-=1 & set fx=h & goto:e
- if "!ln%by%:~%bx%,1!" neq "|" set /a x-=1 & set fx=h & goto:e
- if "!ln%y%:~%bx%,1!" neq "|" set /a x-=1 & set fx=h & goto:e
- ) else (
- break
- )
- :e
- if !fx!==q (
- if "!ln%gy%:~%rfx%,1!"=="]" set /a bgbl+=1 & set x=1 & goto:asdf
- if "!ln%by%:~%afx%,1!"=="]" set /a bgbl+=1 & set x=1 & goto:asdf
- if "!ln%y%:~%afx%,1!"=="]" set /a bgbl+=1 & set x=1 & goto:asdf
- ) else (
- break
- )
- :asdf
- if !fx!==h (
- if "!ln%gy%:~%bx%,1!"=="[" set /a bgbl-=1 & set x=68
- if "!ln%by%:~%bex%,1!"=="[" set /a bgbl-=1 & set x=68
- if "!ln%y%:~%bex%,1!"=="[" set /a bgbl-=1 & set x=68
- ) else (
- break
- )
- set ln=!ln%y%!
- set ln=!ln%y%:~0,%x%!●!ln:~%afx%,%rststr%!
- set ln%y%=!ln!
-
- set ln=!ln%by%!
- set ln=!ln%by%:~0,%bx%!^!lft%ctr%!│^!rt%ctr%!!ln:~%abx%,%brststr%!
- set ln%by%=!ln!
-
- set ln=!ln%fy%!
- set ln=!ln%fy%:~0,%bx%!^!rt%ctr%! ^!lft%ctr%!!ln:~%abx%,%brststr%!
- set ln%fy%=!ln!
- for /l %%a in (1,1,20) do (
- echo ^!ln%%a!
- )
- for /l %%a in (1,1,400) do (ver>nul)
- goto:fall
-
- :jump
- echo p>a
- set /a ljq+=1
- if !y! leq 2 if "!ln%ty%:~%x%,1!"=="#" set y=17 & set /a bgbc-=1
- if "!ln%ty%:~%x%,1!" neq "-" if "!ln%ty%:~%x%,1!" neq "|" if "!ln%ty%:~%x%,1!" neq "M" set /a y-=1
- if "!ln%ty%:~%x%,1!"=="W" goto:die
- set /a bex=x-2
- set /a bx=x-1
- set /a rfx=x+1
- set /a afx=x+2
- set /a abx=x+3
- set /a rststr=70-afx
- set /a brststr=70-abx
- set /a ty=y-1
- set /a by=y+1
- set /a fy=y+2
- set /a gy=y+3
- for /f "delims= tokens=* eol=y usebackq" %%a in ("data\map\level!level!_!bgbl!,!bgbc!.txt") do (
- set %%a
- )
- set ln=!ln%y%!
- set ln=!ln%y%:~0,%x%!●!ln:~%afx%,%rststr%!
- set ln%y%=!ln!
-
- set ln=!ln%by%!
- set ln=!ln%by%:~0,%bx%!^!lft%ctr%!│^!rt%ctr%!!ln:~%abx%,%brststr%!
- set ln%by%=!ln!
-
- set ln=!ln%fy%!
- set ln=!ln%fy%:~0,%bx%!^!rt%ctr%! ^!lft%ctr%!!ln:~%abx%,%brststr%!
- set ln%fy%=!ln!
- for /l %%a in (1,1,20) do (
- echo ^!ln%%a!
- )
- if !ljq! geq 7 set ljq=0 & goto:start
- for /l %%a in (1,1,400) do (ver>nul)
- goto:jump
-
- :die
- color 0c
- ping 127.1 -n 1 >nul
- color 0f
- for /f "delims= tokens=* eol=y usebackq" %%a in ("data\map\level!level!_!bgbl!,!bgbc!.txt") do (
- set %%a
- )
- for /l %%a in (1,1,20) do (
- echo ^!ln%%a!
- )
- ping 127.1 -n 3 >nul
- cls
- set x=4
- set y=1
- set fx=q
- echo p>a
- goto:start
-
- :win
- echo 终于找到厕所了……
- ping 127.1 -n 4 >nul
- cls
- for /l %%a in (1,1,9) do (echo=)
- echo 恭喜过关!
- pause>nul
- echo e>b
- exit
复制代码 游戏的全部内容在附件里
游戏分3关,其中第1关是演示关卡 |