Dice Dreams
Dice Dreams is a dice game , the player must get 1.000.000 point to win, you start with 100.000 point.
If your total of number of dice is more than computer's total of number of dice
then your gain point  from yours and the computer's point that you've bet,and computer's point is subtracted, and vice-versa.

If your total of number of dice is same with computer's total of number of dice
then your point and computer's point stayed the same.

 

 



*source code

 

Public Class Form1
Dim objRandom As New System.Random(CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))

Dim dadu1 As Integer
Dim intDiceRoll As Integer
Dim intDiceRoll2 As Integer
Dim intDiceRoll3 As Integer
Dim intDiceRoll4 As Integer


Public Function GetRandomNumber(Optional ByVal Low As Integer = 1, Optional ByVal High As Integer = 100) As Integer
' Returns a random number,
' between the optional Low and High parameters
Return objRandom.Next(Low, High + 1)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim jumlahklik As Integer
jumlahklik = 0
Dim jumlah As Integer
jumlah = Val((Label16.Text))
jumlah = jumlah + 1
Label16.Text = jumlah
If jumlah = 3 Then
Label17.Text = "come on!!!! take more money"
ElseIf jumlah = 4 Then
Label17.Visible = False
ElseIf jumlah = 6 Then
Label17.Text = "come on !!!!"
Label17.Visible = True
ElseIf jumlah = 7 Then
Label17.Visible = False
ElseIf jumlah = 9 Then
Label17.Text = "Are you serius?? !!!!
Label17.Visible = True
ElseIf jumlah = 10 Then
Label17.Visible = False
ElseIf jumlah = 11 Then
Label17.Visible = False
ElseIf jumlah > 11 Then
dadu1 = Val((Label1.Text))
If dadu1 = 1 Then
Label17.Text = " come on !!!"
ElseIf dadu1 = 3 Then
Label17.Text = "come on guys!!"
End If
End If
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim waktu As Integer
waktu += 1
If waktu = 1 Then
intDiceRoll = GetRandomNumber(1, 6)
intDiceRoll2 = GetRandomNumber(1, 6)
intDiceRoll3 = GetRandomNumber(1, 6)
intDiceRoll4 = GetRandomNumber(1, 6)
Label1.Text = intDiceRoll.ToString
Label2.Text = intDiceRoll2.ToString
Label3.Text = intDiceRoll3.ToString
Label4.Text = intDiceRoll4.ToString
Dim hasiltaruhanpemain As Integer
Dim hasiltaruhancomputer As Integer
hasiltaruhanpemain = intDiceRoll + intDiceRoll2
hasiltaruhancomputer = intDiceRoll3 + intDiceRoll4
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim hasiltaruhanpemain As Integer
Dim hasiltaruhancomputer As Integer
Dim taruan As Integer
taruan = (Val(TextBox1.Text))
Dim uangpemain As Integer
uangpemain = (Val(lblkreditplayer.Text))
Dim uangcomp As Integer
uangcomp = (Val(lblkreditcomp.Text))
hasiltaruhanpemain = intDiceRoll + intDiceRoll2
hasiltaruhancomputer = intDiceRoll3 + intDiceRoll4
Timer1.Enabled = False
If hasiltaruhanpemain > hasiltaruhancomputer Then
uangpemain = uangpemain + taruan
lblkreditplayer.Text = uangpemain
uangcomp = uangcomp - taruan
lblkreditcomp.Text = uangcomp
MessageBox.Show("win")
Else If hasiltaruhanpemain = hasiltaruhancomputer Then
uangpemain = uangpemain + 0
lblkreditplayer.Text = uangpemain
uangcomp = uangcomp - 0
lblkreditcomp.Text = uangcomp
MessageBox.Show("draw")
Else
uangpemain = uangpemain - taruan
lblkreditplayer.Text = uangpemain
uangcomp = uangcomp + taruan
lblkreditcomp.Text = uangcomp
MessageBox.Show("lose")
End If
If uangpemain > 1000000 Or uangcomp < 0 Then
PictureBox13.Visible = True
Button1.Enabled = False
Button2.Enabled = False
ElseIf uangpemain < 0 Or uangcomp > 1000000 Then
PictureBox14.Visible = True
Button1.Enabled = False
Button2.Enabled = False
End If
Label14.Text = hasiltaruhancomputer
Label15.Text = hasiltaruhanpemain
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblkreditcomp.Text = "100000"
lblkreditplayer.Text = "100000"
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
End Sub
Private Sub PictureBox6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox6.Click
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Panel4.Visible = True
Panel3.Visible = True
Panel2.Visible = True
Label12.Visible = True
Label12.Text = " HELLO " & " " & TextBox2.Text
Panel1.Visible = False
End Sub
End Class 

 


 

  • How to play

1. put your money in money text box,amount of money should not be more than your point
2. push "play" button, then dices will roll
3. push "stop " button for stop the dice

 


 

About

This program is presented by Ma Chung Universities Information System student.

For more information about Ma Chung, visit:

  • www.machung.ac.id

if you wanted to contact us in this this address:

  • yeye_sweetcorn@yahoo.com
  • Stefano@yahoo.com

Logo SI

Logo Si

Last edited Nov 21, 2012 at 1:06 PM by yessya, version 12