jvanegmond Posted August 24, 2009 Posted August 24, 2009 I'm still missing the haha.png image. It's hard to see whether I am falling or not without that file. github.com/jvanegmond
TheOnlyOne Posted August 24, 2009 Author Posted August 24, 2009 i dont have the real picture so i made a fast one in paint http://www.megaupload.com/?d=GYY4DK4U
Authenticity Posted August 24, 2009 Posted August 24, 2009 (edited) Here is something.. It's definitely not seem correct or visually logic but you'll get it (I hope): expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPI.au3> Global Const $iStep = 2 Global Const $iPlayerHeight = 15, $iPlayerWidth = 10 Global $hGUI, $Graphic, $Label Global $aPlatforms[3][4] = [[25, 25, 75, 27], [75, 75, 125, 77], [125, 125, 175, 127]] Global $aRects[3] Global $tPoint = DllStructCreate($tagPOINT) $hGUI = GUICreate('Test', 200, 200) $Graphic = GUICtrlCreateGraphic(0, 0, 200, 200) GUICtrlSetBkColor($Graphic, 0xFFFFFF) GUICtrlSetGraphic($Graphic, $GUI_GR_COLOR, 0xFF0000) For $i = 0 To UBound($aRects)-1 $aRects[$i] = DllStructCreate($tagRECT) For $j = 1 To 4 DllStructSetData($aRects[$i], $j, $aPlatforms[$i][$j-1]) Next GUICtrlSetGraphic($Graphic, $GUI_GR_MOVE, $aPlatforms[$i][0], $aPlatforms[$i][3]) GUICtrlSetGraphic($Graphic, $GUI_GR_LINE, $aPlatforms[$i][2], $aPlatforms[$i][3]) Next GUISetState() $Label = GUICtrlCreateLabel('P', 25, 10, $iPlayerWidth, $iPlayerHeight) GUICtrlSetBkColor($Label, 0x00FF00) DllStructSetData($tPoint, 'X', 25) DllStructSetData($tPoint, 'y', 25) $aSize = WinGetClientSize($hGUI) While DllStructGetData($tPoint, 'X') < $aSize[0] And DllStructGetData($tPoint, 'Y') < $aSize[1] For $i = 0 To UBound($aRects)-1 If _WinAPI_PtInRect($aRects[$i], $tPoint) Then DllStructSetData($tPoint, 'X', DllStructGetData($tPoint, 'X')+$iStep) GUICtrlSetPos($Label, DllStructGetData($tPoint, 'X'), DllStructGetData($tPoint, 'Y')) ExitLoop EndIf Next If $i = UBound($aRects) Then ;~ DllStructSetData($tPoint, 'X', DllStructGetData($tPoint, 'X')+$iStep) DllStructSetData($tPoint, 'Y', DllStructGetData($tPoint, 'Y')+$iStep) GUICtrlSetPos($Label, DllStructGetData($tPoint, 'X'), DllStructGetData($tPoint, 'Y')) EndIf Sleep(10) WEnd Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Edited August 24, 2009 by Authenticity
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