Character Movement
-
Hello, I am programming in vb2005 I have some pictures of a character that if you change them you got a movement of him. I write a small function that move the character when clicking on right arrow. THe images are in PNG format so it is good for the transparency. Then problem is when I put the characted on a image backkground I get jump of the picture. How can I fix the problem? Thank you
Shay Noy
-
Hello, I am programming in vb2005 I have some pictures of a character that if you change them you got a movement of him. I write a small function that move the character when clicking on right arrow. THe images are in PNG format so it is good for the transparency. Then problem is when I put the characted on a image backkground I get jump of the picture. How can I fix the problem? Thank you
Shay Noy
What code have you got so far? Hard answer unless we know the bigger picture.
------------------------------------ In science, 'fact' can only mean 'confirmed to such a degree that it would be perverse to withhold provisional assent.' I suppose that apples might start to rise tomorrow, but the possibility does not merit equal time in physics classrooms. Stephen J Gould
-
What code have you got so far? Hard answer unless we know the bigger picture.
------------------------------------ In science, 'fact' can only mean 'confirmed to such a degree that it would be perverse to withhold provisional assent.' I suppose that apples might start to rise tomorrow, but the possibility does not merit equal time in physics classrooms. Stephen J Gould
I don't understand your reply. Have you understand my post? Thank you
Shay Noy
-
I don't understand your reply. Have you understand my post? Thank you
Shay Noy
[LOUD AND SLOW...] Post the code you have written already [/LOUD AND SLOW...]
------------------------------------ In science, 'fact' can only mean 'confirmed to such a degree that it would be perverse to withhold provisional assent.' I suppose that apples might start to rise tomorrow, but the possibility does not merit equal time in physics classrooms. Stephen J Gould
-
[LOUD AND SLOW...] Post the code you have written already [/LOUD AND SLOW...]
------------------------------------ In science, 'fact' can only mean 'confirmed to such a degree that it would be perverse to withhold provisional assent.' I suppose that apples might start to rise tomorrow, but the possibility does not merit equal time in physics classrooms. Stephen J Gould
Imports system.Reflection Public Class Form1 Private arrLeft(5) As Bitmap, arrRight(5) As Bitmap Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load arrLeft(0) = My.Resources.L1 : arrLeft(1) = My.Resources.L2 : arrLeft(2) = My.Resources.L3 arrLeft(3) = My.Resources.L4 : arrLeft(4) = My.Resources.L5 : arrLeft(5) = My.Resources.L6 arrRight(0) = My.Resources.R1 : arrRight(1) = My.Resources.R2 : arrRight(2) = My.Resources.R3 arrRight(3) = My.Resources.R4 : arrRight(4) = My.Resources.R5 : arrRight(5) = My.Resources.R6 End Sub Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Static ind As Integer, LastDir As String Static counter As Integer Select Case e.KeyCode Case Keys.Left If LastDir = Keys.Right Then ind = 0 : counter = 0 If counter Mod 5 = 0 Then PictureBox1.Image = arrLeft(ind Mod 6) Application.DoEvents() PictureBox1.Left -= 10 ind += 1 End If LastDir = Keys.Left Case Keys.Right If LastDir = Keys.Left Then ind = 0 : counter = 0 If counter Mod 5 = 0 Then PictureBox1.Image = arrRight(ind Mod 6) Application.DoEvents() PictureBox1.Left += 10 ind += 1 End If LastDir = Keys.Right End Select counter = counter Mod 21 + 1 End Sub End Class
Shay Noy