标题: [游戏娱乐] The Best Matrix 批处理 v1(具打字特效) [打印本页]
作者: raymai97 时间: 2011-10-29 12:12 标题: The Best Matrix 批处理 v1(具打字特效)
总算做出了自己第一个采用多种特效的批处理,所以cpu自然用很多了~ 不过也因此不必加sleep.com来延时,哈哈~
有几种特效集在一起了:
* 打字特效
* 居中特效
* Matrix特效(从上到下)- @echo off
- title THE BEST MATRIX by Raymai97
- color 2a
- mode con cols=80 lines=25
- setlocal enabledelayedexpansion
- set var=Every great achievement was once considered impossible.
-
- :initrandom
- ::RANDOM init (25 line will init)
- for /l %%i in (1 1 25) do (
- for /l %%j in (1 1 39) do (
- set /a ran=!random! %% 3
- if "!ran!"=="2" set "ran= "
- set l%%i=!ran! !l%%i!
- )
- )
-
- :inittxt
- set varstart=1
- set len_txt=0
-
- :txt_reset
- set txt=!var:~0,%varstart%!
-
- :len_txt_add
- if not "!txt:~%len_txt%!"=="" set /a len_txt+=1&goto len_txt_add
-
- set /a start=76/2-(!len_txt!/2)
- ::odd or even
- set /a tmp=!len_txt!/2*2
- set /a start2=!start!+!len_txt!+2
- set /a start-=2
-
- ::ECHO JOB HERE
- cls
- echo. !l1!
- echo. !l2:~0,%start%! !txt! !l2:~%start2%!
- for /l %%i in (3 1 24) do (echo. !l%%i!)
-
- ::MOVE VAR JOB HERE
- set num=25
- set num2=0
- :movevar
- if "!num2!"=="1" (
- set l1=
- for /l %%i in (1 1 39) do (
- set /a ran=!random! %% 3
- if "!ran!"=="2" set "ran= "
- set l1=!ran! !l1!
- )
- if not "!var:~%varstart%!"=="" (set /a varstart+=1)
- goto txt_reset
- )
- set /a num2=!num!-1
- set l!num!=!l%num2%!
- set /a num-=1
- goto movevar
复制代码
作者: weichenxiehou 时间: 2011-10-29 13:56
看得出来楼主对批处理特效很有热情,鼓励一下。
作者: ydafhjeajtrj 时间: 2011-10-29 15:27
如果哪位大侠可以把功能优化一下就好了,优化个最简洁的
作者: garyng 时间: 2011-12-2 11:59
赞个~
帅!
尤其是第2行
作者: 狱渊 时间: 2013-4-28 20:57
都好厉害啊
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |