hello,
I'm very new to VB and am trying to do something which is probably very simple.
I am messing around with creating a basic game with a man who can move left and right if on he ground, but when he gets to a ladder I want him to move up and down,( but also left and right if on the ground.
I have something like this at the mo :
If ImgRG.Left < ladder.Left + ladder.Width And ImgRG.Left + ImgRG.Width > ladder.Left And ImgRG.Top < ladder.Top + ladder.Height And ImgRG.Top + ImgRG.Height > ladder.Top And ladder.Top <= (ImgRG.Top + ImgRG.Height) And (ladder.Left + ladder.Width) > ImgRG.Left And ladder.Left + ladder.Width / 2 < (ImgRG.Left + ImgRG.Width / 2) Then
If (KeyHold And KEY_UP_FLAG) = KEY_UP_FLAG Then ImgRG.Top = ImgRG.Top + MovUD
If (KeyHold And KEY_DOWN_FLAG) = KEY_DOWN_FLAG Then ImgRG.Top = ImgRG.Top + MovUD
Else
If (KeyHold And KEY_LEFT_FLAG) = KEY_LEFT_FLAG Then ImgRG.Left = ImgRG.Left + MovBLR
If (KeyHold And KEY_RIGHT_FLAG) = KEY_RIGHT_FLAG Then ImgRG.Left = ImgRG.Left + MovBLR
End If
can anybody help me out, coz this isn't working correctly.
cheers
I'm very new to VB and am trying to do something which is probably very simple.
I am messing around with creating a basic game with a man who can move left and right if on he ground, but when he gets to a ladder I want him to move up and down,( but also left and right if on the ground.
I have something like this at the mo :
If ImgRG.Left < ladder.Left + ladder.Width And ImgRG.Left + ImgRG.Width > ladder.Left And ImgRG.Top < ladder.Top + ladder.Height And ImgRG.Top + ImgRG.Height > ladder.Top And ladder.Top <= (ImgRG.Top + ImgRG.Height) And (ladder.Left + ladder.Width) > ImgRG.Left And ladder.Left + ladder.Width / 2 < (ImgRG.Left + ImgRG.Width / 2) Then
If (KeyHold And KEY_UP_FLAG) = KEY_UP_FLAG Then ImgRG.Top = ImgRG.Top + MovUD
If (KeyHold And KEY_DOWN_FLAG) = KEY_DOWN_FLAG Then ImgRG.Top = ImgRG.Top + MovUD
Else
If (KeyHold And KEY_LEFT_FLAG) = KEY_LEFT_FLAG Then ImgRG.Left = ImgRG.Left + MovBLR
If (KeyHold And KEY_RIGHT_FLAG) = KEY_RIGHT_FLAG Then ImgRG.Left = ImgRG.Left + MovBLR
End If
can anybody help me out, coz this isn't working correctly.
cheers