Batch Index du Forum
S’enregistrerRechercherFAQMembresGroupesConnexion
Répondre au sujet Page 1 sur 1
[BatchGame] BlockBreaker
Auteur Message
Répondre en citant
Message [BatchGame] BlockBreaker 
Bonjour à tous

toujours plus fort, SmartGenius propose un brix en couleur :

Utiliser les lettres du clavier A (gauche) ,D (droite),W (tirer / accelerer la balle ) et X pour sortir du jeu.

http://smart.code-makers.net/BatchGames/BlockBreakerv1BySmartgenius.zip



Je poste le code de la version coloré qui utilise choice et colous
Code:

@Echo off
@title BlockBreaker v 1
@mode con cols=28 lines=24

:: Batch Game - BlockBreaker v 1 Colored Version
:: Coded by SmartGenius
:: SmartGenius, Corp. 2010

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

:Load
Call :Logo
Setlocal enabledelayedexpansion
Set /a "LimX=18","LimY=16","TBound=1","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=[0] "))
Set "Ball=[9]O"
Set "Bound=[5]$219"
Set "Line=[6]$219"
Set "Lost=[2]$176"
Set "Point=[12]*"

:Levels
Set /a L+=1
Call :Level%L%
Call :Graphic
Set P%L%=%Movs%
If "%LOS%"=="True" Goto :Lost
If "%WIN%"=="True" Goto :Win
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.  BlockBreaker v 1 by Smart
Echo.
Echo.   Lives:%Lives%    Points:%Points%
Echo.   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
For /l %%f in (0,1,%LimY%) do (Colous Writesec "[0]   [11]$186!Lin_%%f![11]$186")
Echo.   ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Goto :%Action%

:Check
Colous 11 0 22,4 "%Points%"
If "%Lives%"=="0" (Goto :Lost)
If "%Dots%"=="0" (Goto :Win)
If "%NXL%"=="True" (Goto :End)
Goto :Eof

: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 :Check
Goto :%Action%

: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 :Check
Goto :%Action%

: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

: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

: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

: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!"=="[0] " (
Call :Color %2 "[0] "
Set "%~2=[0] "
Set X!MovX!Y%%q=%~4
Set %3=X!MovX!Y%%q
Call :Color !%3! "%%!%3!%%"
))
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!"=="[0] " (
Call :Color %2 "[0] "
Set "%~2=[0] "
Set X!MovX!Y%%q=%~4
Set %3=X!MovX!Y%%q
Call :Color !%3! "%%!%3!%%"
))
Goto :Eof

:MovBall
Set EOM=False
Call :%NextMov% "%CurPos%"
If "%EOM%"=="True" Goto :Eof
Goto :MovBall

:Color
For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (Set /a "ColX=%%p+5"&Set /a "ColY=%%q+6")
Set "Symbol=%~2"
rem Echo.%Symbol%
Colous %Symbol:~1,1% 0 %ColX%,%ColY% "%Symbol:~3%"
Colous Cursoroff
Goto :Eof

: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 NMovX=%%X!MovX!Y%%q%%
call Set NMovY=%%X%%pY!MovY!%%
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!"=="%Line%" (
If "%%q"=="%BBound%" (Set NextMov=Diag3)
If "%%p"=="%RBound%" (Set NextMov=Diag4)
Goto :Eof)

If "!NMovY!"=="%Point%" (
Set "X%%pY!MovY!=[0] "
Call :Color "X%%pY!MovY!" "[0] "
Set NextMov=Diag3
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovX!"=="%Point%" (
Set "X!MovX!Y%%q=[0] "
Call :Color "X!MovX!Y%%q" "[0] "
Set NextMov=Diag4
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovXY!"=="%Point%" (
Set "X!MovX!Y!MovY!=[0] "
Call :Color "X!MovX!Y!MovY!" "[0] "
Set NextMov=Diag2
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)

If "!NMovXY!"=="[0] " (
Call :Color "%~1" "[0] "
Set "%~1=[0] "
Set X!MovX!Y!MovY!=%Ball%
Set CurPos=X!MovX!Y!MovY!
Call :Color "!CurPos!" "%Ball%"
Set EOM=True)
)

If "!NMovXY!"=="%Lost%" (
Set "%~1=[0] "
Set /a Lives-=1
Goto :ReSet
)
)
Goto :Eof

: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 NMovX=%%X!MovX!Y%%q%%
call Set NMovY=%%X%%pY!MovY!%%
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!"=="%Line%" (
If "%%q"=="%TBound%" (Set NextMov=Diag4)
If "%%p"=="%LBound%" (Set NextMov=Diag3)
Goto :Eof)

If "!NMovY!"=="%Point%" (
Set "X%%pY!MovY!=[0] "
Call :Color "X%%pY!MovY!" "[0] "
Set NextMov=Diag4
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovX!"=="%Point%" (
Set "X!MovX!Y%%q=[0] "
Call :Color "X!MovX!Y%%q" "[0] "
Set NextMov=Diag3
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovXY!"=="%Point%" (
Set "X!MovX!Y!MovY!=[0] "
Call :Color "X!MovX!Y!MovY!" "[0] "
Set NextMov=Diag1
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)

If "!NMovXY!"=="[0] " (
Call :Color "%~1" "[0] "
Set "%~1=[0] "
Set X!MovX!Y!MovY!=%Ball%
Set CurPos=X!MovX!Y!MovY!
Call :Color "!CurPos!" "%Ball%"
Set EOM=True)
)

If "!NMovXY!"=="%Lost%" (
Set "%~1=[0] "
Set /a Lives-=1
Goto :ReSet
)
)
Goto :Eof

: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 NMovX=%%X!MovX!Y%%q%%
call Set NMovY=%%X%%pY!MovY!%%
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!"=="%Line%" (
If "%%q"=="%TBound%" (Set NextMov=Diag1)
If "%%p"=="%RBound%" (Set NextMov=Diag2)
Goto :Eof)

If "!NMovY!"=="%Point%" (
Set "X%%pY!MovY!=[0] "
Call :Color "X%%pY!MovY!" "[0] "
Set NextMov=Diag1
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovX!"=="%Point%" (
Set "X!MovX!Y%%q=[0] "
Call :Color "X!MovX!Y%%q" "[0] "
Set NextMov=Diag2
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovXY!"=="%Point%" (
Set "X!MovX!Y!MovY!=[0] "
Call :Color "X!MovX!Y!MovY!" "[0] "
Set NextMov=Diag4
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)

If "!NMovXY!"=="[0] " (
Call :Color "%~1" "[0] "
Set "%~1=[0] "
Set X!MovX!Y!MovY!=%Ball%
Set CurPos=X!MovX!Y!MovY!
Call :Color "!CurPos!" "%Ball%"
Set EOM=True)
)

If "!NMovXY!"=="%Lost%" (
Set "%~1=[0] "
Set /a Lives-=1
Goto :ReSet
)
)
Goto :Eof

: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 NMovX=%%X!MovX!Y%%q%%
call Set NMovY=%%X%%pY!MovY!%%
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!"=="%Line%" (
If "%%q"=="%BBound%" (Set NextMov=Diag2)
If "%%p"=="%LBound%" (Set NextMov=Diag1)
Goto :Eof)

If "!NMovY!"=="%Point%" (
Set "X%%pY!MovY!=[0] "
Call :Color "X%%pY!MovY!" "[0] "
Set NextMov=Diag2
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovX!"=="%Point%" (
Set "X!MovX!Y%%q=[0] "
Call :Color "X!MovX!Y%%q" "[0] "
Set NextMov=Diag1
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)
If "!NMovXY!"=="%Point%" (
Set "X!MovX!Y!MovY!=[0] "
Call :Color "X!MovX!Y!MovY!" "[0] "
Set NextMov=Diag3
Set /a Points+=5
Set /a Dots-=1
Goto :Eof
)

If "!NMovXY!"=="[0] " (
Call :Color "%~1" "[0] "
Set "%~1=[0] "
Set X!MovX!Y!MovY!=%Ball%
Set CurPos=X!MovX!Y!MovY!
Call :Color "!CurPos!" "%Ball%"
Set EOM=True)
)

If "!NMovXY!"=="%Lost%" (
Set "%~1=[0] "
Set /a Lives-=1
Goto :ReSet
)
)
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=[0] ")
For %%k in (%Init%) do (Set %%k=%Line%)
For /f "tokens=1 delims=," %%j in ("%Init%") do (Set %%j=%Ball%)
Set Action=Paused
Call :Check
Goto :Graphic

:Lost
msg * Perdiste !
Goto :End

:Win
msg * Has Ganado !
Goto :End

:End
msg * Gracias por Jugar BlockBreaker v1 by SmartGenius
Endlocal
Exit

:Level1
Set /a "Movs=0","Points=0","Dots=36","Lives=3"
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 Dir=N
Set Action=Paused
Set NextMov=Diag3
For /l %%e in (%LBound%,1,%RBound%) do (Set "X%%eY1=[0] ")
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%")
For /l %%l in (2,1,16) do (Set "X%%lY2=%Point%")
For /l %%m in (4,1,14) do (Set "X%%mY3=%Point%")
For /l %%n in (6,1,12) do (Set "X%%nY4=%Point%")
For /l %%o in (8,1,10) do (Set "X%%oY5=%Point%")
For /l %%r in (1,1,17) do (Set "X%%rY15=%Lost%")
Goto :Eof

:Logo
Cls
Color 0b
Echo.
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°ÛÛÛ°°Û°°°ÛÛÛ°°ÛÛ°Û°°Û°°
Echo. °°°Û°°Û°Û°°°Û°Û°Û°°°Û°Û°°°
Echo. °°°ÛÛÛ°°Û°°°Û°Û°Û°°°ÛÛ°°°°
Echo. °°°Û°°Û°Û°°°Û°Û°Û°°°Û°Û°°°
Echo. °°°ÛÛÛ°°ÛÛÛ°ÛÛÛ°°ÛÛ°Û°°Û°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°°B°R°E°A°K°E°R°°°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°±°±°±°±°±°±°±°±°±°±°±°°
Echo. °°±°±°±°±°±°±°±°±°±°±°±°°°
Echo. °°°±°±°±°±°±°±°±°±°±°±°±°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°°²°°°°°°°°°°°°°°°°°°°
Echo. °°°°ÛÛÛÛÛ°°°°°°°°°°°°°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°: SmartGenius :°°°°°°
Echo. °°°°°  Corp.  2010  °°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Ping -n 3 0.0.0.0 >nul
Goto :Eof

:NoKey
Mode con cols=30 lines=20
Cls
Echo.
Echo  File missing...
Echo.
Echo  CHOICE.COM
Echo.
Echo  Please download it from internet
Echo.
pause
exit





______________________________________________________
Faites paraitre votre batch sur BatchClipboard
Visiter le site web du posteur
Message Publicité 
PublicitéSupprimer les publicités ?


Répondre en citant
Message [BatchGame] BlockBreaker 
Shocked

Impressionnant ! Bravo à lui ! Okay




______________________________________________________
Répondre en citant
Message [BatchGame] BlockBreaker 
hello!

Il est vraiment balèze Okay
domma que ce soit si lent ...

@+




______________________________________________________
--
> Que pensez vous de l'ajout du repertoire point dans $PATH ?
Ma version de troll 18.0.32 beta 3 vient de me faire un core dump.
-+- SE in Guide du Linuxien Pervers : Bien développer son troll -+-

[Dos9]
Visiter le site web du posteur Skype
Répondre en citant
Message [BatchGame] BlockBreaker 
Incroyable Mort de Rire



Répondre en citant
Message [BatchGame] BlockBreaker 
C'est C Shocked Shocked L mais trop lent, je sais même pas si le jeu marche tellement que c'est lent Rolling Eyes




______________________________________________________
... L'orage éclate ...
... LINUX est né ! ...
... Adieu Windows...
Qu'il aille au nether! (Dans minecraft (rigole))
Répondre en citant
Message [BatchGame] BlockBreaker 
sa aller pas mal je vais teste Razz




______________________________________________________

noelgame éditeur indépendant de jeuxvideo venez nous aide dans nos projet
Visiter le site web du posteur MSN
Message [BatchGame] BlockBreaker 


Montrer les messages depuis:
Répondre au sujet Page 1 sur 1
  



Index | créer un forum | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation
Copyright 2008 - 2016 // Batch