Results 1 to 8 of 8

Thread: Index

  1. #1

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668

    Index

    I have a game where I roll a dice, when it finishes it's either: imgdie(0), imgdie(1), imgdie(2), imgdie(3), imgdie(4) or imgdie(5)

    how can I say
    label1.caption = "[THE INDEX OF THE DIE IT ENDED ON]"
    ??

    thx in advance
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357
    Set the caption of the label at the same time that you choose the die. Post your code for a more detailed response...
    ~seaweed

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    r u using an 'ImageList' Component?

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Originally posted by seaweed
    Set the caption of the label at the same time that you choose the die. Post your code for a more detailed response...
    Good point!

  5. #5

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    Originally posted by seaweed
    Set the caption of the label at the same time that you choose the die. Post your code for a more detailed response...
    no, I don't need to post my code, you have a good Idea there

    thx
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  6. #6

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    finally ... that wouldnt work... here's my code:

    VB Code:
    1. Private Sub TmrDé_Timer()
    2.     Static I As Integer
    3.     If Toure = 1 Then
    4.         CmdDéJoueur.Picture = ImgDé(Int(Rnd * 4 + 1))
    5.     ElseIf Toure = 2 Then
    6.         CmdDéPC.Picture = ImgDé(Int(Rnd * 4 + 1))
    7.     End If
    8.     I = I + 1
    9.     If I >= 10 Then
    10.         I = 0
    11.         TmrDé.Enabled = False
    12.     End If
    13. End Sub
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  7. #7

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    NM, I figured it out
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  8. #8
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357
    I don't see where you added any code to set the Label caption. See if this helps:
    VB Code:
    1. Private Sub TmrDé_Timer()
    2.     Static I As Integer
    3.     Dim intRandomNumber As Integer
    4.    
    5.     ' Pick a random number
    6.     intRandomNumber = Int(Rnd * 4 + 1)
    7.  
    8.     ' Set the picture property
    9.     If Toure = 1 Then
    10.         CmdDéJoueur.Picture = ImgDé(intRandomNumber)
    11.     ElseIf Toure = 2 Then
    12.         CmdDéPC.Picture = ImgDé(intRandomNumber)
    13.     End If
    14.    
    15.     ' Set the label caption
    16.     Label1.Caption = intRandomNumber
    17.    
    18.     I = I + 1
    19.     If I >= 10 Then
    20.         I = 0
    21.         TmrDé.Enabled = False
    22.     End If
    23. End Sub
    ~seaweed

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