Je viens de trouver ce script sur le forum US :
► Afficher le textevoir le script trouvé sur le forum US
Code : Tout sélectionner
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
#include <StaticConstants.au3>
#include <GUIConstants.au3>
guicreate("Snake", 500,500)
guisetstate(@sw_show)
global $direction = 1, $bx = 10, $by = 485, $moves = 1, $ai, $up, $down, $left, $right
dim $bxold[2]
dim $byold[2]
global $direction1 = 1, $bx1 = 485, $by1 = 485, $moves1 = 1
dim $bxold1[2]
dim $byold1[2]
;$bxold[0] = 20
;$byold[0] = 470
;$bxold1[0] = 470
;$byold1[0] = 470
$direction = 1
$direction1 = 1
$inst = guictrlcreatelabel("Joueur contre Ordinateur" & @crlf & @crlf & "Vous pouvez passer à travers les murs.", 200, 200, 100, 75, $SS_CENTER)
$start = guictrlcreatebutton("Démarrer", 225,300,50,20)
guictrlcreatelabel("",$bx,$by,5,5)
guictrlsetbkcolor(-1, 0x0000FF)
guictrlcreatelabel("",$bx1,$by1,5,5)
guictrlsetbkcolor(-1, 0xFF0000)
for $i = 0 to 500 step 10
guictrlcreatelabel("",$i,490,10,10)
guictrlsetbkcolor(-1, 0x000000)
next
for $i = 0 to 500 step 10
guictrlcreatelabel("",490, $i,10,10)
guictrlsetbkcolor(-1, 0x000000)
next
for $i = 0 to 500 step 10
guictrlcreatelabel("",$i,0,10,10)
guictrlsetbkcolor(-1, 0x000000)
next
for $i = 0 to 500 step 10
guictrlcreatelabel("",0, $i,10,10)
guictrlsetbkcolor(-1, 0x000000)
next
guisetstate(@sw_show)
while 1
$msg = guigetmsg()
Select
case $msg = $gui_event_close
exit 0
Case $msg = $start
guictrldelete($start)
guictrlsetdata($inst, "Démarrage dans 3...")
sleep(500)
guictrlsetdata($inst, "Démarrage dans 2...")
sleep(500)
guictrlsetdata($inst, "Démarrage dans 1...")
sleep(500)
guictrlsetdata($inst, "C'est parti !")
sleep(500)
guictrldelete($inst)
oneplayer()
endselect
sleep(25)
wend
func oneplayer() ;PLAYERS = 1------asdasdasd----------------------------------------------------
hotkeyset("{up}", "up")
hotkeyset("{down}", "down")
hotkeyset("{left}", "left")
hotkeyset("{right}", "right")
while 1
;blue BOX BELOW HERE------asdasdasd------------------------------------------------------------------
select ;1=up 2=down 3=left 4=right
case $direction = 1
$by -= 5 ;$by = 270
case $direction = 2
$by += 5
case $direction = 3
$bx -= 5
case $direction = 4
$bx += 5
endselect
guictrlcreatelabel("",$bx,$by,5,5)
guictrlsetbkcolor(-1, 0x0000FF)
if ($bx > 490 or $bx < 10) or ($by > 490 or $by < 10) then
select
case $bx > 490
$bx = 10
case $bx < 10
$bx = 490
case $by > 490
$by = 5
case $by < 10
$by = 490
endselect
endif
for $i = 0 to ($moves-1) step 1
if (($by = $byold[$i]) and ($bx = $bxold[$i])) or (($by = $byold1[$i]) and ($bx = $bxold1[$i])) then
msgbox(64, "Perdu", "Le joueur bleu à perdu !")
exit 0
endif
next
$moves += 1
redim $bxold[$moves+1]
redim $byold[$moves+1]
$bxold[$moves] = $bx
$byold[$moves] = $by
;RED COMPUTER BELOW ---asdasdasd-------------------------------------------------------------------
$up = checkup()
$down = checkdown()
$left = checkleft()
$right = checkright()
$up1 = checkup1()
$down1 = checkdown1()
$left1 = checkleft1()
$right1 = checkright1()
;msgbox(0,"hsf",$up & @crlf & $down & @crlf & $left & @crlf & $right & @crlf & $by1 & @crlf & $bx1 & @crlf)
select ;1=up 2=down 3=left 4=right
case ($by1-5 > 5) and $direction1 <> 2 and $up = 0 and $up1 = 0
$direction1 = 1
case ($bx1-5 > 5) and $direction1 <> 4 and $left = 0 and $left1 = 0
$direction1 = 3
case ($bx1+5 < 485) and $direction1 <> 3 and $right = 0 and $right1 = 0
$direction1 = 4
case ($by1+5 < 485) and $direction1 <> 1 and $down = 0 and $down1 = 0
$direction1 = 2
endselect
select ;1=up 2=down 3=left 4=right
case $direction1 = 1
$by1 -= 5
case $direction1 = 2
$by1 += 5
case $direction1 = 3
$bx1 -= 5
case $direction1 = 4
$bx1 += 5
case else
endselect
guictrlcreatelabel("",$bx1,$by1,5,5)
guictrlsetbkcolor(-1, 0xFF0000)
if ($bx1 > 490 or $bx1 < 10) or ($by1 > 490 or $by1 < 10) then
select
case $bx1 > 490
$bx1 = 10
case $bx1 < 10
$bx1 = 490
case $by1 > 490
$by1 = 5
case $by1 < 10
$by1 = 490
endselect
endif
for $i = 0 to ($moves1-1) step 1
if (($by1 = $byold1[$i]) and ($bx1 = $bxold1[$i])) or (($by1 = $byold[$i]) and ($bx1 = $bxold[$i])) then
msgbox(64, "Perdu", "Le joueur rouge à perdu !")
exit 0
endif
next
$moves1 += 1
redim $bxold1[$moves1+1]
redim $byold1[$moves1+1]
$bxold1[$moves1] = $bx1
$byold1[$moves1] = $by1
sleep(25)
wend
endfunc
func up()
$direction = 1
endfunc
func down()
$direction = 2
endfunc
func left()
$direction = 3
endfunc
func right()
$direction = 4
endfunc
func checkup()
for $i = 0 to $moves1 step 1
if (($by1-5) = $byold[$i]) and ($bx1 = $bxold[$i]) then
return 1
endif
next
endfunc
func checkdown()
for $i = 0 to $moves1 step 1
if (($by1+5) = $byold[$i]) and ($bx1 = $bxold[$i]) then
return 1
endif
next
endfunc
func checkleft()
for $i = 0 to $moves1 step 1
if (($bx1-5) = $bxold[$i]) and ($by1 = $byold[$i]) then
return 1
endif
next
endfunc
func checkright()
for $i = 0 to $moves1 step 1
if (($bx1+5) = $bxold[$i]) and ($by1 = $byold[$i]) then
return 1
endif
next
endfunc
func checkup1()
for $i = 0 to $moves1 step 1
if (($by1-5) = $byold1[$i]) and ($bx1 = $bxold1[$i]) then
return 1
endif
next
endfunc
func checkdown1()
for $i = 0 to $moves1 step 1
if (($by1+5) = $byold1[$i]) and ($bx1 = $bxold1[$i]) then
return 1
endif
next
endfunc
func checkleft1()
for $i = 0 to $moves1 step 1
if (($bx1-5) = $bxold1[$i]) and ($by1 = $byold1[$i]) then
return 1
endif
next
endfunc
func checkright1()
for $i = 0 to $moves1 step 1
if (($bx1+5) = $bxold1[$i]) and ($by1 = $byold1[$i]) then
return 1
endif
next
endfuncMais je ne sais pas du tout comment m'y prendre
Donc, est-ce que quelqu'un pourrait m'aider ?



