Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Direct X / Game Programming

Post new topic   Reply to topic
Help for programming a dice game Goto page Previous  1, 2
View previous topic :: View next topic  
Author Message
choco-late
Newbie


Joined: 18 Aug 2005
Posts: 12

PostPosted: Aug 23rd, 2005 04:54 AM    Post subject: Reply with quote

thank you again !
i think this is my last question, well after all the dice are gone and i click on the roll dice button the score keeps on adding?
Can i do something like the button not in use after all dice are gone?
if its that how can i do it? or is there some other way?
Back to top
View user's profile Send private message
choco-late
Newbie


Joined: 18 Aug 2005
Posts: 12

PostPosted: Aug 23rd, 2005 06:28 AM    Post subject: Reply with quote

dougthomas wrote:
Hi,

To keep the score adding up just define intTotal as Public in the Declarations section of the project and only set it to zero at the very beginning of each game.(not each throw)



Is this the code for it ?
Code:
Public intTotal As Integer

Right now i just need to know where should i put this code ??
I tried at the start of my coding but it doesnt work ....
Do i put it in a separat module ?? or something like esle ?
Back to top
View user's profile Send private message
DoobieKeebler
Moderator


Joined: 17 Jun 2005
Posts: 254
Location: 181°15'2.003"W, 93°5'16.956"N

PostPosted: Aug 23rd, 2005 08:27 AM    Post subject: Reply with quote

Your "Public intTotal As Integer" line is correct. Put that code right at the top of the form's code, outside of and before any subs or functions. (If you are using Option Explicit then it should go right after that.)

The Enabled property of a command button determines whether or not it can be clicked. If all 5 of the image boxes have their Visible property set to true then set the command button's Enabled property to False (e.g. Command1.Enabled = False).

Off topic: I usually take weekends off. I find I'm much less likely to end up as the top story on the evening news that way. =D Just so nobody thinks I don't care or haven't bothered to reply.

Slightly off topic: choco-late, watch your If statements when you're making more than one comparison. In English we use "if this is that or those" as shorthand for "if this is that or this is those". In VB (and all other programming languages that I have seen code for) you need to explicitly say "If (this = that) Or (this = those)". It may help to use parentheses. Hopefully it will look wrong somehow to say "If (x = 5) Or (6)" and it will become automatic to write it the "correct" way.
Back to top
View user's profile Send private message
choco-late
Newbie


Joined: 18 Aug 2005
Posts: 12

PostPosted: Aug 24th, 2005 05:10 AM    Post subject: Reply with quote

thank you for your advice ! ! and also thanx for your help ...
Back to top
View user's profile Send private message
book621
Newbie


Joined: 11 Nov 2005
Posts: 6

PostPosted: Nov 11th, 2005 08:10 PM    Post subject: You sure Reply with quote

Quote:
OK, i am a beginner with vb and need to do an assignment for a dice game. right now i have no idea of how to code this.


Are you sure about that because i dont think so.
_________________
[new user link] [new user link]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Direct X / Game Programming All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic