Results 1 to 2 of 2

Thread: how can i randomize the spot of an object in a game

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    19

    how can i randomize the spot of an object in a game

    i have a little shooting game . after the user shoots the target and hits it he goes to the next level. now i have a button on the form that clicking it takes you to the next level . how can i change the location of the object ( a shape control ) randomly when i click the button .
    thankyou

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    VB Code:
    1. Shape1.Top = ((Form1.ScaleHeight - Shape1.Height) * Rnd)
    2. Shape1.Left = ((Form1.ScaleWidth - Shape1.Width) * Rnd)

    Try this

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