elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.



Tema destacado: Sigue las noticias ms importantes de seguridad informtica en el Twitter! de elhacker.NET


+ Foro de elhacker.net
|-+ Programacin
| |-+ Scripting
| | |-+ [Batch Game] PingPong v 1 - by :: SmartGenius ::
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Batch Game] PingPong v 1 - by :: SmartGenius ::  (Leído 4,205 veces)
SmartGenius

Desconectado Desconectado

Mensajes: 181


:P


Ver Perfil WWW
[Batch Game] PingPong v 1 - by :: SmartGenius ::
« en: 24 Enero 2009, 20:14 pm »

Bueno, que mas decirles.....otro Juego Batch mas a la lista  ;D

Ping Pong v 1


Descargar: http://one.xthost.info/smartv2/BatchGames/PingPong_bySmartGenius.zip (incluido CHOICE.COM)

Este es un juego similar al PingPong que alguna vez jugaron en las consolas, solo que en este la PC es invencible  >:D...auqnue eso lo podria modificar.  ;D

Controles:

Tecla "W" = Iniciar Juego / Acelerar la Bola
Tecla "A" = Mover Tabla a la Izquierda
Tecla "D" = Mover Tabla a la Derecha
Tecla "X" = Salir de Juego


Aqui el Codigo usado......en Base a lo aprendido con el tema de Graficos y Coordenadas.  ;)

Código:
 @echo off
 @title PingPong v 1
 @mode con cols=28 lines=24
 @::Juego Batch PingPong
 @::Another Batch Game
 @::by ::SmartGenius ::

if not exist "choice.com" (Goto :NoKey)

:load
call :Logo
setlocal enabledelayedexpansion
set LimX=18
set LimY=16
set TBound=3
set LBound=1
set /a RBound=%LimX%-1
set /a BBound=%LimY%-3
set NLevels=1

:init
for /l %%a in (0,1,%LimX%) do (
for /l %%b in (0,1,%LimY%) do (
set X%%aY%%b= ))
set Ball=O
set Bound=
set Block=
set Line=
set Lost=

:Levels
set /a L+=1
Call :Level%L%
Call :Graphic
set P%L%=%Movs%
if "%LOS%"=="True" Goto :Lost
if "%NXL%"=="True" Goto :End
if "%L%"=="%NLevels%" Goto :Win
ping -n 1 0.0.0.0 >nul
Goto :Init

:Graphic
Call :Clear
cls
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.
echo.   PingPong v 1 by Smart
echo.
echo.    PC:%PPC%     Player:%Points%
echo.   ͻ
for /l %%f in (0,1,%LimY%) do (echo.   !Lin_%%f!)
echo.   ͼ
rem pause >nul
call :%Action%
if "%PPC%"=="10" (Set LOS=True&set NXL=True)
if "%NXL%"=="True" (Goto :Eof)
Goto :Graphic

:Paused
CHOICE /C:WADX /N >nul
if "%errorlevel%"=="1" (set Action=Playing)
if "%errorlevel%"=="2" (call :LeftA)
if "%errorlevel%"=="3" (call :RightA)
if "%errorlevel%"=="4" (set NXL=True)
Call :MovPC "%CurPos%"
Goto :Eof

:Playing
CHOICE /C:WADX /N /T:W,1 >nul
if "%errorlevel%"=="1" (set Action=Playing)
if "%errorlevel%"=="2" (call :LeftB)
if "%errorlevel%"=="3" (call :RightB)
if "%errorlevel%"=="4" (set NXL=True)
Call :MovBall
Call :MovPC "%CurPos%"
Goto :Eof

::Logica de Movimiento en el Plano
::Coded by :: SmartGenius ::

:RightA
if ["%Table%"]==["%MaxTable%"] (Goto :Eof)
for /f "tokens=1,5 delims=," %%u in ("%Table%") do (
call :MovAX+ "%%u" "%%v" TB "!%%u!"
call set NewTable=!TB!,%Table%
for /f "tokens=1-5 delims=," %%t in ("!NewTable!") do (set NewTable=%%t,%%u,%%v,%%w,%%x)
set Table=!NewTable!
call :MovAX+ "%CurPos%" "%CurPos%" CurPos "!%CurPos%!"
)
Goto :Eof

:MovAX+
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
set /a MovX=%%p+1
call set NMovX=%%X!MovX!Y%%q%%
if "!NMovX!"=="%Bound%" (Goto :Eof)
if "!NMovX!"==" " (
set %~2=
set X!MovX!Y%%q=%~4
set %3=X!MovX!Y%%q))
Goto :Eof

:RightB
if ["%Table%"]==["%MaxTable%"] (Goto :Eof)
for /f "tokens=1,5 delims=," %%u in ("%Table%") do (
call :MovAX+ "%%u" "%%v" TB "!%%u!"
call set NewTable=!TB!,%Table%
for /f "tokens=1-5 delims=," %%t in ("!NewTable!") do (set NewTable=%%t,%%u,%%v,%%w,%%x)
set Table=!NewTable!)
Goto :Eof

:LeftA
if ["%Table%"]==["%MinTable%"] (Goto :Eof)
for /f "tokens=1,5 delims=," %%u in ("%Table%") do (
call :MovAX- "%%v" "%%u" TB "!%%v!"
call set NewTable=%Table%,!TB!
for /f "tokens=2-6 delims=," %%t in ("!NewTable!") do (set NewTable=%%t,%%u,%%v,%%w,%%x)
set Table=!NewTable!
call :MovAX- "%CurPos%" "%CurPos%" CurPos "!%CurPos%!"
)
Goto :Eof

:LeftB
if ["%Table%"]==["%MinTable%"] (Goto :Eof)
for /f "tokens=1,5 delims=," %%u in ("%Table%") do (
call :MovAX- "%%v" "%%u" TB "!%%v!"
call set NewTable=%Table%,!TB!
for /f "tokens=2-6 delims=," %%t in ("!NewTable!") do (set NewTable=%%t,%%u,%%v,%%w,%%x)
set Table=!NewTable!)
Goto :Eof

:MovAX-
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
set /a MovX=%%p-1
call set NMovX=%%X!MovX!Y%%q%%
if "!NMovX!"=="%Bound%" (Goto :Eof)
if "!NMovX!"==" " (
set %~2=
set X!MovX!Y%%q=%~4
set %3=X!MovX!Y%%q))
Goto :Eof

:MovPC
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
for /l %%x in (%LBound%,1,%RBound%) do (set X%%xY2= )
set /a PCL=%%p-2
set /a PCR=%%p+2
for /l %%s in (!PCL!,1,!PCR!) do (set X%%sY2=%Bound%))
Goto :Eof

:MovBall
set EOM=False
Call :%NextMov% "%CurPos%"
if "%EOM%"=="True" Goto :Eof
Goto :MovBall

::Moviemtos Diagonales de la Bola
::Movimiento Diagonal1
:Diag1
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
set /a MovX=%%p+1
set /a MovY=%%q+1
call set NMovXY=%%X!MovX!Y!MovY!%%

if "!NMovXY!"=="%Bound%" (
if "%%q"=="%BBound%" (set NextMov=Diag3)
if "%%p"=="%RBound%" (set NextMov=Diag4)
Goto :Eof)

if "!NMovXY!"==" " (
set %~1=
set X!MovX!Y!MovY!=%Ball%
set CurPos=X!MovX!Y!MovY!
set EOM=True)
)

if "!NMovXY!"=="%Lost%" (
set %~1=
set /a PPC+=1
call :Reset
set EOM=True)
)
Goto :Eof

::Movimiento Diagonal2
:Diag2
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
set /a MovX=%%p-1
set /a MovY=%%q-1
call set NMovXY=%%X!MovX!Y!MovY!%%

if "!NMovXY!"=="%Bound%" (
if "%%q"=="%TBound%" (set NextMov=Diag4)
if "%%p"=="%LBound%" (set NextMov=Diag3)
Goto :Eof)

if "!NMovXY!"==" " (
set %~1=
set X!MovX!Y!MovY!=%Ball%
set CurPos=X!MovX!Y!MovY!
set EOM=True)
)

if "!NMovXY!"=="%Lost%" (
set %~1=
set /a Points+=1
call :Reset
set EOM=True)
)
Goto :Eof

::Movimiento Diagonal3
:Diag3
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
set /a MovX=%%p+1
set /a MovY=%%q-1
call set NMovXY=%%X!MovX!Y!MovY!%%

if "!NMovXY!"=="%Bound%" (
if "%%q"=="%TBound%" (set NextMov=Diag1)
if "%%p"=="%RBound%" (set NextMov=Diag2)
Goto :Eof)

if "!NMovXY!"==" " (
set %~1=
set X!MovX!Y!MovY!=%Ball%
set CurPos=X!MovX!Y!MovY!
set EOM=True)
)

if "!NMovXY!"=="%Lost%" (
set %~1=
set /a Points+=1
call :Reset
set EOM=True)
)
Goto :Eof

::Movimiento Diagonal4
:Diag4
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
set /a MovX=%%p-1
set /a MovY=%%q+1
call set NMovXY=%%X!MovX!Y!MovY!%%

if "!NMovXY!"=="%Bound%" (
if "%%q"=="%BBound%" (set NextMov=Diag2)
if "%%p"=="%LBound%" (set NextMov=Diag1)
Goto :Eof)

if "!NMovXY!"==" " (
set %~1=
set X!MovX!Y!MovY!=%Ball%
set CurPos=X!MovX!Y!MovY!
set EOM=True)
)

if "!NMovXY!"=="%Lost%" (
set %~1=
set /a PPC+=1
call :Reset
set EOM=True)
)
Goto :Eof

:Clear
for /l %%m in (0,1,%LimY%) do (set Lin_%%m=)
Goto :Eof

:Reset
set CurPos=X8Y13
set Table=X10Y14,X9Y14,X8Y14,X7Y14,X6Y14
for /l %%h in (1,1,17) do (set X%%hY14= )
for %%k in (%Init%) do (set %%k=%Line%)
for /f "tokens=1 delims=," %%j in ("%Init%") do (set %%j=%Ball%)
set Action=Paused
Goto :Eof

:Lost
msg * Perdiste !

:End
msg * Gracias por Jugar PingPong v1 by :: SmartGenius::
endlocal
exit

::Niveles del Juego PingPong
::Coordenadas Cartesianas
::Coded by :: SmartGenius ::

::Inicio Nivel 1
:Level1
set Movs=0
set Points=0
set PPC=0
set CurPos=X8Y13
set Table=X10Y14,X9Y14,X8Y14,X7Y14,X6Y14
set MaxTable=X17Y14,X16Y14,X15Y14,X14Y14,X13Y14
set MinTable=X5Y14,X4Y14,X3Y14,X2Y14,X1Y14
set Init=X8Y13,X6Y14,X7Y14,X8Y14,X9Y14,X10Y14
set Lives=3
set Dir=N
set Action=Paused
set NextMov=Diag3
for /l %%e in (%LBound%,1,%RBound%) do (set X%%eY1=.)
for /l %%f in (6,1,10) do (set X%%fY2=%Bound%)
for %%k in (%Init%) do (set %%k=%Line%)
for /f "tokens=1 delims=," %%j in ("%Init%") do (set %%j=%Ball%)
for /l %%i in (0,1,%LimX%) do (
set X0Y%%i=%Bound%
set X%LimX%Y%%i=%Bound%
set X%%iY0=%Bound%
set X%%iY%LimY%=%Bound%)
rem for /l %%l in (2,1,16) do (set X%%lY2=%Block%)
rem for /l %%m in (4,1,14) do (set X%%mY3=%Block%)
rem for /l %%n in (6,1,12) do (set X%%nY4=%Block%)
rem for /l %%o in (8,1,10) do (set X%%oY5=%Block%)
for /l %%r in (1,1,17) do (set X%%rY15=%Lost%)
Goto :Eof

::Fin Nivel 1

::Fin de Coordenadas

:Logo
cls
echo.
echo.
echo.
echo. ۰۰۰۰۰
echo. ۰۰۰۰۰۰۰
echo. ۰۰۰۰۰۰۰
echo. ۰۰۰۰۰۰۰
echo. ۰۰۰۰۰۰
echo. ۰۰۰۰۰
echo.
echo.
echo.
echo. ۰۰۰۰
echo. ۰۰۲۰۰۰۰
echo. ۰۰۰۱۰۰۰
echo. ۰۰۰۰۰۰۰
echo. ۰۲۰۰۰۰
echo. ۰۰۰۰
echo. ۰
echo.
echo. : SmartGenius :
echo.  Corp.  2009  
echo.
ping -n 3 0.0.0.0 >nul
Goto :Eof


:NoKey
 @mode con cols=30 lines=20
cls
echo.
echo  Uno de los archivos necesarios para el
echo  funcionamiento de este Script no se
echo  encuentra.
echo.
echo  CHOICE.COM
echo.
echo  Por favor descargue una copia del Comando
echo  CHOICE de Internet...
echo.
pause
exit

Cualquier duda, comentario o sugerencia es Bienvenida.....

Que lo disfruten...y un Saludo  :D



« Última modificación: 14 Agosto 2009, 06:51 am por :: SmartGenius :: » En línea


Pablo Videla


Desconectado Desconectado

Mensajes: 2.274



Ver Perfil WWW
Re: [Batch Game] PingPong v 1 - by :: SmartGenius ::
« Respuesta #1 en: 24 Enero 2009, 20:22 pm »

No hay una forma de aumentar la velocidad de la bola? XD del 0 en este caso  :P


En línea

SmartGenius

Desconectado Desconectado

Mensajes: 181


:P


Ver Perfil WWW
Re: [Batch Game] PingPong v 1 - by :: SmartGenius ::
« Respuesta #2 en: 22 Marzo 2009, 20:29 pm »

No hay una forma de aumentar la velocidad de la bola? XD del 0 en este caso  :P

mi querido amigo...esto esta limitado por el CHOICE cuyo menor tiempo es 1 segundo, aunque puedes pulsar la W que hara que ande mas rapido pero igualmente perderas......xD xD

Si encuentran la manera de usar milisegundos en vez de segundos pues seguro que se podria mejorar.....

Saludos.
En línea


Pablo Videla


Desconectado Desconectado

Mensajes: 2.274



Ver Perfil WWW
Re: [Batch Game] PingPong v 1 - by :: SmartGenius ::
« Respuesta #3 en: 22 Marzo 2009, 22:06 pm »

No hay una forma de aumentar la velocidad de la bola? XD del 0 en este caso  :P

mi querido amigo...esto esta limitado por el CHOICE cuyo menor tiempo es 1 segundo, aunque puedes pulsar la W que hara que ande mas rapido pero igualmente perderas......xD xD

Si encuentran la manera de usar milisegundos en vez de segundos pues seguro que se podria mejorar.....

Saludos.
Bueno no importa... pero te felicito por tu creatividad!  ;-)
En línea

Kobra5

Desconectado Desconectado

Mensajes: 122


Novus Ordo Seclorum


Ver Perfil
Re: [Batch Game] PingPong v 1 - by :: SmartGenius ::
« Respuesta #4 en: 29 Marzo 2009, 03:36 am »

Hola,,,
Wenas

Lamentablemente, no he podido descargarlo...
si no es mucha molestia, serias tan amable de poner otro link d edescarga..
la verdad esta chido...
ya tengo los otros; el pushbox,
y he puesto el choise de los otros con el code que posteastes pero no me funca
me dice que necesito el CHOISE.COM
En línea


SmartGenius

Desconectado Desconectado

Mensajes: 181


:P


Ver Perfil WWW
Re: [Batch Game] PingPong v 1 - by :: SmartGenius ::
« Respuesta #5 en: 29 Marzo 2009, 19:08 pm »

Hola,,,
Wenas

Lamentablemente, no he podido descargarlo...
si no es mucha molestia, serias tan amable de poner otro link d edescarga..
la verdad esta chido...
ya tengo los otros; el pushbox,
y he puesto el choise de los otros con el code que posteastes pero no me funca
me dice que necesito el CHOISE.COM

Copias el code al bloc de notas y lo guardas con extension .bat, luego te descargas el CHOICE.COM y lo pones al lado del code...o mejor lo copias la system32 y comentas la linea en que se pide el CHOICE...

http://ftp://ftp.microsoft.com/Services/TechNet/Windows/msdos/RESKIT/SUPPDISK/CHOICE.COM

Saludos.
En línea


Kobra5

Desconectado Desconectado

Mensajes: 122


Novus Ordo Seclorum


Ver Perfil
Re: [Batch Game] PingPong v 1 - by :: SmartGenius ::
« Respuesta #6 en: 31 Marzo 2009, 02:55 am »

men gracias por el choise.com..
ya me funca a 100%!!
lo he pegado en alado del bat y listo...
rula bien.
La verdad esta buenisimo el jueguito,

Saludos
Kobra5


En línea


Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Batch Game] BattleShips v 1 - by :: SmartGenius ::
Scripting
SmartGenius 4 4,358 Último mensaje 20 Julio 2011, 13:06 pm
por moikano→@
[BATCH GAME] Batch Tetris V 1.0!
Scripting
Binary_Death 2 4,200 Último mensaje 3 Agosto 2012, 06:14 am
por Binary_Death
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines