dcsimg
Results 1 to 6 of 6

Thread: Help making a dice game

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    7

    Help making a dice game

    Hello guys,

    I am new to VB and could really use some help.

    How would I write a simple program to play an old Chinese dice game?


    Here is how the game is played:


    There are 2 dice.

    The dealer rolls the 2 dice and covers up the dice from the player.

    The player then gueses weather the roll was even, or odd.

    If the player guessed right, they get a point.

    If they guessed wrong, the dealer gets a point.

    The dice are rolled 5 times.

    Whoever has the most points after 5 rounds wins, the player is congratulated if they won and the game resets for the next player..








    I really would appreciate any help or insight.


    Thanks alot
    Mitch

  2. #2
    Frenzied Member jdc20181's Avatar
    Join Date
    Oct 2015
    Location
    Indiana
    Posts
    1,134

    Re: Help making a dice game

    You need some sort of a graphics thing - DirectX I think it is - is commonly used.

    If you aren't worried about animations too much - You can always use a timer and make it "Roll" By drawing a new location.

    To get the numbers - you could use math.random - but I think I have been told several times not to use that.

    We aren't here to do the work for you but we will try and help the best we can.
    Disclaimer: When code is given for example - it is merely a example.
    See my browser project BeffsBrowser
    Try my new Browser project LightBrowse "A Browser and not much else" Screen Capture with Imgur API


    Unless said otherwise (e.g. From one of my projects thus, those are mostly licensed under MIT) - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.

  3. #3
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    471

    Re: Help making a dice game

    Instead of Math.random, you can declare a variable as a new Random data type. You should look this up or search out examples as to how to use it.
    Since the roll is covered, you likely don't need animation, unless you want to animate the reveal. You could just use pictures placed on your form to represent the roll, the image of each die is dictated by the random numbers selected.

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    7

    Re: Help making a dice game

    I think i want to use images of each side of a dice and use a number generator from 1-6 as an integer.

    Also Id like to use radio buttons to select even or odd and a txt box to display the count of whos winning.

  5. #5
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Cool Re: Help making a dice game

    Dice Game.zip

    It sounded simple enough so I made it for you.

    updated: fixed the wording for the odds it was saying lose when it was a win. I just rushed through making this so I didn't notice and had that text in the wrong line before.
    Last edited by Vexslasher; Nov 9th, 2016 at 03:16 PM.

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    7

    Re: Help making a dice game

    Thanks alot. Im looking at your code and Im learning alot from what you did.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width