Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving an image

Status
Not open for further replies.

welshone

Programmer
Jul 30, 2001
414
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top