Results 1 to 11 of 11

Thread: movement

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216

    movement

    i would like my character in my game to start in one position but when i click over to another space it moves there and is still visible untill i click elsewhere. What is the code that i can make that happen? Thanks

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    It depends; one thing you must learn in programming is that there is no code that is universal. So, if you show us your code, we can show you our code.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    Hope this helps....


    Private Sub DrawFrame(framenumber As Integer, x As Integer, y As Integer)
    If framenumber = 1 Then
    Picture1.PSet (x, y), RGB(255, 0, 0)
    Picture1.PSet (x - 1, y), RGB(128, 128, 0)
    Picture1.PSet (x + 1, y), RGB(128, 128, 0)
    Picture1.PSet (x, y + 1), RGB(128, 128, 0)
    Picture1.PSet (x, y - 1), RGB(128, 128, 0)
    '
    ElseIf framenumber = 2 Then
    Picture1.Line (x - 1, y - 1)-(x + 1, y + 1), RGB(255, 0, 0), B
    Picture1.PSet (x, y), RGB(0, 0, 255)

    Picture1.Line (x - 2, y - 1)-(x - 2, y + 1), RGB(128, 128, 0)
    Picture1.Line (x + 2, y - 1)-(x + 2, y + 1), RGB(128, 128, 0)
    Picture1.Line (x - 1, y - 2)-(x + 1, y - 2), RGB(128, 128, 0)
    Picture1.Line (x - 1, y + 2)-(x + 1, y + 2), RGB(128, 128, 0)
    ElseIf framenumber = 3 Then
    Picture1.Line (x - 3, y - 3)-(x + 3, y + 3), RGB(255, 0, 0), BF
    For tempx = 1 To 100
    Randomize (Timer)

    X1 = Int(Rnd * 6) - 2
    Y1 = Int(Rnd * 6) - 2
    X2 = Int(Rnd * 6) - 2
    Y2 = Int(Rnd * 6) - 2
    Picture1.PSet (x + X1, y + Y1), RGB(224, 224, 0)
    Picture1.PSet (x + X2, y + Y2), RGB(0, 0, 0)
    Next tempx
    ElseIf framenumber = 4 Then
    Picture1.Line (x - 6, y - 6)-(x + 6, y + 6), RGB(255, 0, 0), BF
    For tempx = 1 To 200
    Randomize (Timer)

    X1 = Int(Rnd * 12) - 5
    Y1 = Int(Rnd * 12) - 5
    X2 = Int(Rnd * 12) - 5
    Y2 = Int(Rnd * 12) - 5
    Picture1.PSet (x + X1, y + Y1), RGB(224, 224, 0)
    Picture1.PSet (x + X2, y + Y2), RGB(0, 0, 0)
    Next tempx
    ElseIf framenumber = 5 Then
    Picture1.Line (x - 6, y - 6)-(x + 6, y + 6), RGB(0, 0, 0), BF
    End If
    End Sub

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I'd suggest having two variables - stayX and stayY. Then, on the mousedown event, have these variables be set. Whenever you want to draw your character, have him drawn with the two new variables. Hope it works
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    how do i have them drawn? it just sits there(character) it wont move when i click somewhere

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    ok thanks that helps alot!


    just one thing how do i get the ball to be something else (figure guy type thing) ?

  8. #8
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Try doing something like this for a start...
    Attached Files Attached Files

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    Thanks alot! that really helped but i put in the guy and the picture is to big... do you know how i can minimize it on paint?

  10. #10
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    You have to go to the file menu...but of course I have the Norwegian version, so I have no idea what it is in the English version....But if I had translated it, it would be....Picture....Stretch/displace.....and you have to change the values in the pop up menu, to what you want....I think you have to change the value for the horizontal first, and then do the same to the vertical....I'm not sure if you can change both of the at the same time.

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    Thank you so much! There is another thing but i will post it in another forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width