Sign in to follow this  
Followers 0
Vindicator209

Close a moving window?

4 posts in this topic

I cant get this gui to close... why?

#include <GuiConstants.au3>
    ;up-down
$y=MouseGetPos(1)
    ;left-right
$x=MouseGetPos(0)+ 150
GuiCreate("zombie", 115, 165,$x, $y , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Pic_1 = GuiCtrlCreatePic("zombie.bmp", 0, 0, 120, 170)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    Case Else
        ;;;
EndSelect
$XMov=MouseGetPos(0)
    $YMov=$y + 10
    WinMove("zombie","",$Ymov,$XMov)
    Sleep(1000)
    $YMov=$y - 10
    WinMove("zombie","",$Ymov,$XMov)
    Sleep(1000)
    $YMov=$y - 10
    WinMove("zombie","",$Ymov,$XMov)
    Sleep(1000)
    $YMov=$y + 10
    WinMove("zombie","",$Ymov,$XMov)
WEnd
Exit

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites



#include <GuiConstants.au3>
HotKeySet("{Esc}", "_GetBiggerGun") ; it's a timing issue

;up-down
$y = MouseGetPos(1)
;left-right
$x = MouseGetPos(0) + 150
GUICreate("zombie", 115, 165, $x, $y, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Pic_1 = GUICtrlCreatePic("zombie.bmp", 0, 0, 120, 170)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case Else
            $XMov = MouseGetPos(0)
            $YMov = $y + 10
            WinMove("zombie", "", $YMov, $XMov)
            Sleep(1000)
            If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
            $YMov = $y - 10
            WinMove("zombie", "", $YMov, $XMov)
            Sleep(1000)
            If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
            $YMov = $y - 10
            WinMove("zombie", "", $YMov, $XMov)
            Sleep(1000)
            If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
            $YMov = $y + 10
            WinMove("zombie", "", $YMov, $XMov)
    EndSelect
WEnd

Func _GetBiggerGun()
    Exit
EndFunc   ;==>_GetBiggerGun


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Func _GetBiggerGun()
Nice... :whistle:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

oooh.... thanks!

have I ever mentioned that you and gafrost practically solve every one of my carelessness scripting problems?

EDIT: oops, you ARE gafrost =P

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0