[Autoit] Indovina la parola

« Older   Newer »
  Share  
greywolf92
view post Posted on 10/2/2009, 13:56




Ecco finito un nouvo gioco: Indovina la parola.

Source:
SPOILER (click to view)
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.0.0
Author: Greywolf

Script Function: Indovina la parola.
#ce ----------------------------------------------------------------------------

#include <array.au3>
#include <guiconstants.au3>

$Form1 = GUICreate("Indovina la parola", 625, 445, 307, 255)
$Group1 = GUICtrlCreateGroup("Author:", 5, 0, 161, 41)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Vai", 88, 336, 105, 25)
$Input1 = GUICtrlCreateInput("", 168, 304, 57, 21)
$Label1 = GUICtrlCreateLabel("Inserisci la posione della lettera che vuoi scoprire", 48, 290, 100, 40)
$Label4 = GUICtrlCreateLabel("Created by GreyWolf", 35, 16, 100, 20)
$Group2 = GUICtrlCreateGroup("Possibilitΰ", 360, 40, 217, 353)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Parola", 24, 110, 305, 57)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$1= GUICtrlCreatePic(@ScriptDir & "1.jpg", 420, 90, 100, 81)
$2= GUICtrlCreatePic(@ScriptDir & "2.jpg", 420, 180, 100, 81)
$3= GUICtrlCreatePic(@ScriptDir & "3.jpg", 420, 270, 100, 81)
$lett= "___"
GUICtrlCreateLabel($lett, 32, 135, 41, 25)
GUICtrlCreateLabel($lett, 82, 135, 41, 25)
GUICtrlCreateLabel($lett, 132, 135, 41, 25)
GUICtrlCreateLabel($lett, 182, 135, 41, 25)
GUICtrlCreateLabel($lett, 232, 135, 41, 25)
GUICtrlCreateLabel($lett, 282, 135, 35, 25)
$Input2 = GUICtrlCreateInput("", 160, 384, 129, 21)
$Label2 = GUICtrlCreateLabel("Inserisci la parola completa", 16, 384, 140, 25)
$Button2 = GUICtrlCreateButton("Controlla", 88, 408, 121, 25, 0)
$Button3 = GUICtrlCreateButton("Nuova parola", 410, 400, 121, 25, 0)
GUISetState(@SW_SHOW)

Global $parola,$var,$Array[7],$n,$lett,$a,$l1,$l2,$l3,$l4,$l5,$l6,$l7,$barra1,$barra2,$barra3

$a=Int(Random(1,58))
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
case $button1
$posizione=GUICtrlRead($input1)
if $posizione < 7 and $posizione <> 0 Then
controllolettera()
parola()
$n=$n+1
immagine()
Else
MsgBox(0,"Game","Inserire un numero da 1 a 6")
EndIf
case $button2
$soluzione=GUICtrlRead($input2)
If $soluzione = $parola And $soluzione <> "" Then
MsgBox(0,"Game","Complimenti!! Risposta esatta!!")
nuovo()
ElseIf $soluzione= "" Then
MsgBox(0,"Game","Inserire una parola")
Else
MsgBox(0,"Game","Risposta sbagliata. Ritenta")
GUICtrlDelete ($input2)
$Input2 = GUICtrlCreateInput("", 160, 384, 129, 21)
EndIf
case $button3
nuovo()
MsgBox(0,"Game","Verrΰ elaborata una nuova parola")

Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd


Func controllolettera()
$parola= FileReadLine(@ScriptDir & "gioco.txt",$a)
$Array[$posizione]=StringMid($parola, $posizione,1)
EndFunc


Func parola()
If $n < 3 Then
$numlettere= StringLen($parola)
$l1=GUICtrlCreateLabel($array[1], 39, 130, 41, 13)
$l2=GUICtrlCreateLabel($array[2], 89, 130, 41, 13)
$l3=GUICtrlCreateLabel($array[3], 139, 130, 41, 13)
$l4=GUICtrlCreateLabel($array[4], 189, 130, 41, 13)
$l5=GUICtrlCreateLabel($array[5], 239, 130, 41, 13)
$l6=GUICtrlCreateLabel($array[6], 289, 130, 35, 13)
GUICtrlDelete ($input1)
$Input1 = GUICtrlCreateInput("", 168, 304, 57, 21)
Else
MsgBox(0,"Game","Non puoi scoprire piω lettere. Prova a dare la soluzione")
EndIf
EndFunc

Func nuovo()
$a=Int(Random(1,58))
$n=0
$array[1]=""
$array[2]=""
$array[3]=""
$array[4]=""
$array[5]=""
$array[6]=""
$l1=GUICtrlCreateLabel($array[1], 39, 130, 41, 13)
$l2=GUICtrlCreateLabel($array[2], 89, 130, 41, 13)
$l3=GUICtrlCreateLabel($array[3], 139, 130, 41, 13)
$l4=GUICtrlCreateLabel($array[4], 189, 130, 41, 13)
$l5=GUICtrlCreateLabel($array[5], 239, 130, 41, 13)
$l6=GUICtrlCreateLabel($array[6], 289, 130, 35, 13)
GUICtrlDelete ($barra1)
GUICtrlDelete ($barra2)
GUICtrlDelete ($barra3)
$1= GUICtrlCreatePic(@ScriptDir & "1.jpg", 420, 90, 100, 81)
$2= GUICtrlCreatePic(@ScriptDir & "2.jpg", 420, 180, 100, 81)
$3= GUICtrlCreatePic(@ScriptDir & "3.jpg", 420, 270, 100, 81)
GUICtrlDelete ($input2)
$Input2 = GUICtrlCreateInput("", 160, 384, 129, 21)
EndFunc

Func immagine()
If $n=1 Then
GUICtrlDelete ($1)
$barra1= GUICtrlCreatePic(@ScriptDir & "barra1.jpg", 420, 90, 100, 81)
ElseIf $n=2 Then
GUICtrlDelete ($2)
$barra2= GUICtrlCreatePic(@ScriptDir & "barra2.jpg", 420, 180, 100, 81)
ElseIf $n=3 Then
GUICtrlDelete ($3)
$barra3= GUICtrlCreatePic(@ScriptDir & "barra3.jpg", 420, 270, 100, 81)
EndIf
EndFunc

image

Il gioco era nato come "Impiccato" ma in seguito l' ho cambiato.
Lo scopo θ quello di indovinare una parola di sei lettere avendo come possibilitΰ quella di scoprire 3 lettere a piacere. Una volta capita la parola basta scriverla nel box in basso per verificare se θ giusta o meno. Se θ troppo difficile si puς benissimo cambiarla.
Anche se il gioco sembra "semplice", vi assicuro che non θ stato tanto semplice crearlo... :P

Download qui

Edited by greywolf92 - 13/2/2009, 14:10
 
Top
† bird92 †
view post Posted on 10/2/2009, 18:26




stramitico! sei un grande grey!
Se mai farς una distribuzione linux, ti chiederς di scrivere alcuni giochi da includere... :D :D
 
Top
greywolf92
view post Posted on 10/2/2009, 18:28




CITAZIONE († bird92 † @ 10/2/2009, 18:26)
Se mai farς una distribuzione linux, ti chiederς di scrivere alcuni giochi da includere... :D :D

Contaci ;) :D
 
Top
*Kuja*
view post Posted on 11/2/2009, 21:15




mio dio amico si troppo forte..

io sto lavorando ad un keylogger.. xD

 
Top
greywolf92
view post Posted on 11/2/2009, 21:50




grazie ^_^ ;)
CITAZIONE
io sto lavorando ad un keylogger.. xD

Appena lo finisci postalo ;)
 
Top
*Kuja*
view post Posted on 11/2/2009, 22:46




certo..
 
Top
5 replies since 10/2/2009, 13:56   167 views
  Share