Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Character Movement

Character Movement

Scheduled Pinned Locked Moved Visual Basic
helpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    helelark123
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • H helelark123

      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

      D Offline
      D Offline
      Dalek Dave
      wrote on last edited by
      #2

      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

      H 1 Reply Last reply
      0
      • D Dalek Dave

        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

        H Offline
        H Offline
        helelark123
        wrote on last edited by
        #3

        I don't understand your reply. Have you understand my post? Thank you

        Shay Noy

        D 1 Reply Last reply
        0
        • H helelark123

          I don't understand your reply. Have you understand my post? Thank you

          Shay Noy

          D Offline
          D Offline
          Dalek Dave
          wrote on last edited by
          #4

          [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

          H 1 Reply Last reply
          0
          • D Dalek Dave

            [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

            H Offline
            H Offline
            helelark123
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups