本来还可加入音效,考虑太复杂了,暂不加了,在运行前请先确定系统中有没有choice.exe:- @echo off&setlocal enabledelayedexpansion
- title 坦克&color 02
- for /l %%a in (1,1,35) do set "k=!k! "
- for /l %%a in (1,1,66) do set "kk=!kk! "
- set /a num_w=10,num_s=16,n=1,w=-1,s=-1,a=1,d=-1,w_num=0,s_num=0
- set "t1-1= ‖"
- set "t1-2= ┐_‖_┌"
- set "t1-3=┋o nn o┋"
- set "t1-4=┋(∩)┋"
- set "t1-5= ┘~WW~└"
- set "t2-1= ┐_MM_┌"
- set "t2-2=┋(∪)┋"
- set "t2-3=┋o uu o┋"
- set "t2-4= ┘~‖~└"
- set "t2-5= ‖"
- set "t3-1= ┌ …… ┐"
- set "t3-2= │o ~│"
- set "t3-3======E(G 〕"
- set "t3-4= │o ~│"
- set "t3-5= └ …… ┘"
- set "t4-1=┌ …… ┐"
- set "t4-2= │~ o│"
- set "t4-3=〔 D)B====="
- set "t4-4= │~ o│"
- set "t4-5=└ …… ┘"
- :begin
- cd.>%~n0.tem
- echo 方向控制为:w上s下a左d右f射击^(z键退出^)>>%~n0.tem&echo.>>%~n0.tem
- for /l %%a in (1,1,%num_w%) do (
- set "w_f="
- if defined dt if %%a equ %w_num% (
- set "w_f= ·"
- if %%a equ %num_w% set "w_f= "∵'"
- if %%a equ 1 set "w_f= ¤"
- )
- echo.%k%!w_f!>>%~n0.tem
- )
- for /l %%a in (1,1,5) do (
- set "ok="
- if %%a equ 3 if defined dt if %n% equ 3 (
- set "a_f=·"
- if "%k_a%" equ "" set "a_f=∷"
- if "!K:~%a%!" equ "" set "a_f=¤"
- echo !k:~%a%!!a_f!%k_a%!t%n%-%%a!>>%~n0.tem&set "ok=a"
- )
- if %%a equ 3 if defined dt if %n% equ 4 (
- set "s_f=·"
- if "%k_d%" equ "" set "s_f=∷"
- if "%k%%k_d%" equ "%kk:~1%" set "s_f=¤"
- echo %k%!t%n%-%%a!%k_d%!s_f!>>%~n0.tem&set "ok=a"
- )
- if not defined ok echo %k%!t%n%-%%a!>>%~n0.tem
- )
- for /l %%a in (%num_s%,1,21) do (
- set "s_f="
- if defined dt if %%a equ %s_num% (
- set "s_f= ·"
- if %%a equ %num_s% set "s_f= "∵'"
- if %%a equ 21 set "s_f= ¤"
- )
- echo.%k%!s_f!>>%~n0.tem
- )
- cls&type %~n0.tem
- choice /n /c "wsadfz"%dt%
- if %errorlevel% equ 6 del /q %~n0.tem>nul 2>nul&goto :eof
- set /a num_e=%errorlevel%
- if %num_e% equ 5 (
- if %n% equ 1 (
- if %w% lss %num_w% (
- set "dt= /d "f" /t 0"
- set /a w+=1,w_num=num_w-w
- for /l %%a in (1,1,200) do echo>nul
-
- ) else (
- set /a w=-1,w_num=0&set "dt="
- )
- )
- if %n% equ 2 (
- if %s_num% lss 21 (
- set "dt= /d "f" /t 0"
- set /a s+=1,s_num=num_s+s
- for /l %%a in (1,1,200) do echo>nul
- ) else (
- set /a s=-1,s_num=0&set "dt="
- )
- )
- if %n% equ 3 (
- if "!k_a!" neq "%k:~2%" (
- set "dt= /d "f" /t 0"
- set /a a+=1&set "k_a="
- for /l %%a in (3,1,!a!) do set "k_a=!k_a! "
- ) else (
- set /a a=1&set "dt="&set "k_a="
- )
- )
- if %n% equ 4 (
- if "!k_d!%k%" neq "%kk:~1%" (
- set "dt= /d "f" /t 0"
- set /a d+=1&set "k_d="
- for /l %%a in (1,1,!d!) do set "k_d=!k_d! "
- ) else (
- set /a d=-1&set "dt="&set "k_d="
- )
- )
- )
- if %num_e% neq %n% set /a _%n%=0
- if %num_e% lss 5 set /a _%num_e%+=1,n=%num_e%
- if !num_%num_e%! neq 1 (
- if %num_e% equ 1 if %num_w% neq 0 set /a num_w-=1,num_s-=1
- if %num_e% equ 2 if %num_w% neq 16 set /a num_w+=1,num_s+=1
- if %num_e% equ 3 if "%k:~1%" neq "" set "k=%k:~1%"
- if %num_e% equ 4 if "%k:~64%" equ "" set "k=%k% "
- )
- goto begin
复制代码
|