TheOnlyOne Posted December 12, 2008 Posted December 12, 2008 hey i want to make a very simple game right now it is a plate where you need to move around i cant get how i can get my man get around :S? expandcollapse popup[/code] #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> hotkeyset ("{right}","right") $4="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg"; that is my man $5="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica2.jpg"; that is the other plates local $avArray[9] $pic= $avArray[1] $pic= $avArray[2] $pic= $avArray[3] $pic= $avArray[4] $pic= $avArray[5] $pic= $avArray[6] $pic= $avArray[7] $pic= $avArray[8] $pic= $avArray[9] $1=0 $2=145 $3=282 #Region ### START Koda GUI section ### Form=C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\Form1.kxf $Form1 = GUICreate("Form1", 429, 434, 190, 121) $pic= GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $pic= GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $pos =$pic func right () $pos = $pos+3; its here when i click right its need to move to the right but how ? endfunc really hope you can help me here:)?
Zedna Posted December 12, 2008 Posted December 12, 2008 (edited) func right () $hwnd = ControlGetHandle($pic) $pos = WinGetPos($hwnd) GUICtrlSetPos($pic, $pos[0] + 3, $pos[1]); its here when i click right its need to move to the right but how ? endfunc Edited December 12, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
TheOnlyOne Posted December 12, 2008 Author Posted December 12, 2008 func right () $hwnd = ControlGetHandle($pic) $pos = WinGetPos($hwnd) GUICtrlSetPos($pic, $pos[0] + 3, $pos[1]); its here when i click right its need to move to the right but how ? endfunc hmm yeah okay now it work but a other problem is it dosent show when im clicking f5 ?' i think its becores i havent declared $pic? and btw there is one mistake C:\Documents and Settings\lo\Skrivebord\test.au3(31,32) : ERROR: ControlGetHandle() [built-in] called with wrong number of args. $hwnd = ControlGetHandle($pic1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\lo\Skrivebord\test.au3(33,20) : WARNING: $pic: possibly used before declaration. GUICtrlSetPos($pic, ~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\lo\Skrivebord\test.au3(33,20) : ERROR: $pic: undeclared global variable. GUICtrlSetPos($pic, ~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\lo\Skrivebord\test.au3 - 2 error(s), 1 warning(s)
TheOnlyOne Posted December 12, 2008 Author Posted December 12, 2008 uh and btw btw i think it works but in $hwnd = ControlGetHandle($pic1) it dosent work :S ? why ?
Zedna Posted December 12, 2008 Posted December 12, 2008 (edited) $hwnd = GUICtrlGetHandle($pic) Edited December 12, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
TheOnlyOne Posted December 12, 2008 Author Posted December 12, 2008 (edited) hmm when it opens it exit ? why it do that ? cant see what im doing wrong ? Edited December 12, 2008 by TheOnlyOne
TheOnlyOne Posted December 13, 2008 Author Posted December 13, 2008 okay i just see a mistake i have done now in my post here in stead i mean i need to chance the two pictures so they chance plase? how to do that?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now