cfreiling
Dec 4th, 2000, 03:04 PM
Ok. I have everything set corrcetly on how I want it. High Score Works But!
When you Close the Game and Start it back up again theres no set High
Scores. How can i set the Score to a .scr file or any other way. This is want I
did for Saving the High Scores during Game Play:
------Module Code------
Public Type Game
IntName As String
IntCash As Integer
IntWins As Integer
IntLost As Integer
IntGames As Integer
End Type
------END MOD----------
Below is the Setting On the Main Form
I have other settings but Im going to Place just what I
have for Setting the High Scores
-----frmCraps-----------
Dim Scores(1 To 100) As Game 'Arrays 1 to 100 Players
Dim Players As Integer
Dim MaxCash As Integer
Players = 0
'The High Score gets set when Player's Cash Hits 0
'And gets sent to GameLoss
Private Sub GameLoss()
'Removes Cash from Bank
Cash = Cash - Bet
lblCash = Cash 'Sets Cash for Bet
txtBet.Locked = False 'Unlocks Place Bet
'Adds a Loss to Game Stats
NumLose = NumLose + 1
lblNumLose.Caption = NumLose
Call GamesPlayed(NumWin, NumLose)
'Random Phrases for Game Over
Dim Phrase2 As Integer
If Cash = 0 Then
Phrase2 = Int((5 - 1 + 1) * Rnd + 1)
cmdStart.Enabled = False 'Forces Player to Start New Game
Select Case (Phrase2)
Case 1:
lblStatus.Caption = "Your Broke, Go Home!"
Case 2:
lblStatus.Caption = "Game Over, Play Again!"
Case 3:
lblStatus.Caption = "Busted, Play Again?"
Case 4:
lblStatus.Caption = "Kinda Like Vegas, HUH!"
Case 5:
lblStatus.Caption = "Need A loan?"
End Select
Call HighScore
End If
End Sub
Private Sub HighScore()
frmScores.Visible = True
Players = Players + 1
Scores(Players).IntName = InputBox("Enter Your Name")
frmScores.listName.AddItem (Scores(Players).IntName)
frmScores.listPlayerCash.AddItem (MaxCash)
Scores(Players).IntCash = MaxCash
frmScores.listWins.AddItem (frmCraps.lblNumWin.Caption)
Scores(Players).IntWins = frmCraps.lblNumWin.Caption
frmScores.listLost.AddItem (frmCraps.lblNumLose.Caption)
Scores(Players).IntLost = frmCraps.lblNumLose.Caption
frmScores.listGames.AddItem (frmCraps.lblNumGame.Caption)
Scores(Players).IntGames = frmCraps.lblNumGame.Caption
End Sub
------------End Code------------
The High Score form when closed gets
frmScore.visible = false
So that no info is lost. I would like it set to something so when the user is
done playing and closes. then comes back to play again Users Old High
Score is still there along with Other info Set.
???
Thanks
When you Close the Game and Start it back up again theres no set High
Scores. How can i set the Score to a .scr file or any other way. This is want I
did for Saving the High Scores during Game Play:
------Module Code------
Public Type Game
IntName As String
IntCash As Integer
IntWins As Integer
IntLost As Integer
IntGames As Integer
End Type
------END MOD----------
Below is the Setting On the Main Form
I have other settings but Im going to Place just what I
have for Setting the High Scores
-----frmCraps-----------
Dim Scores(1 To 100) As Game 'Arrays 1 to 100 Players
Dim Players As Integer
Dim MaxCash As Integer
Players = 0
'The High Score gets set when Player's Cash Hits 0
'And gets sent to GameLoss
Private Sub GameLoss()
'Removes Cash from Bank
Cash = Cash - Bet
lblCash = Cash 'Sets Cash for Bet
txtBet.Locked = False 'Unlocks Place Bet
'Adds a Loss to Game Stats
NumLose = NumLose + 1
lblNumLose.Caption = NumLose
Call GamesPlayed(NumWin, NumLose)
'Random Phrases for Game Over
Dim Phrase2 As Integer
If Cash = 0 Then
Phrase2 = Int((5 - 1 + 1) * Rnd + 1)
cmdStart.Enabled = False 'Forces Player to Start New Game
Select Case (Phrase2)
Case 1:
lblStatus.Caption = "Your Broke, Go Home!"
Case 2:
lblStatus.Caption = "Game Over, Play Again!"
Case 3:
lblStatus.Caption = "Busted, Play Again?"
Case 4:
lblStatus.Caption = "Kinda Like Vegas, HUH!"
Case 5:
lblStatus.Caption = "Need A loan?"
End Select
Call HighScore
End If
End Sub
Private Sub HighScore()
frmScores.Visible = True
Players = Players + 1
Scores(Players).IntName = InputBox("Enter Your Name")
frmScores.listName.AddItem (Scores(Players).IntName)
frmScores.listPlayerCash.AddItem (MaxCash)
Scores(Players).IntCash = MaxCash
frmScores.listWins.AddItem (frmCraps.lblNumWin.Caption)
Scores(Players).IntWins = frmCraps.lblNumWin.Caption
frmScores.listLost.AddItem (frmCraps.lblNumLose.Caption)
Scores(Players).IntLost = frmCraps.lblNumLose.Caption
frmScores.listGames.AddItem (frmCraps.lblNumGame.Caption)
Scores(Players).IntGames = frmCraps.lblNumGame.Caption
End Sub
------------End Code------------
The High Score form when closed gets
frmScore.visible = false
So that no info is lost. I would like it set to something so when the user is
done playing and closes. then comes back to play again Users Old High
Score is still there along with Other info Set.
???
Thanks