Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Family Fortunes Game - Help!

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
shiv_mahima Posted - Jun 14 2006 : 05:35:53 AM
Hi VB Forum,

I am a University student and trying to develope a VB game. The game will be similar to Family Fortunes - TV Show (UK). Basically i want to ba able to add two teams names in the start of the game. i want to be able to edit the questions on regular basis. and also i want it to calculate the score.

can anyone help as im not experienced with VB!

thanks
2   L A T E S T    R E P L I E S    (Newest First)
PW7962 Posted - Jun 14 2006 : 3:53:34 PM
Well I'm from USA so I have never seen this show or even heard of it, but for the questions a good way would be to have them in a seperate txt/ini file and then the program could read it from there. That way you could edit the questions even after you compile the game. Now I'm not very good with just a regular txt file but I could do this very easily with an ini(configuration) file. I could look like this:
[Questions]  
Total=4  
1=What is an apple?  
2=What is an orange?  
3=What is a banana?  
4=What is a potato?  
  

Then you would need this funtion to read from the file:
Public Declare Function GetPrivateProfileString& Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal ReturnedString$, ByVal RSSize&, ByVal FileName$)  
  
Public Function ReadINI(INISection As String, INIKey As String, INIFile As String) As String
    Dim StringBuffer As String
    Dim StringBufferSize As Long
  
    StringBuffer = Space$(255)  
    StringBufferSize = Len(StringBuffer)  
  
    StringBufferSize = GetPrivateProfileString(INISection, INIKey, "", StringBuffer, StringBufferSize, INIFile)  
  
    If StringBufferSize > 0 Then
        ReadINI = Left$(StringBuffer, StringBufferSize)  
    Else
        ReadINI = ""  
    End If
End Function

Then you could have the program read the questions into a string array. The last argument of readini would be the path of the ini file and you could change it to whatever you name the file as. I hope this answers you question for the questions.
dim question(4) as String
dim i as long
for i = 1 to readini("Questions", "Total", app.path & "\Questions.ini")  
    question(i) = readini("Questions", str(i), app.path & "\Questions.ini")  
next i  

Dark_Lord Posted - Jun 14 2006 : 11:20:18 AM
Welcome to the forums.

I am not experienced as well though but if i am right you can do it easily by using inputboxes.

In form Load:

name1 = inputbox("Please enter the Name of the First Team.")
lblname1.caption = name1
and so for name2, you have to create labels for the name stuffs.

Though i am not sure much about what do you mean by editing the questions.

You can calculate the score as such

Private Sub cmdUpdate()
If opt1.check then ' If it is correct
lblscore.caption = CNum(lblscore.caption) + 3, 50 or whatever
elseif opt2.check then ' It is Wrong
lblscore.caption = CNum(lblscore.caption) - 5, 21 w/e
end if
End Sub

i've forgotten the CNUM sub codes

i will add them later .

VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.