Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

Moja Pierwsza Gierka W Autoit ;]

Rekomendowane odpowiedzi

Opublikowano

Ostatnio trochę zaniedbałem naukę AutoIT i postanowiłem to nadrobić :P A oto efekt.

 

Gra w 3 karty. Polega na wskazaniu właściwej karty. Jeśli się to uda zabieramy punkt przeciwnikowi (Komputer :D ), jeśli nie - wredny komp zabiera punkt nam. Jeżeli skosimy komputerowi wszystkie punkty wygrywamy. Jeśli on nam - przegrywamy xD Proste, nie? ;) Na pomysł wpadłem, gdy przypomniałem sobie film "Jak rozpętałem II wojnę światową" :P

Pisałem około 2 godziny... wizualnie nie zachwyca ale i tak się cieszę, że wgl coś wyszło :P Jestem... bardzo początkujący więc dla mnie to sukces :rolleyes:

 

Tutaj macie kod:

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$p = 5
$kp = 5
$karta = Random(1,3,1)

$Form1 = GUICreate("Form1", 267, 203, 192, 124)
$Button4 = GUICtrlCreateButton("Nowa gra", 0, 0, 52, 19, $WS_GROUP)
$Button5 = GUICtrlCreateButton("Info", 52, 0, 52, 19, $WS_GROUP)
$Button1 = GUICtrlCreateButton("Karta 1", 16, 40, 73, 105, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Karta 2", 96, 40, 73, 105, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Karta 3", 176, 40, 73, 105, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		$a = MsgBox(4, "Gra w 3 Karty", "Chcesz zakończyć grę?")
		If $a < 7 Then
		Exit
		EndIf
	Case $Button5
		MsgBox(0, "Gra w 3 Karty - Informacje", "Gra polega na wskazaniu odpowiedniej karty. Jeśli Ci się to uda przejmujesz od komputera 1 punkt. Jeśli nie - komputer przejmuje punkt od Ciebie. Wygrywa strona która jako pierwsza pozbawi przeciwnika wszystkich punktów.")
	Case $Button4
		$a = MsgBox(4, "Gra w 3 Karty", "Chcesz zakończyć bieżącą grę i rozpocząć nową?")
		If $a < 7 Then
			$p = 5
			$kp = 5
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
			$karta = Random(1,3,1)
		EndIf
	Case $Button1
		If $karta = 1 Then
			MsgBox(0, "Trafiony!", "To ta karta! Zdobywasz punkt!")
			$p = $p + 1
			$kp = $kp - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
			$karta = Random(1,3,1)
		Else
			MsgBox(0, "Pudło!", "Nie trafiłeś! Tracisz punkt.")
			$kp = $kp + 1
			$p = $p - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
			$karta = Random(1,3,1)
		EndIf
		If $p = 10 Then
			MsgBox(0, "WYGRANA!", "Wygrałes!!! Gratulacje!")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
					If $kp = 10 Then
			MsgBox(0, "Przegrana...", "Przegrałes...")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
	Case $Button2
		If $karta = 2 Then
			MsgBox(0, "Trafiony!", "To ta karta! Zdobywasz punkt!")
			$p = $p + 1
			$kp = $kp - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
			$karta = Random(1,3,1)
		Else
			MsgBox(0, "Pudło!", "Nie trafiłeś! Tracisz punkt.")
			$kp = $kp + 1
			$p = $p - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
			$karta = Random(1,3,1)
		EndIf
		If $p = 10 Then
			MsgBox(0, "WYGRANA!", "Wygrałes!!! Gratulacje!")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
					If $kp = 10 Then
			MsgBox(0, "Przegrana...", "Przegrałes...")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
	Case $Button3
		If $karta = 3 Then
			MsgBox(0, "Trafiony!", "To ta karta! Zdobywasz punkt!")
			$p = $p + 1
			$kp = $kp - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
			$karta = Random(1,3,1)
		Else
			MsgBox(0, "Pudło!", "Nie trafiłeś! Tracisz punkt.")
			$kp = $kp + 1
			$p = $p - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
			$karta = Random(1,3,1)
		EndIf
		If $p = 10 Then
			MsgBox(0, "WYGRANA!", "Wygrałes!!! Gratulacje!")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
		If $kp = 10 Then
			MsgBox(0, "Przegrana...", "Przegrałes...")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel("Komp: "&$kp&"", 184, 16, 45, 17)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel("Ty: "&$p&"", 24, 152, 45, 17)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
EndSwitch
WEnd
;  by wjatek 

 

 

Proszę o krytykę :P

Opublikowano
  • Autor

Nowa wersja :P z Grafiką! xD

 

Wiem, wiem... kiepsko zrobione i wgl... ale sporo siedziałem i zrobiłem z pierwszego pomysłu jaki mi wpadł do głowy. I jak na moje (na razie) skromne możliwości to (moim zdaniem) niezły kawałeczek kodu... :rolleyes:

 

Kod (długi :unsure:) :

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$p = 5
$kp = 5
$karta = Random(1,3,1)
$img = "cards\bottom.img"
$start = 1
$losbott = Random(1,4,1)
$form1 = GUICreate("Form1", 394, 298, 295, 218, -1, $WS_EX_TRANSPARENT)
GUISetState(@SW_SHOW)

While 1
If $losbott = 1 Then
	$bimg = "img\1.img"
EndIf
If $losbott = 2 Then
	$bimg = "img\2.img"
EndIf
If $losbott = 3 Then
	$bimg = "img\3.img"
EndIf
If $losbott = 4 Then
	$bimg = "img\4.img"
EndIf
If $start = 1 Then
	$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
	$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
	$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
	$Button4 = GUICtrlCreateButton("Nowa Gra", 0, 0, 57, 17, $WS_GROUP)
	$Button5 = GUICtrlCreateButton("Info", 56, 0, 57, 17, $WS_GROUP)
	$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
	$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
	$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
	$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
	$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
	$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
	$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
	$start = 0
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		$a = MsgBox(4, "Gra w 3 Karty", "Chcesz zakończyć grę?")
		If $a < 7 Then
		Exit
		EndIf
	Case $Button5
		MsgBox(0, "Gra w 3 Karty - Informacje", "Gra polega na wskazaniu czerwonej karty. Jeśli Ci się to uda przejmujesz od komputera 1 punkt. Jeśli nie - komputer przejmuje punkt od Ciebie. Wygrywa strona która jako pierwsza pozbawi przeciwnika wszystkich punktów.")
	Case $Button4
		$a = MsgBox(4, "Gra w 3 Karty", "Chcesz zakończyć bieżącą grę i rozpocząć nową?")
		If $a < 7 Then
			$p = 5
			$kp = 5
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
			$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
			$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			$karta = Random(1,3,1)
		EndIf
;=====================================================================================================
	Case $Button1
		If $karta = 1 Then
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic("cards\red.img", 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			Sleep(500)
			MsgBox(0, "Trafiony!", "To ta karta! Zdobywasz punkt!")
			$p = $p + 1
			$kp = $kp - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
			$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
			$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$karta = Random(1,3,1)
		Else
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic("cards\black.img", 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			Sleep(500)
			MsgBox(0, "Pudło!", "Nie trafiłeś! Tracisz punkt.")
			$kp = $kp + 1
			$p = $p - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
			$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
			$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$karta = Random(1,3,1)
		EndIf
		If $p = 10 Then
			MsgBox(0, "WYGRANA!", "Wygrałes!!! Gratulacje!")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
					$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
					$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
					If $kp = 10 Then
			MsgBox(0, "Przegrana...", "Przegrałes...")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
					$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
					$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
	Case $Button2
		If $karta = 2 Then
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic("cards\red.img", 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			Sleep(500)
			MsgBox(0, "Trafiony!", "To ta karta! Zdobywasz punkt!")
			$p = $p + 1
			$kp = $kp - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
			$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
			$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$karta = Random(1,3,1)
		Else
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic("cards\black.img", 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			Sleep(500)
			MsgBox(0, "Pudło!", "Nie trafiłeś! Tracisz punkt.")
			$kp = $kp + 1
			$p = $p - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
			$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
			$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$karta = Random(1,3,1)
		EndIf
		If $p = 10 Then
			MsgBox(0, "WYGRANA!", "Wygrałes!!! Gratulacje!")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
					$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
					$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
					If $kp = 10 Then
			MsgBox(0, "Przegrana...", "Przegrałes...")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
					$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
					$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
	Case $Button3
		If $karta = 3 Then
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic("cards\red.img", 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			Sleep(500)
			MsgBox(0, "Trafiony!", "To ta karta! Zdobywasz punkt!")
			$p = $p + 1
			$kp = $kp - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
			$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
			$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$karta = Random(1,3,1)
		Else
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic("cards\black.img", 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			Sleep(500)
			MsgBox(0, "Pudło!", "Nie trafiłeś! Tracisz punkt.")
			$kp = $kp + 1
			$p = $p - 1
			GUICtrlDelete($Label1)
			$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
			$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Label2)
			$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
			$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
			$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
			GUICtrlDelete($Button1)
			GUICtrlDelete($Button2)
			GUICtrlDelete($Button3)
			GUICtrlDelete($Bottom)
			$Button1 = GUICtrlCreatePic($img, 80, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button2 = GUICtrlCreatePic($img, 160, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Button3 = GUICtrlCreatePic($img, 240, 112, 70, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$Bottom = GUICtrlCreatePic($bimg, -8, 0, 401, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
			$karta = Random(1,3,1)
		EndIf
		If $p = 10 Then
			MsgBox(0, "WYGRANA!", "Wygrałes!!! Gratulacje!")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
					$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
					$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
		If $kp = 10 Then
			MsgBox(0, "Przegrana...", "Przegrałes...")
			$end = MsgBox(4, "Gra w 3 Karty", "Chcesz rozpocząć nową grę?")
				If $end < 7 Then
					$p = 5
					$kp = 5
					GUICtrlDelete($Label1)
					$Label1 = GUICtrlCreateLabel(" Komp: "&$kp&"", 280, 48, 70, 20)
					$Label1 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label1 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					GUICtrlDelete($Label2)
					$Label2 = GUICtrlCreateLabel(" Ty: "&$p&"", 32, 248, 70, 20)
					$Label2 = GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
					$Label2 = GUICtrlSetBkColor(-1, 0xA6CAF0)
					$karta = Random(1,3,1)
				Else
					Exit
				EndIf
		EndIf
;=====================================================================================================
EndSwitch
WEnd

 

 

 

 

 

A TUTAJ paczuszka z grafiką i exekiem B)

 

 

 

Co nowego:

- grafika :P

- losowe tło,

- po kliknięciu karta "odwraca się"...

- ... a po 0.5 sec pojawia się MsgBox.

 

Trochę się nakombinowałem. Pisać co źle, co można poprawić.

 

Aha i jeszcze to: http://www.mpcforum.pl/topic/342663-pytanie-gui-menu-i-odpowiednie-pojawianie-sie-obrazka/

Druga część tematu - tam opisany jeden problem :P Może nic wielkiego ale jakoś mnie to drażni :D (powinniście się skumać o co chodzi)

 

To ode mnie tyle, piszcie uwagi. Liczę na szczerość :P

  • 2 tygodnie później...

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.