Aqui les presento el Batch Designer
Una especia de diseador grafico (no como Paint o Photoshop, pero casi ) en el cual podran crear un Dibujo de X por Y y en el cual podran ir moviendose y poner los diferentes "Iconos" con los cuales se representarian Dibujos de Arte ASCII o para disear Niveles de Juegos Batch como el PushBox.
Código:
@echo off
@title Batch Designer - SmartGenius
@::Coded by SmartGenius
:Ck
if not exist "keyboard.exe" (Goto :NoKey)
:Menu
setlocal enabledelayedexpansion
cls
echo. ͻ
echo. Batch Designer
echo. ͼ
echo.
echo.
echo. 1. Nuevo Dibujo
echo.
echo. 2. Ayuda
echo.
echo. 3. Salir
echo.
echo.
keyboard
if "%errorlevel%"=="49" (Goto :Load)
if "%errorlevel%"=="50" (Goto :Help)
if "%errorlevel%"=="51" (Goto :Exit)
Goto :Menu
:Load
cls
echo.
echo. Introduzca las Dimensiones del Dibujo
echo.
set /p LimX="Ancho > "
set /p LimY="Alto > "
if not defined LimX Goto :Load
if not defined LimY Goto :Load
:Icon
Set AsciiIcons= ۺɻȼ
Set GameIcons=
Set Icons=%AsciiIcons%
echo. Tipo de Iconos
echo.
echo. 1. Iconos ASCII : %AsciiIcons%
echo. 2. Iconos Juegos: %GameIcons%
echo.
keyboard
if "%errorlevel%"=="50" (Set Icons=%GameIcons%)
:Init
Set Cursor=
Set Last=
set IniX=0
Set IniY=0
for /l %%i in (0,1,9) do (set Icon%%i=)
for /l %%a in (0,1,%LimX%) do (
for /l %%b in (0,1,%LimY%) do (
set X%%aY%%b=))
set X0Y0=%Cursor%
set CurPos=X0Y0
Goto :Graphic
:Graphic
Call :Clear
echo.
echo. Tablero de %LimX% por %LimY% Tecla [X] Volver al Menu
echo.
echo. Presione los Numeros del 0 al 9 para introducir un Icono
echo. Presione la tecla Enter para Exportar el Dibujo a Coordenadas
echo.
set /p var="Iconos: "<nul
for /l %%n in (0,1,9) do (set /p var="%%n = !Icons:~%%n,1! "<nul)
echo.
for /l %%d in (0,1,%LimY%) do (
for /l %%e in (0,1,%LimX%) do (
set Lin_%%d=!Lin_%%d!!X%%eY%%d!))
echo.
for /l %%f in (0,1,%LimY%) do (echo. !Lin_%%f!)
keyboard
if "%errorlevel%"=="77" (call :MovX+ "%CurPos%")
if "%errorlevel%"=="75" (call :MovX- "%CurPos%")
if "%errorlevel%"=="80" (call :MovY+ "%CurPos%")
if "%errorlevel%"=="72" (call :MovY- "%CurPos%")
if "%errorlevel%"=="48" (Call :Draw "%CurPos%" 0)
if "%errorlevel%"=="49" (Call :Draw "%CurPos%" 1)
if "%errorlevel%"=="50" (Call :Draw "%CurPos%" 2)
if "%errorlevel%"=="51" (Call :Draw "%CurPos%" 3)
if "%errorlevel%"=="52" (Call :Draw "%CurPos%" 4)
if "%errorlevel%"=="53" (Call :Draw "%CurPos%" 5)
if "%errorlevel%"=="54" (Call :Draw "%CurPos%" 6)
if "%errorlevel%"=="55" (Call :Draw "%CurPos%" 7)
if "%errorlevel%"=="56" (Call :Draw "%CurPos%" 8)
if "%errorlevel%"=="57" (Call :Draw "%CurPos%" 9)
if "%errorlevel%"=="88" (Goto :Menu)
if "%errorlevel%"=="120" (Goto :Menu)
if "%errorlevel%"=="13" (Goto :Export)
Goto :Graphic
:MovX+
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%p"=="%LimX%" Goto :Eof
if !%~1!==%Cursor% set %~1=%Last%
set /a MovX=%%p+1
call set Last=%%X!MovX!Y%%q%%
set X!MovX!Y%%q=%Cursor%
set CurPos=X!MovX!Y%%q
)
Goto :Eof
:MovX-
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%p"=="%IniX%" Goto :Eof
if !%~1!==%Cursor% set %~1=%Last%
set /a MovX=%%p-1
call set Last=%%X!MovX!Y%%q%%
set X!MovX!Y%%q=%Cursor%
set CurPos=X!MovX!Y%%q
)
Goto :Eof
:MovY+
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%q"=="%LimY%" Goto :Eof
if !%~1!==%Cursor% set %~1=%Last%
set /a MovY=%%q+1
call set Last=%%X%%pY!MovY!%%
set X%%pY!MovY!=%Cursor%
set CurPos=X%%pY!MovY!
)
Goto :Eof
:MovY-
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%q"=="%IniY%" Goto :Eof
if !%~1!==%Cursor% set %~1=%Last%
set /a MovY=%%q-1
call set Last=%%X%%pY!MovY!%%
set X%%pY!MovY!=%Cursor%
set CurPos=X%%pY!MovY!
)
Goto :Eof
:Draw
Set %~1=!Icons:~%2,1!
Goto :Eof
:Export
echo.
echo Introduzca un Nombre de Archivo
set /p filename=">> "
if not defined filename set filename=BD_%random%
Call :Template "%filename%"
for /l %%a in (0,1,%LimX%) do (
for /l %%b in (0,1,%LimY%) do (
if "!X%%aY%%b!"=="%Icons:~0,1%" set Icon0=!Icon0!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~1,1%" set Icon1=!Icon1!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~2,1%" set Icon2=!Icon2!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~3,1%" set Icon3=!Icon3!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~4,1%" set Icon4=!Icon4!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~5,1%" set Icon5=!Icon5!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~6,1%" set Icon6=!Icon6!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~7,1%" set Icon7=!Icon7!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~8,1%" set Icon8=!Icon8!,X%%aY%%b
if "!X%%aY%%b!"=="%Icons:~9,1%" set Icon9=!Icon9!,X%%aY%%b
))
echo. Coordenadas Generadas
for /l %%n in (0,1,9) do (
if Defined Icon%%n (
echo. "!Icons:~%%n,1!" = !Icon%%n:~1!
echo for %%%%a in ^(!Icon%%n:~1!^) do ^(Set %%%%a=!Icons:~%%n,1!^) >>%filename%.bat
))
endlocal&set filename=%filename%
echo.>>%filename%.bat
echo :Graphic >>%filename%.bat
echo Call :Clear >>%filename%.bat
echo echo. >>%filename%.bat
echo for /l %%%%d in ^(0,1,%%LimY%%^) do ^( >>%filename%.bat
echo for /l %%%%e in ^(0,1,%%LimX%%^) do ^( >>%filename%.bat
echo set Lin_%%%%d=!Lin_%%%%d!!X%%%%eY%%%%d!^)^) >>%filename%.bat
echo for /l %%%%f in (0,1,%%LimY%%) do (echo. !Lin_%%%%f!) >>%filename%.bat
echo echo.>>%filename%.bat
echo pause >>%filename%.bat
echo exit >>%filename%.bat
echo. >>%filename%.bat
echo :Clear >>%filename%.bat
echo cls >>%filename%.bat
echo for /l %%%%m in ^(0,1,%%LimY%%^) do ^(set Lin_%%%%m=^) >>%filename%.bat
echo Goto :Eof >>%filename%.bat
echo.
echo. Archivo "%filename%.bat" Generado Correctamente...
echo.
pause
Goto :Menu
:Template
echo @echo off >%~1.bat
echo @title %~1 - Batch Designer >>%~1.bat
echo ::Created with Batch Designer >>%~1.bat
echo ::Coded by SmartGenius >>%~1.bat
echo. >>%~1.bat
echo setlocal enabledelayedexpansion >>%~1.bat
echo. >>%~1.bat
echo :Init >>%~1.bat
echo Set LimX=%LimX% >>%~1.bat
echo Set LimY=%LimY% >>%~1.bat
echo for /l %%%%a in ^(0,1,%%LimX%%^) do ^( >>%~1.bat
echo for /l %%%%b in ^(0,1,%%LimY%%^) do ^( >>%~1.bat
echo set X%%%%aY%%%%b=^)^) >>%~1.bat
Goto :Eof
:Clear
cls
for /l %%m in (0,1,%LimY%) do (set Lin_%%m=)
Goto :Eof
:Exit
endlocal
exit /b
:NoKey
cls
echo. Cargando...
call :keyboard
ping -n 2 0.0.0.0 >nul
Goto :Ck
:keyboard
(
echo n keyboard.dat
echo e 0000 4D 5A 2E 00 01 00 00 00 02 00 00 10 FF FF F0 FF
echo e 0010 FE FF 00 00 00 01 F0 FF 1C 00 00 00 00 00 00 00
echo e 0020 B4 08 CD 21 3C 00 75 02 CD 21 B4 4C CD 21
echo rcx
echo 002E
echo w0
echo q
echo.
)>keyboard.dat
type keyboard.dat|debug>NUL 2>&1
del /f/q/a "keyboard.exe">NUL 2>&1
ren keyboard.dat "keyboard.exe"
Goto :Eof
En el programa podran moverse libremente e ir modificando el Dibujo, una vez este listo presionan Enter y este sera exportado al formato de Coordenadas XY en un nuevo archivo BAT listo para usar.
Ejemplos:
GameDemo
Codigo Resultante:
Código:
@echo off
@title Game_Demo - Batch Designer
::Created with Batch Designer
::Coded by SmartGenius
setlocal enabledelayedexpansion
:Init
Set LimX=10
Set LimY=10
for /l %%a in (0,1,%LimX%) do (
for /l %%b in (0,1,%LimY%) do (
set X%%aY%%b=))
for %%a in (X1Y1) do (Set %%a=)
for %%a in (X3Y5,X3Y7,X3Y9,X4Y6,X5Y5,X5Y7,X5Y9,X7Y2,X7Y9,X9Y4,X9Y6,X9Y9) do (Set %%a=)
for %%a in (X1Y2,X1Y3,X1Y4,X1Y5,X1Y6,X1Y7,X1Y8,X1Y9,X2Y4,X2Y5,X2Y6,X2Y7,X2Y9,X3Y1,X3Y4,X3Y6,X4Y1,X4Y4,X4Y5,X4Y7,X4Y9,X5Y1,X5Y4,X5Y6,X6Y1,X6Y4,X6Y9,X7Y1,X7Y4,X7Y5,X7Y6,X7Y7,X8Y1,X8Y2,X8Y3,X8Y4,X8Y7,X9Y2,X9Y3,X9Y7,X9Y8) do (Set %%a= )
for %%a in (X3Y2,X4Y2,X5Y2) do (Set %%a=)
for %%a in (X0Y0,X0Y1,X0Y2,X0Y3,X0Y4,X0Y5,X0Y6,X0Y7,X0Y8,X0Y9,X0Y10,X1Y0,X1Y10,X2Y0,X2Y1,X2Y2,X2Y3,X2Y8,X2Y10,X3Y0,X3Y3,X3Y8,X3Y10,X4Y0,X4Y3,X4Y8,X4Y10,X5Y0,X5Y3,X5Y8,X5Y10,X6Y0,X6Y2,X6Y3,X6Y5,X6Y6,X6Y7,X6Y8,X6Y10,X7Y0,X7Y3,X7Y8,X7Y10,X8Y0,X8Y5,X8Y6,X8Y8,X8Y9,X8Y10,X9Y0,X9Y5,X9Y10,X10Y0,X10Y1,X10Y2,X10Y3,X10Y4,X10Y5,X10Y6,X10Y7,X10Y8,X10Y9,X10Y10) do (Set %%a=)
for %%a in (X9Y1) do (Set %%a=)
:Graphic
Call :Clear
echo.
for /l %%d in (0,1,%LimY%) do (
for /l %%e in (0,1,%LimX%) do (
set Lin_%%d=!Lin_%%d!!X%%eY%%d!))
for /l %%f in (0,1,%LimY%) do (echo. !Lin_%%f!)
echo.
pause
exit
:Clear
cls
for /l %%m in (0,1,%LimY%) do (set Lin_%%m=)
Goto :Eof
ASCII
Codigo Resultante:
Código:
@echo off
@title Scot_Team - Batch Designer
::Created with Batch Designer
::Coded by SmartGenius
setlocal enabledelayedexpansion
:Init
Set LimX=30
Set LimY=8
for /l %%a in (0,1,%LimX%) do (
for /l %%b in (0,1,%LimY%) do (
set X%%aY%%b=))
for %%a in (X1Y0,X1Y1,X1Y2,X1Y3,X1Y4,X2Y0,X2Y4,X3Y0,X3Y4,X4Y0,X4Y1,X4Y2,X4Y3,X4Y4,X5Y0,X5Y4,X6Y0,X6Y2,X6Y4,X7Y0,X7Y1,X7Y2,X7Y3,X7Y4,X8Y0,X8Y4,X8Y5,X8Y6,X8Y7,X8Y8,X9Y0,X9Y4,X9Y6,X9Y7,X9Y8,X10Y0,X10Y1,X10Y2,X10Y3,X10Y4,X10Y8,X11Y0,X11Y2,X11Y3,X11Y4,X11Y6,X11Y7,X11Y8,X12Y0,X12Y4,X12Y5,X12Y6,X12Y7,X12Y8,X13Y0,X13Y2,X13Y3,X13Y4,X13Y8,X14Y0,X14Y1,X14Y2,X14Y3,X14Y4,X14Y8,X15Y4,X15Y5,X15Y6,X15Y7,X15Y8,X16Y4,X16Y8,X17Y4,X17Y7,X17Y8,X18Y4,X18Y8,X19Y4,X19Y5,X19Y6,X19Y7,X19Y8,X20Y4,X20Y8,X21Y4,X21Y6,X21Y7,X21Y8,X22Y4,X22Y6,X22Y7,X22Y8,X23Y4,X23Y8,X24Y4,X24Y5,X24Y6,X24Y7,X24Y8) do (Set %%a=)
for %%a in (X5Y2,X8Y2,X9Y2,X10Y6,X10Y7,X12Y2,X12Y3,X13Y5,X13Y6,X13Y7,X16Y5,X16Y6,X16Y7,X18Y5,X18Y6,X18Y7,X20Y5,X20Y6,X20Y7,X21Y5,X22Y5,X23Y5,X23Y6,X23Y7) do (Set %%a=)
for %%a in (X2Y3,X3Y1,X6Y1,X6Y3,X9Y5,X10Y5,X11Y1,X11Y5,X12Y1,X13Y1,X14Y5,X14Y6,X14Y7,X17Y5,X17Y6) do (Set %%a=)
for %%a in (X2Y1,X5Y1,X8Y1) do (Set %%a=)
for %%a in (X3Y2,X9Y1) do (Set %%a=)
for %%a in (X2Y2,X5Y3,X8Y3) do (Set %%a=)
for %%a in (X3Y3,X9Y3) do (Set %%a=)
:Graphic
Call :Clear
echo.
for /l %%d in (0,1,%LimY%) do (
for /l %%e in (0,1,%LimX%) do (
set Lin_%%d=!Lin_%%d!!X%%eY%%d!))
for /l %%f in (0,1,%LimY%) do (echo. !Lin_%%f!)
echo.
pause
exit
:Clear
cls
for /l %%m in (0,1,%LimY%) do (set Lin_%%m=)
Goto :Eof
Espero que les sea de gran utilidad, y que les ayude a entender el tema, ya les traere algo para lo de las animaciones.
Saludos.