Sign in to follow this  
Followers 0
SIMPLE_XP

Help with wierd game navigation problem after adding transparent layer

2 posts in this topic

I am a really new AutoIT coder, and need some help!

I have a problem with a game I just started working on. I would really appreciate any thoughts on fixing this!

Here is my issue.

The navigation works by using

$KEY_MONITOR = DllOpen("user32.dll")
to monitor for the Up, Down, Left and right keys being pressed. This part works great.

Actually, everything works great unless I move the main gui window. If I move it, the in game window "Boundries" do not move with the window. In other words, the Character ends up being able to walk off of the display GUI on one side and does not go far enough on the other.

My navigation was working great until I added a transparent layer so the on screen Player image(Sprite) does not show a white background.

Here is the code that is called when an arrow key is pressed:

If _IsPressed("25", $KEY_MONITOR) Then
        Sleep(100)
        GUICtrlSetImage($PLAYER_1,$PLAYER[2][1][0]);    
        If $CURRENT_MAP_HORIZONTAL = 1 And $PLAYER_HORIZONTAL < 150 Then
           ControlMove("","", $TRANSPARENT_MAT, $PLAYER_HORIZONTAL,$PLAYER_VERTICLE)
         Else
            $PLAYER_HORIZONTAL = $PLAYER_HORIZONTAL-10
            ControlMove("","", $TRANSPARENT_MAT, $PLAYER_HORIZONTAL,$PLAYER_VERTICLE)
            GUICtrlSetData($LOCATION, $CURRENT_LARGE_MAP & "   " & $CURRENT_MAP_HORIZONTAL & "-" & $CURRENT_MAP_VERTICLE & "   " & $PLAYER_HORIZONTAL & " - " & $PLAYER_VERTICLE)
            If $PLAYER_HORIZONTAL < 150 Then CHANGE_LOCAL_MAP_LEFT()
        EndIf

Here is what I mean:

This one is ok (original location of GUI window)

Posted Image

This one is after moving the window

Posted Image


Hero's Dawn, an RPG Adventure completely coded in AutoITwmifunctions UDF, WMI UDF

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