Post Reply 
Visual Basic, omg
i learned vb 4 years ago and i'm learning everything again
Author Message
Pirata Nervo
NervOS Developer

Posts: 699.4765
Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
Offline
Post: #1
Visual Basic, omg
Ok I'm making a program that has 3 games, everything is ok, it's in portuguese, so i will translate from PT to EN

in this game, I've 3 images: jessica_mini, mensagem and mensagem2
in this game, I've 1 label: mensagens_lidas_label, it shows the number of messages taken by the player

mensagem means message

this isn't working:
        Dim showMS1 As Integer
        Dim showMS2 As Integer
        Dim mensagens_lidas As Integer
        mensagens_lidas = 0
        showMS1 = 1
        showMS2 = 1
        If showMS1 = 1 Then
            If jessica_mini.Bounds.IntersectsWith(mensagem.Bounds) Then
                MsgBox("la la la")
                mensagem.Hide()
                mensagens_lidas = mensagens_lidas + 1
                mensagens_lidas_label.Text = mensagens_lidas
                showMS1 = 0
            End If
        End If

        If showMS2 = 1 Then
            If jessica_mini.Bounds.IntersectsWith(mensagem2.Bounds) Then
                MsgBox("la la la")
                mensagem2.Hide()
                mensagens_lidas = mensagens_lidas + 1
                mensagens_lidas_label.Text = mensagens_lidas
                showMS2 = 0
            End If
        End If

what that should do is:
when the player(jessica_mini) touches the mensagem image, a message box appears » working
when the player(jessica_mini) touches the mensagem2 image, a message box appears » working
the images (mensagem and mensagem2 hide after being touched » working
the label mensagens_lidas_label shows the number of messages taken by the player » it shows 1 after i take the first message but it doesn't show 2 when i take the 2 messages i don't know why

the action jessica_mini.Bounds.IntersectsWith(mensagem2.Bounds) should just be executed when showMSG2 or showMS1 are iqual to 1, but after i say showMSG1/showMSG2 are iqual to 0, the action, still be executed.

17/11/2007 04:58 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Visual Basic, omg - Pirata Nervo - 17/11/2007 04:58 AM
RE: Visual Basic, omg - ZiNgA BuRgA - 17/11/2007, 05:58 AM
RE: Visual Basic, omg - Pirata Nervo - 17/11/2007, 11:59 AM
RE: Visual Basic, omg - Anger - 17/11/2007, 03:01 PM
RE: Visual Basic, omg - Pirata Nervo - 18/11/2007, 02:44 AM
RE: Visual Basic, omg - Anger - 18/11/2007, 06:26 AM
RE: Visual Basic, omg - Pirata Nervo - 18/11/2007, 07:18 AM
RE: Visual Basic, omg - Anger - 18/11/2007, 01:18 PM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)

 Quick Theme: