PDA

ดูเวอร์ชั่นเต็ม : เกมส์เป่ายิ้งชุบ (ฉบับง่าย)



purexe
1st December 2011, 17:21
สวัสดีครับผมเพิ่งมาบอร์ดนี้เป็นครั้งแรก ขอฝากตัวด้วย เกมส์ง่ายๆๆก่อนแล้วกันนะครับ

http://www.mediafire.com/?iyy053wxl7ap1p7

Code *-*
Autoit3



#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $a,$b,$mss
$Form1 = GUICreate("เป่ายิงชุบ", 180, 169, 192, 124)
$Button1 = GUICtrlCreateButton("ค้อน", 40, 24, 97, 25)
$Button2 = GUICtrlCreateButton("กระดาษ", 40, 64, 97, 25)
$Button3 = GUICtrlCreateButton("กรรไกร", 40, 104, 97, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$b=0
_prowinlose()
MsgBox(64,"ผลลัพธ์",$mss)
Case $Button2
$b=1
_prowinlose()
MsgBox(64,"ผลลัพธ์",$mss)
Case $Button3
$b=2
_prowinlose()
MsgBox(64,"ผลลัพธ์",$mss)
EndSwitch
WEnd

Func _prowinlose()
$mss=""
$a=10
While $a>2
$a=Round(Random(0,3))
WEnd
if $a=0 Then
$mss&="คอมพิวเตอร์ใช้ค้อน "
ElseIf $a=1 Then
$mss&="คอมพิวเตอร์ใช้กระดาษ "
ElseIf $a=2 Then
$mss&="คอมพิวเตอร์ใช้กรรไกร "
EndIf

if $a=$b Then
$mss&=@CRLF
$mss&="ซึ่งคุณเสมอ"
elseif $b=1 And $a=0 Then
$mss&=@CRLF
$mss&="ซึ่งคุณเชนะ"
elseif $b=2 And $a=1 Then
$mss&=@CRLF
$mss&="ซึ่งคุณเชนะ"
elseif $b=0 and $a=2 Then
$mss&=@CRLF
$mss&="ซึ่งคุณเชนะ"
elseif $a=1 And $b=0 Then
$mss&=@CRLF
$mss&="ซึ่งคุณแพ้"
elseif $a=2 And $b=1 Then
$mss&=@CRLF
$mss&="ซึ่งคุณแพ้"
elseif $a=0 And $b=2 Then
$mss&=@CRLF
$mss&="ซึ่งคุณแพ้"
EndIf
EndFunc

abc46matee
28th December 2011, 17:29
นำไปใช้กับ RPG maker ได้มั้ยครับ โค้ดนี้