Character Choice

dutch318
09-23-2000, 10:43 PM
I am trying to allow users to select one of two characters for a game. The game play would be the same, just the character graphic would be different. I have tried to set up a form with the options as optionButtons. The user should then select which character and then this should be passed to a separate form which then calls the proper graphic file. These seems simple enough but has not proved to be. Any ideas or sample code would be greatly appreciated.

Brian VB 6

dutch318
09-24-2000, 11:34 AM
This is the start-up form
"Private Sub Command1_Click()

If Option1.Value = True Then
modDD.sGameType = 1
Else
modDD.sGameType = 2
End If

frmMain.Show

End Sub"

Then sGameType is in ModDD As:

"Public Sub sGameType(sGameType As Integer)
Dim GameType As Integer

GameType = sGameType

If GameType = "1" Then
Call DD_CreateSurfFromFile(App.Path & "male.bmp", MaleSurf, MaleSurfDesc, 200, 100)
Else
Call DD_CreateSurfFromFile(App.Path & "female.bmp", femaleSurf, femaleSurfDesc, 200, 100)
End If

End Sub"

I am getting a compile error:
Argument Not Optional

with sGameType in the Start-up form highlighted.

BillSoo
09-24-2000, 03:21 PM
Well...there are a number of problems...

1) the error is likely caused by the way you are calling your sub. It should be
modDD.sGameType 1
instead of
modDD.sGameType = 1

2) in the sub you should have
if GameType = 1 then
instead of
if GameType = "1" then



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

SeiferTim
09-25-2000, 10:23 AM
I had a similar feature in my Pokémonopoly game... you could choose 1 of four different colored pieces, wich were bitmaps... all I did was set a variable somewhere to a number 0 - 4 depending on their choice, and then whenever I would move the piece, just set the .image to my variable.

-Seifer Tim

Visit my Web-Site: http://Solenoid.50megs.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum