Advertisement
flypip

flydroid (android)

Nov 22nd, 2011
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.50 KB | None | 0 0
  1. #include <GUIConstantsEx.au3>
  2. #include <StaticConstants.au3>
  3. #include <WindowsConstants.au3>
  4. #Region ### START Koda GUI section ### Form=
  5. #Include <Misc.au3> ;Pour _IsPressed
  6. #include <WindowsConstants.au3>
  7. $a = 0
  8. $b = 0
  9. $left = 100
  10. $up = 100
  11. $droid = @ScriptDir &"\android.jpg"
  12. $Form1 = GUICreate("Form1", 250, 350, 350, 200, BitOR($WS_POPUP,$WS_CLIPSIBLINGS))
  13. $Pic1 = GUICtrlCreatePic($droid, $left, 100, $up, 100)
  14. GUISetState(@SW_SHOW)
  15. GUISetState (@SW_MAXIMIZE, $Form1)
  16. GUISetBkColor(0x000000)
  17. HotKeySet("$","stop")
  18.  
  19. While 1
  20.  
  21. If _IsPressed("25") Then _gauche() ;
  22. If _IsPressed("27") Then _droite()
  23. If _IsPressed("26") Then _haut()
  24. If _IsPressed("28") Then _bas()
  25.  
  26.        
  27. WEnd
  28.  
  29. Func stop()
  30.     Exit
  31. EndFunc
  32.  
  33. func _bas()
  34. $up = $up+10
  35. GUICtrlSetPos($pic1,$left,$up)
  36. Sleep(1)
  37. If $up = 770 Then
  38. $up = 0
  39. GUICtrlSetPos($pic1,$left,$up)
  40. Sleep(1)
  41. Else
  42. EndIf
  43. EndFunc
  44.  
  45. Func _haut()
  46. $up = $up-10
  47. GUICtrlSetPos($pic1,$left,$up)
  48. Sleep(1)
  49. If $up = 0 Then
  50. $up = 770
  51. GUICtrlSetPos($pic1,$left,$up)
  52. Sleep(1)
  53. Else
  54. EndIf
  55. EndFunc
  56.  
  57.  
  58. Func _droite()
  59.  
  60. $left = $left+10
  61. GUICtrlSetPos($pic1,$left,$up)
  62. Sleep(1)
  63. If $left = 1020 Then
  64. $left = 0
  65. GUICtrlSetPos($pic1,$left,$up)
  66. Sleep(1)
  67. Else
  68. EndIf
  69. EndFunc
  70.  
  71. Func _gauche()
  72.  
  73. $left = $left-10
  74. GUICtrlSetPos($pic1,$left,$up)
  75. Sleep(1)
  76. If $left = 0 Then
  77. $left = 1020   
  78. GUICtrlSetPos($pic1,$left,$up)
  79. Sleep(1)
  80. Else
  81. EndIf
  82. EndFunc
  83. ;telecharger l'image android pour que sa marche.:http://www.2shared.com/photo/cT8G6tr-/android.html
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement