View previous topic :: View next topic |
Author |
Message |
Wäxxup Grandmaster Cheater Supreme Reputation: 0
Joined: 17 Jan 2007 Posts: 1303 Location: The Netherlands
|
Posted: Fri May 29, 2009 12:13 pm Post subject: VB6.0 Games. |
|
|
Currently I'm "developping" a game for VB6.0, you'll probably all know the game Hangman.
But as usual, I'm to lazy to develop something like this and if anybody is well known with VB6.0 I would love to pointed in the right direction.
Any good idea's?
_________________
|
|
Back to top |
|
|
pkyourface Master Cheater Reputation: 0
Joined: 26 Dec 2006 Posts: 252
|
Posted: Fri May 29, 2009 1:49 pm Post subject: |
|
|
I made a space invaders game in vb6, a game like hangman wouldn't be too hard to build just check if each blank is the same as the letter you guessed and if it is then make that letter visible but if none of them are then add a body part to the man.
|
|
Back to top |
|
|
Wäxxup Grandmaster Cheater Supreme Reputation: 0
Joined: 17 Jan 2007 Posts: 1303 Location: The Netherlands
|
Posted: Fri May 29, 2009 2:18 pm Post subject: |
|
|
pkyourface wrote: | I made a space invaders game in vb6, a game like hangman wouldn't be too hard to build just check if each blank is the same as the letter you guessed and if it is then make that letter visible but if none of them are then add a body part to the man.
|
Looks nice, but making a game like Space Command would be too hard since I only learned the 'basics'.
So you mean by checking each letter you mean using the if ... else method?
Like:
Code: |
If cmd(Character) is "correct" Then lbl(Character).Visible = True
Else Line1.Visible = True |
_________________
|
|
Back to top |
|
|
pkyourface Master Cheater Reputation: 0
Joined: 26 Dec 2006 Posts: 252
|
Posted: Fri May 29, 2009 2:31 pm Post subject: |
|
|
Yea you could do that but then for each blank you would have to have a If Else statement. You could use a For Next loop and store all the characters you want to guess in an array or you could use a Do Loop and have the final phrase in a string and compare the guess to each character in the final phrase.
Here is an example:
Code: | Dim Finalsentence As String
Dim counter As Integer
Private Sub Command1_Click()
Dim guess As String
counter = 1
guess = InputBox("Enter a guess")
Do
If Mid(Finalsentence, counter, 1) = guess Then
Label1(counter).Caption = guess
End If
counter = counter + 1
Loop Until counter >= 5
End Sub
Private Sub Form_Load()
Finalsentence = "cheat"
counter = 1
End Sub |
You need 1 command button and 5 Labels in an array from 1 to 5.
|
|
Back to top |
|
|
Wäxxup Grandmaster Cheater Supreme Reputation: 0
Joined: 17 Jan 2007 Posts: 1303 Location: The Netherlands
|
Posted: Fri May 29, 2009 2:53 pm Post subject: |
|
|
pkyourface wrote: | Yea you could do that but then for each blank you would have to have a If Else statement. You could use a For Next loop and store all the characters you want to guess in an array or you could use a Do Loop and have the final phrase in a string and compare the guess to each character in the final phrase.
Here is an example:
Code: | Dim Finalsentence As String
Dim counter As Integer
Private Sub Command1_Click()
Dim guess As String
counter = 1
guess = InputBox("Enter a guess")
Do
If Mid(Finalsentence, counter, 1) = guess Then
Label1(counter).Caption = guess
End If
counter = counter + 1
Loop Until counter >= 5
End Sub
Private Sub Form_Load()
Finalsentence = "cheat"
counter = 1
End Sub |
You need 1 command button and 5 Labels in an array from 1 to 5. |
What's the use of the
Code: | Finalsentence = "cheat" |
?
_________________
|
|
Back to top |
|
|
pkyourface Master Cheater Reputation: 0
Joined: 26 Dec 2006 Posts: 252
|
Posted: Fri May 29, 2009 2:56 pm Post subject: |
|
|
That is the phrase that you want the person to guess.
|
|
Back to top |
|
|
NINTENDO Grandmaster Cheater Supreme Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Fri May 29, 2009 3:56 pm Post subject: |
|
|
If space shit is too hard for you then I suggest you do not reject everything.. Do hangman ffs..
_________________
Intel over amd yes. |
|
Back to top |
|
|
Wäxxup Grandmaster Cheater Supreme Reputation: 0
Joined: 17 Jan 2007 Posts: 1303 Location: The Netherlands
|
Posted: Sat May 30, 2009 2:40 am Post subject: |
|
|
Beloved Hero wrote: | If space shit is too hard for you then I suggest you do not reject everything.. Do hangman ffs.. |
I'm doing hangman right now, only problem is that my VB keeps bugging...
_________________
|
|
Back to top |
|
|
Slender Expert Cheater Reputation: 1
Joined: 25 Feb 2009 Posts: 232 Location: Unknown
|
Posted: Sat May 30, 2009 3:44 am Post subject: |
|
|
pkyourface wrote: | Yea you could do that but then for each blank you would have to have a If Else statement. You could use a For Next loop and store all the characters you want to guess in an array or you could use a Do Loop and have the final phrase in a string and compare the guess to each character in the final phrase.
Here is an example:
Code: | Dim Finalsentence As String
Dim counter As Integer
Private Sub Command1_Click()
Dim guess As String
counter = 1
guess = InputBox("Enter a guess")
Do
If Mid(Finalsentence, counter, 1) = guess Then
Label1(counter).Caption = guess
End If
counter = counter + 1
Loop Until counter >= 5
End Sub
Private Sub Form_Load()
Finalsentence = "cheat"
counter = 1
End Sub |
You need 1 command button and 5 Labels in an array from 1 to 5. |
Wow thanks alot!
|
|
Back to top |
|
|
NINTENDO Grandmaster Cheater Supreme Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sat May 30, 2009 5:05 am Post subject: |
|
|
Wäxxup wrote: | Beloved Hero wrote: | If space shit is too hard for you then I suggest you do not reject everything.. Do hangman ffs.. |
I'm doing hangman right now, only problem is that my VB keeps bugging... |
:/
_________________
Intel over amd yes. |
|
Back to top |
|
|
Wäxxup Grandmaster Cheater Supreme Reputation: 0
Joined: 17 Jan 2007 Posts: 1303 Location: The Netherlands
|
Posted: Sat May 30, 2009 9:43 am Post subject: |
|
|
Someone helped me alot on MSN. It works fine now and I'm going to leave this 'project' alone untill I'm back at school.
_________________
|
|
Back to top |
|
|
|