Page 3 of 10 FirstFirst 123456 ... LastLast
Results 81 to 120 of 366

Thread: Flickering Buttons: How Do I Get Rid Of Them?

  1. #81

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    So, originally I had the "newbie-ish" labels to determine how many turns of card playing have occurred after each question before the next question gets asked.

    I am open to learning new things, no doubt about it. But what would I do if I were to record two turns of card playing after each question before moving on to the next question? I'm confused.

    If I were to set the maximum number of card playings after each question to 2, how would I set the mintKeepTrackOfSomething? Would I set it like this:

    mintKeepTrackOfSomething = 2

    If you are going to store numbers in them then one method to "clear" them would be to set their value to -1 or 9999 or something like that if setting them to 0 would be a problem.
    So, can the value go beyond 9999? And I can sort of see the light here now. Having a negative integer like -1 or a very high number like 9999 indicates a split second, is that correct?
    Last edited by JonSea31; Dec 19th, 2009 at 02:20 PM.

  2. #82
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Let's assume that
    1. you want to keep track of how many times something happens
    2. and when the number reaches 2 you want to perform some action
    3. and when that action is done, reset the count so that you can use it again if you want to.

    1)
    Code:
    Private mintKeepTrackOfSomething ' define the variable at the top of the form. BTW my way of naming variables is pretty standard; the "m" says it's a code module-level variable And the "int" says it's an Integer.
    When the particular event happens that you want to keep a count of
    Code:
    mintKeepTrackOfSomething = mintKeepTrackOfSomething + 1
    2)
    Check to see if it's at the high point that you are interested in and do something when it is.

    Code:
    If mintKeepTrackOfSomething = 2 Then
        DoSomething
    End If
    3) reset the count
    Code:
    mintKeepTrackOfSomething = 0
    Depending on circumstances, 2) and 3) can be combined.

  3. #83

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I did a test run of the cards with the code you provided, and with that new knowledge, I decided to replace the RedFirstPlay(0)/BlueFirstPlay(0) labels with the mintRedFirstPlay/mintBlueFirstPlay lines.

    The first question runs no problem, But I am having problems with going to the cards after the first question.

    When a player wins the question (say, the red player, for example), after the answer is revealed, instead of going to the cards, guess what happens? The game ends up in a standstill and goes neither forward nor backwards.

    Here is a sample of the code I will post:

    Top of the form:
    Code:
    Private mintQuesCount
    Private mintRedFirstPlay
    Private mintBlueFirstPlay
    Now, in the Timer1 area:
    Code:
        Case PlayIntro
            DSBuffer.GetCurrentPosition cur
            Select Case cur.lPlay
                Case Is > 430000
                    For i = 0 To 1
                        Label2(i).Visible = True
                        Label2(i).Caption = "Click button to reveal the question."
                    Next
                    token = ShowQuestion
                Case Is > 380496
                    CurQues.Caption = "R"
                    For i = 2 To 3
                        Label1(i).Caption = "So good luck to both players and here we go.  First question is for the red player, and this is an AUDIENCE POLL question."
                    Next
                    RBorder(1).Visible = True
                Case Is > 297779
                    For i = 2 To 3
                        Label1(i).Caption = "The first player to win two games will become the champion and go to the Money Cards..."
                    Next
                Case Is > 270207
                    For i = 2 To 3
                        Label1(i).Caption = "And let us begin the match."
                    Next
                Case Is > 159918
                    For i = 2 To 3
                        Label1(i).Caption = "Ready to play?  Here we go!"
                    Next
                Case Is > 115803
                    For i = 2 To 3
                        Label1(i).Caption = "And let us bring in our two card sharks!"
                    Next
                    For i = 0 To 1
                        Label1(i).Visible = False
                    Next
                    Set contBkgd(1).Picture = DimBkgd
                    For i = 0 To 4
                        RCard(i).Visible = False
                        BCard(i).Visible = False
                    Next
                Case Is > 110000
                    Set BCard(4).Picture = BlueCrd
                    BCard(4).Visible = True
                Case Is > 99000
                    Set BCard(3).Picture = BlueCrd
                    BCard(3).Visible = True
                Case Is > 88000
                    Set RCard(4).Picture = RedCrd
                    RCard(4).Visible = True
                Case Is > 77000
                    Set BCard(2).Picture = BlueCrd
                    BCard(2).Visible = True
                Case Is > 66000
                    Set RCard(3).Picture = RedCrd
                    RCard(3).Visible = True
                Case Is > 55000
                    Set BCard(1).Picture = BlueCrd
                    BCard(1).Visible = True
                Case Is > 44000
                    Set RCard(2).Picture = RedCrd
                    RCard(2).Visible = True
                Case Is > 33000
                    Set BCard(0).Picture = BlueCrd
                    BCard(0).Visible = True
                Case Is > 22000
                    Set RCard(1).Picture = RedCrd
                    RCard(1).Visible = True
                Case Is > 11000
                    Set RCard(0).Picture = RedCrd
                    RCard(0).Visible = True
                Case Is > 0
                    For i = 0 To 1
                        Label1(i).Caption = "The cards are being dealt out for Round One, and the red player will be playing the top row while the blue player will be playing the bottom row."
                    Next
                    For i = 2 To 3
                        Label1(i).Caption = ""
                    Next
            End Select
            Randomize (Timer)
            Shuffle 'call card shuffle
            mintQuesCount = mintQuesCount + 1 <== QuesCount is set at default 0 at the start of the Timer1.  When a new question is released, the number in the QuesCount increases by 1.
    Code:
        Case BlueHigherRight
            DSBuffer.GetCurrentPosition cur
            Select Case cur.lPlay
                Case Is > 100000
                    WinFirst.Caption = "B"
                    If mintQuesCount = 1 And mintBlueFirstPlay = 1 Then
                        token = SetCardsBkgdA <== This is where the cards should begin.  This is where the standstill prevails.
                    ElseIf mintQuesCount = 2 And mintBlueFirstPlay > 1 Then
                        token = RestartTurnB
                    ElseIf mintQuesCount = 2 And mintBlueFirstPlay = 1 Then
                        token = RevealFirstCardA
                    ElseIf mintQuesCount = 3 And mintBlueFirstPlay > 1 Then
                        token = RestartTurnB
                    ElseIf mintQuesCount = 3 And mintBlueFirstPlay = 1 Then
                        token = RevealFirstCardA
                    ElseIf mintQuesCount = 4 And mintBlueFirstPlay > 1 Then
                        token = RestartTurnB
                    ElseIf mintQuesCount = 4 And mintBlueFirstPlay = 1 Then
                        token = RevealFirstCardA
                    End If
                Case Is > 45000
                    BlueHigher(0).Visible = True
                    Image1(1).Visible = True
                Case Is > 40000
                    BlueHigher(0).Visible = False
                    Image1(1).Visible = False
                Case Is > 35000
                    BlueHigher(0).Visible = True
                    Image1(1).Visible = True
                Case Is > 30000
                    BlueHigher(0).Visible = False
                    Image1(1).Visible = False
                Case Is > 25000
                    BlueHigher(0).Visible = True
                    Image1(1).Visible = True
                Case Is > 20000
                    BlueHigher(0).Visible = False
                    Image1(1).Visible = False
                Case Is > 15000
                    BlueHigher(0).Visible = True
                    Image1(1).Visible = True
                Case Is > 10000
                    BlueHigher(0).Visible = False
                    Image1(1).Visible = False
                Case Is > 5000
                    BlueHigher(0).Visible = True
                    Image1(1).Visible = True
                Case Is > 0
                    RDNumber.Visible = False
                    BlueHigher(0).Visible = False
            End Select
            WhosTurn = BluePlayer
            BLNumber(0).Visible = False
            mintBlueFirstPlay = mintBlueFirstPlay + 1 <== This is where the blue player wins control of the cards.  The BlueFirstPlay starts from default 0 at the start of the timer.
            WinFirst.Caption = "B"
            contBkgd(1).AutoRedraw = False
    What would I have to do to fix this problem?
    Last edited by JonSea31; Dec 19th, 2009 at 08:44 PM.

  4. #84
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,910

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    You have to tell these Private variables to be something, say like a Long dimmed variable.

    Like this:
    Code:
    Dim Private mintQuesCount As Long
    Dim Private mintRedFirstPlay As Long
    Dim Private mintBlueFirstPlay As Long
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  5. #85

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    ^ Nope, they don't work. I copied/pasted the code you supplied, and that text came up in red text. I then realized that the Dim does not apply, but nevertheless, the standstill still exists and cannot go to the cards.

    Sent you a PM.
    Last edited by JonSea31; Dec 19th, 2009 at 09:12 PM.

  6. #86
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by JonSea31 View Post
    ^ Nope, they don't work. I copied/pasted the code you supplied, and that text came up in red text.
    You use Dim or Private, not both!

    But you should set the type As Long or whatever the variable is used for, if you don't set the type then VB auto sets it as a Variant and Variants are the slowest, so only use it if really needed.

  7. #87
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Back in post #56 I talked about the problem of having shuffle being called when the token was PlayIntro and I thought that you had corrected that but I still see it in your code.

    If you are willing to have the cards being shuffled over and over again (every 15 milliseconds!) while the intro is playing that's up to you, but when you now put mintQuesCount = mintQuesCount + 1 there you have a problem since within the 1st second of the intro playing mintQuesCount will be incremented to 66 (1000/15 = 66.6667) (and the deck is shuffled 66 times).

  8. #88

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    So where should I put the "mintQuesCount = mintQuesCount + 1"?

    And I did remove the Shuffle area just now from the Timer1 area.

  9. #89

  10. #90

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    ^ Which is why it's a Private Function, is that right?

  11. #91

  12. #92

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by MartinLiss View Post
    Which is why what is a Private Function?
    Sorry for misinterpreting. I couldn't think of what word I should use instead of Private Function when describing the "Private" part of the content in Post #84.

    And thanks for clarifying. I realize now that Private Function looks almost similar to Private Sub (at least how it would appear on the form). Guess I used the wrong terminology.

  13. #93
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Do you understand the differences between a Private Sub, Private Function and Private Property?

    If not then here is an overview:

    A Private Sub is as I'm sure you know, a routine that you call to do something and it's probably something that you want to do more than once and/or from more than one place.

    A Private Function is similar but it has the ability to return a value

    A Private Property is to all intents and purposes just a variable that you can associate validation or other code with. Here's an example of adding validation.

    Code:
    Option Exlicit
    Private mintWhatEver As Integer
    
    Private Property Get SomeProperty() As Integer
    
        SomeProperty = mintWhatEver
    
    End Property
    
    Private Property Let SomeProperty(ByVal intNewValue As Integer)
    
        '  Make sure that mintWhatEver can't exceed 100
        If mintWhatEver + intNewValue <= 100 Then
            mintWhatEver = mintWhatEver + intNewValue
        Else
            MsgBox "too large"
        End If
    
    End Property
    BTW you should never refer to mintWhatEver in the rest of the program's code, just SomeProperty which you treat just like a variable, eg

    SomeProperty = SomeProperty + 1

  14. #94

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I decided to go ahead with what I originally planned with the label markers and hiding them behind the picture box, as it is easier for me to remember, and I tend to rely on things that I can see more than they are "invisible" on the form, as I am strongly dependent on visuals due to my disability. It won't slow down the game that much, if I recall. And I've been doing Visual Basic since last March, but didn't do courses as this project is for a leisure activity, but *technically* I am considered a newbie.

    But the only thing that I require help in right now, is where the first or second player has to play the cards after the second, third, or fourth questions. I think the problem is in the currentCard line, as such line from the Form_Load area:

    Code:
    currentCard = 0
    Is it possible it may have to remove the currentCard = 0 from the Form_Load area and place it in the Timer1_Timer area, like this (as bolded in blue)?

    Code:
        Case RevealFirstCardA <==For the first player playing the cards after the question and is his/her first playing of Round 1, 2, or 3.
    '        If DSBuffer.GetStatus = DSBSTATUS_PLAYING Then Exit Sub
            PlaySound App.Path & "\sounds\youCanChange.wav", ByVal 0&, SND_ASYNC Or SND_FILENAME
            Ctrl.Caption = "1"
            For i = 0 To 1
                Label1(i).Caption = CurName & "Player, here is your first card.  You can change it if you'd like."
            Next
            currentCard = 0
            CurrentSlot = 0
            FreezeCard(WhosTurn) = 0
            oldCardValue = DealCard(CurImage, 0)
            For i = 0 To 1
                Label4(1).Caption = "It's the " & NameCard(CurImage.Tag) & "!"
                Label4(1).Visible = True
            Next
            btnChange1.Visible = True
            btnPlay1.Visible = True
            QHigher1.Visible = False
            QLower1.Visible = False
            btnFreeze1.Visible = False
            If WhosTurn = RedPlayer Then
                RDBorderLit.Visible = True
                BLBorderLit.Visible = False
                RedFirstPlay.Caption = "Y"
            ElseIf WhosTurn = BluePlayer Then
                BLBorderLit.Visible = True
                RDBorderLit.Visible = False
                BlueFirstPlay.Caption = "Y"
            End If
            token = Check4Keys
    
        Case RevealFirstCardA1 <==For the second player playing the cards after the question and is his/her first playing of Round 1, 2, or 3.
    '        If DSBuffer.GetStatus = DSBSTATUS_PLAYING Then Exit Sub
            For i = 0 To 1
                Label1(i).Caption = CurName & "Player, you have a free shot at the cards.  You cannot change the card since you didn't win the question."
            Next
            Ctrl.Caption = "2"
            currentCard = 0
            CurrentSlot = 0
            FreezeCard(WhosTurn) = 0
            oldCardValue = DealCard(CurImage, 0)
            For i = 0 To 1
                Label4(1).Caption = "It's a " & NameCard(CurImage.Tag) & "!"
                Label4(1).Visible = True
            Next
            btnChange1.Visible = False
            btnPlay1.Visible = False
            QHigher1.Visible = True
            QLower1.Visible = True
            btnFreeze1.Visible = False
            If WhosTurn = RedPlayer Then
                RDBorderLit.Visible = True
                BLBorderLit.Visible = False
                RedFirstPlay.Caption = "Y"
            ElseIf WhosTurn = BluePlayer Then
                BLBorderLit.Visible = True
                RDBorderLit.Visible = False
                BlueFirstPlay.Caption = "Y"
            End If
    Code:
        Case RestartTurnA <==For the first player playing the cards after the question and already played the cards beforehand.
            currentCard = 0 Or currentCard > 0
            CurrentSlot = FreezeCard(WhosTurn)
            Ctrl.Caption = "1"
            For i = 0 To 1
                Label1(i).Caption = CurName & "Player.  You can change it if you'd like."
            Next
            Label4(1).Caption = "It's the " & NameCard(CurImage.Tag) & "!"
            Label4(1).Visible = True
            If WhosTurn = RedPlayer Then
                RDBorderLit.Visible = True
                BLBorderLit.Visible = False
            ElseIf WhosTurn = BluePlayer Then
                RDBorderLit.Visible = False
                BLBorderLit.Visible = True
            End If
            btnChange1.Visible = True
            btnPlay1.Visible = True
            btnFreeze1.Visible = False
            QHigher1.Visible = False
            QLower1.Visible = False
            token = Check4Keys
    
        Case RestartTurnA1 <==For the second player playing the cards after the question and already played the cards beforehand.
            CurrentSlot = FreezeCard(WhosTurn)
            currentCard = 0 Or currentCard > 0
            Ctrl.Caption = "2"
            For i = 0 To 1
                Label1(i).Caption = CurName & "Player.  You can change it if you'd like."
            Next
            Label4(1).Caption = "It's the " & NameCard(CurImage.Tag) & "!"
            Label4(1).Visible = True
            If WhosTurn = RedPlayer Then
                RDBorderLit.Visible = True
                BLBorderLit.Visible = False
            ElseIf WhosTurn = BluePlayer Then
                RDBorderLit.Visible = False
                BLBorderLit.Visible = True
            End If
            btnChange1.Visible = False
            btnPlay1.Visible = False
            btnFreeze1.Visible = False
            QHigher1.Visible = True
            QLower1.Visible = True
            token = Check4Keys
    Last edited by JonSea31; Dec 23rd, 2009 at 11:31 AM.

  15. #95

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    The reason why I am asking this is because the first play of the cards after the first question:

    The red player guesses a number on the question
    The blue player guesses higher
    The blue player wins the question, and has first play of the cards
    The blue player starts with a 3.
    The blue player calls that next card lower (intentionally, due to testing).
    The next card is a Jack and a buzzer sounds.

    When the blue player plays the cards after the second question (which would be with the Case RestartTurnA1, in the event that the red player won the question and had first shot at the cards), the blue player's base card result, denoted by currentCard = 0, means a ding should sound when a player guesses higher than the 3.

    The blue player called it higher, and even though the card result was higher, a buzzer sound effect would play when a ding sound should have played, as the game must have worked from the last card value revealed (in this case, it worked from the Jack when it should have worked from the 3).

  16. #96
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    You don't have to hide anything, just don't make the labels Visible.

    As to moving that line of code, I suggest you just try it. I think you'll need to change the currentCard = 0 Or currentCard > 0 lines however because while I'm not sure what you were trying to do with them they most likely are not going to do what you want. I say that because VB is going to treat them as Boolean logic statements. For example if currentCard has a value of 3 then currentCard = 0 will be interpreted as False and currentCard > 0 will interpreted as True and in Boolean logic False or True is True, and since True has a value of -1, I believe that currentCard will be set to -1. If that is what you are trying to do that's clever but it's also somewhat confusing and in the spirit of trying to make programs easier to understand there are more understandable ways to do that.

  17. #97

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Well, maybe later this weekend (probably by Saturday, seeing that many of us will likely be busy during the next
    2 days) I could send you the updated files and maybe you could find out where the coding went wrong and how to fix it.

    I am feeling optimistic that the hardest coding will likely be completed before this time in January, seeing I have the questions under control no problem, but the turning of the cards in the way I require it to be done (as on the show) seems to be the most difficult task for me to do (and most likely the last big one, to be exact).

  18. #98

  19. #99
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,910

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Seeing that I am on holidays, I am not really able to do as much work on the projects, as I thought that I could. But going through it slowly, in stead of nothing.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  20. #100

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by MartinLiss View Post
    I'm going out of town for 6 days starting tomorrow and while I'll be checking in at VBForums occasionally I won't have VB available to me.
    Well, I guess it will be Wednesday before you return to the project, correct?

  21. #101

  22. #102

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    So you still may help me with fixing the control of the cards? It's possible that only a very small part of the code may need to be fixed.

    Is it possible that the problem may be with the Player Answer or Player Constants?

    Retrieved from the top section of the form:
    Code:
    'Player Constants
    Const BluePlayer = 0
    Const RedPlayer = 1
    'player Answer
    Const Higher = 1
    Const Lower = 0

  23. #103

  24. #104

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Maybe I am not certain what I am doing. I try to figure out where the problem lies, and it seems to get nowhere.

    But one user did volunteer to do an improved form on my behalf, and he is doing me a nice favour. It will take him weeks, but it will get done eventually. I did do a lot of work with the game, but it seems as if the playing of the cards after each question seems to be a really big puzzle for me to figure out.

    If I need further help, I will come back to post my concern. Thanks!

  25. #105

  26. #106

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Sorry, but I am not certain if the constants are to blame for the problem. Yes, I was referring to my question in Post #95. I am not certain about the constants or anything. That's because I do admit that while I did some of the work myself, I did have another user help me out as early as the spring. He gave me a head start on the questions form along with the cards form (separate forms), but I did a revamp of the two forms to allow consolidation of the two gameplay elements (questions and card playing). For the most part, I didn't originally do a lot of the work but rather have someone help me learn. I did learn a lot from the user known as technorobbo. However, he hasn't been as active with VB Forums in quite some time - if I am not mistaken, he last posted to this forum on September 5, and hasn't emailed me since early October. I've been trying to learn myself, but with this dilemma I am trying to figure out with the coding the cards and having it done a certain way, it is so overwhelming to me and it's hard for me to do.

    BTW, I did figure out how to use more than one question per game. But the cards are the big problem that I have yet to figure out.

    EDIT: technorobbo came back to posting earlier this month.
    Last edited by JonSea31; Dec 27th, 2009 at 07:48 PM.

  27. #107
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    If you're open to the idea I think the best thing you could do would be to start over. I know you've invested a lot of time on what you have and you've made a lot of progress but IMO it would be much better if you could build an app that wasn't dependant on multiple timers (or any timers) like yours is. If you could break up the sound into seperate files you could play them when specific buttons were pressed and not have to worry about timers at all. You also wouldn't have to worry about your tokens.

    In any case I'm always willing to help and if you still need help by Wednesday then send me a new link at that time.

  28. #108

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Well, seeing we're heading into 2010, I may as well start fresh with a new version of the game. It's the right thing to do in this case.

    BTW, is it possible the code can be simplified instead of having to use that massive amount of code? Like maybe cut all that code in half or close to it or something?

    Either way, I will send you a new link by mid-week.

  29. #109
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    You can absolutely cut down on the code and I'll help you do that, but the key to being successful with this is for you to understand all the code you use.

    Other suggesstions:
    • Break up the sound file
    • Use just one form for playing the game
    • No timers

  30. #110

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    So timers are considered redundant in this case, correct?

    And I will use just one form for the game. I planned on doing this in recent weeks.

    Breaking up the sound to smaller files would be a good alternative, like for the speech of Bob Eubanks, I could split the longer audio files to smaller clips, and maybe I can even consolidate two smaller audio clips to play at once.

    But is there a way to code it properly so that "tokens" are unnecessary?

    And I can put most of the main code into the "Form_Load" part of the form?

  31. #111
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    As I mentioned in one of my earlier posts, timers have their uses but the way you were using the sound files caused you to have a lot of code in the timers (as a matter of fact the whole game revolved around the timer code) and that's not a good idea. If you break up the sound file into task-oriented pieces you won't need the timers at all. What I mean by "task-oriented" is breaking it up so that you have separate sound files that are played only when specific buttons are clicked or when specific things happen in the game. Put another way, each sound file should have just one purpose.

    Your tokens were only a way to tell where you were in the audio and with small task-oriented, clips you won't need them at all.

    You should actually put as little code as you can in Form_Load. The reason for that is that the more code you have there the longer it takes for the form to be seen. Don't worry too much about that though since there are things we can do to fix that. The main thing is to build the app around the one sound file, one task principle.

  32. #112
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,910

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    In your program, I am having a lot of problems with your tokens. But is each one like a turn based phase of the game???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  33. #113

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    MartinLiss, I think, stated that tokens within the Timer1 area, may be confusing for us to understand. Martin suggested in a previous post not to use timers in this game, so that I might be able to get optimum performance.

    I think I know a way to work the code without having to use any timers. I'll take a stab at revamping the code and I will send my preliminary version to Martin and ThEiMp at some point midway.

    BTW, I am also doing some updates on some of the images to give the user the "feel" as if a contestant was in
    Studio 33 (now known as The Bob Barker Studio) at CBS Television City in Hollywood in 1986.

  34. #114
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Okay I have looked at the new files and I have a few comments. (In rereading this I see that in a couple of places I seem harsh and I really don't mean it that way)

    If you are going to start fresh I think you should start out in the right manner and one of the things I'd like to see you do is to give your controls that you refer to in code meaningful names. For example Image1 should be changed to something like imgHigher because when I look at the code I don't want to have to look at the form in order to know what "Image1" is.

    The code does not compile and it would be easier for me to work with if you were to make sure that it does before you send me new code.

    This is probably my most important question. I'm looking at subs like BlueHigherRight and in it you still seem to be trying to coordinate what happens on the board with where you are in the sound file that is currently playing. Why are you doing that?

    Why is Label6 (which should be renamed) a control array? Also in several places you loop i from 2 to 3 and try to do Label6(i).Caption = ... Do you see why that would never work?

    You have the following sub.

    Code:
    Private Sub LoadCards(sPath As String)
    Dim i As Integer, lstr As String
    For i = 0 To 51
        Select Case i
            Case 0 To 51
                lstr = App.Path & "\" & sPath & "\" & Choose(Int(i / 13) + 1, "s", "c", "h", "d") & _
                    Trim(Mid(" 2 3 4 5 6 7 8 910 j q k a", (i Mod 13) * 2 + 1, 2)) & ".bmp"
                Set cards(i) = New StdPicture
                Set cards(i) = LoadPicture(lstr)
        End Select
    Next
    End Sub
    Do you see why you only need this?
    Code:
    Private Sub LoadCards(sPath As String)
    Dim i As Integer, lstr As String
    For i = 0 To 51
        lstr = App.Path & "\" & sPath & "\" & Choose(Int(i / 13) + 1, "s", "c", "h", "d") & _
            Trim(Mid(" 2 3 4 5 6 7 8 910 j q k a", (i Mod 13) * 2 + 1, 2)) & ".bmp"
        Set cards(i) = New StdPicture
        Set cards(i) = LoadPicture(lstr)
    Next
    End Sub

  35. #115

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    If you are going to start fresh I think you should start out in the right manner and one of the things I'd like to see you do is to give your controls that you refer to in code meaningful names. For example Image1 should be changed to something like imgHigher because when I look at the code I don't want to have to look at the form in order to know what "Image1" is.
    I am in the process of changing anything that contains the "Image1", etc., and giving it a new name. Same for the labels.

    This is probably my most important question. I'm looking at subs like BlueHigherRight and in it you still seem to be trying to coordinate what happens on the board with where you are in the sound file that is currently playing. Why are you doing that?
    Are you referring to the synching of the images and other stuff to the audio?

    Again, I learned this from user technorobbo. While he is helpful, maybe there is a better way to sync the images, labels, etc. with the audio.

    And splitting the sound clip would mean the audio would sound choppy as the cards are being dealt. Is that what you're referring to?

    Why is Label6 (which should be renamed) a control array? Also in several places you loop i from 2 to 3 and try to do Label6(i).Caption = ... Do you see why that would never work?
    I fixed it just after I sent you the PM last night. And Label6 is renamed "lblDialog", seeing that this is where the dialog displays.

    As for what's in the StartR1 sub, how come the caption in the lblDialog box displays but not the animated dealing of the cards?

    The code does not compile and it would be easier for me to work with if you were to make sure that it does before you send me new code.
    How does it not compile? What are some suggestions?

  36. #116
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I am in the process of changing anything that contains the "Image1", etc., and giving it a new name. Same for the labels.
    That's good

    Are you referring to the synching of the images and other stuff to the audio?

    Again, I learned this from user technorobbo. While he is helpful, maybe there is a better way to sync the images, labels, etc. with the audio.

    And splitting the sound clip would mean the audio would sound choppy as the cards are being dealt. Is that what you're referring to?
    Yes I am referring to the synching of the images, etc. and I don't understand why you need to do that at all. Can you explain? When I say that the sound clip should be split, what I mean is that it should be split into sections that perform just one function and in that way you don't need to know where you are in a particular file. If the files are already that way then that's good.

    As for what's in the StartR1 sub, how come the caption in the lblDialog box displays but not the animated dealing of the cards?
    Because the value of cur.lPlay in that sub never exceeds about 3500 so all that happens is the Case Is > 0 code. I found that out with a simple Debug.Print cur.lPlay statement. I think this sub illustrates the crux of our/my misunderstanding. I don't see why you don't just display some text in the caption, Sleep for some period, display different text in the caption, Sleep again, etc. In that way you don't need to know where you are in the sound file.

    How does it not compile? What are some suggestions?
    File|Make CSEE.exe and when I click OK it tells me that Check4Keys isn't defined (and there may be others after that one is fixed).


    Here's another suggestion. Go to Project|General and change the project name from "Project1" to "CSEE" or something else that will distinguish it from any other Project1s that might be in the screens bottom bar.

  37. #117

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Quote Originally Posted by MartinLiss View Post
    Yes I am referring to the synching of the images, etc. and I don't understand why you need to do that at all. Can you explain? When I say that the sound clip should be split, what I mean is that it should be split into sections that perform just one function and in that way you don't need to know where you are in a particular file. If the files are already that way then that's good.

    Because the value of cur.lPlay in that sub never exceeds about 3500 so all that happens is the Case Is > 0 code. I found that out with a simple Debug.Print cur.lPlay statement. I think this sub illustrates the crux of our/my misunderstanding. I don't see why you don't just display some text in the caption, Sleep for some period, display different text in the caption, Sleep again, etc. In that way you don't need to know where you are in the sound file.
    Maybe the synching can be done by using text/images/whatever, then sleep, etc. instead of by way of cur.lPlay. However, I tried that in a timer when I attempted blinking of images to sound, and the audio sounded weird (like no sound at all but a little scratchy).

    And I am sorry for not understanding this "sound splitting" part - I thought splitting meant cutting out parts of the clip, but I have a pretty clear idea what you mean.

    File|Make CSEE.exe and when I click OK it tells me that Check4Keys isn't defined (and there may be others after that one is fixed).

    Here's another suggestion. Go to Project|General and change the project name from "Project1" to "CSEE" or something else that will distinguish it from any other Project1s that might be in the screens bottom bar.
    I did change the Project1 to CSEE just now. And it may be possible that Check4Keys may be unnecessary in this revamp. I'll see what can be done.

  38. #118
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    Here is a revamp of the StartR1 sub and a new Wait sub that it calls.
    Code:
    Public Sub StartR1()
        Dim i As Integer
        
        Set RCard(0).Picture = RedCrd
        RCard(0).Visible = True
        Set RCard(1).Picture = RedCrd
        RCard(1).Visible = True
        Set BCard(0).Picture = BlueCrd
        BCard(0).Visible = True
        Set RCard(2).Picture = RedCrd
        RCard(2).Visible = True
        Set BCard(1).Picture = BlueCrd
        BCard(1).Visible = True
        Set RCard(3).Picture = RedCrd
        RCard(3).Visible = True
        Set BCard(2).Picture = BlueCrd
        BCard(2).Visible = True
    
        Set RCard(4).Picture = RedCrd
        RCard(4).Visible = True
        Set BCard(3).Picture = BlueCrd
        BCard(3).Visible = True
        Set BCard(4).Picture = BlueCrd
        BCard(4).Visible = True
        Label6(1).Caption = "And let us bring in our two card sharks!"
        Sleep 2000
        Label6(1).Visible = False
        Set Picture1.Picture = DefBkgd
        For i = 0 To 4
            RCard(i).Visible = False
            BCard(i).Visible = False
        Next
        
        Label6(0).Caption = "The cards are being dealt out for Round One, and the red player will be playing the top row while the blue player will be playing the bottom row."
        Wait 4000
        Label6(0).Caption = "And let us begin the match."
        Wait 3000
        Label6(0).Caption = "The first player to win two games will become the champion and go to the Money Cards..."
        Wait 3000
        CurQues.Caption = "R"
        Label6(0).Caption = "So good luck to both players and here we go.  First question is for the red player, and this is an AUDIENCE POLL question."
        Wait 3000
        Label6(0).Caption = "Ready to play?  Here we go!"
        RBorder.Visible = True
    
        ShowAPQuestion
    End Sub
    
    Public Sub Wait(intHowLong As Integer)
    
        DoEvents
        Sleep intHowLong
    
    End Sub
    I had to comment out a number of things in the app because they were undefined. It's far from perfect but give it a try commenting out the undefined stuff until you can see the label display.

  39. #119

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    ^ I did give the code a try, and although it originally didn't work, I did fix it and the animation of loading up the cards does work perfectly now.

  40. #120

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: Flickering Buttons: How Do I Get Rid Of Them?

    I discovered another problem with regards to the transitioning from the end of the Question to the Card Playing (BlueHigher/LowerRight, etc., to RevealFirstCard)...

    Immediately after the RevealFirstCard sub is set off, the first card is revealed, and the background image along with any images and sounds that come from the BlueHigher/LowerRight Sub is played an additional time - one more than it should. The BlueHigher/LowerRight Sub, in other words, is activated twice instead of just once.

    I will send you the updated files momentarily and see what can be done to fix this problem.

Page 3 of 10 FirstFirst 123456 ... LastLast

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