-
Hi, i recently posted this in the games forum but im not sure if anyone is in there...
Currently I have a screen with a image i want to have controlled by the keyboard..the basic image.left = etc. but the image stays in the same position and only moves up down left or right...i needed to know if there was any way to where i can have it so...left and right rotate it accordingly and up and down control whether it moves forwards or backwards? Also, how do you make it so once its out of the screen, it loops around to the other side? thanx in advance.
-
Read this tip on rotating bitmaps. The problem is that you can't use it on a Image control because you can't draw on one.
I would say that the easiest way is to make the different pictures yourself and add them into a ImageList and then swap the picture in the image control.
To "loop" the image to the other side of the screen is pretty straitforward:
Code:
If Image1.Left > Me.ScaleWidth Then
Image1.Left = -Image1.Width
ElseIf Image1.Left < -Image1.Width Then
Image1.Left = Me.ScaleWidth
ElseIf Image1.Top < -Image1.Height Then
Image1.Top = Me.ScaleHeight
ElseIf Image1.Top > Me.ScaleHeight Then
Image1.Top = -Image1.Height
End If
Good luck!