Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Dice Game

Author
Message
TitoTKO
13
Years of Service
User Offline
Joined: 2nd Oct 2011
Location:
Posted: 17th Oct 2011 01:52
Hello
I am attempting at making a Dice Simulator Game using classes and objects. In theory I require two dice to "roll" upon pressing the spacebar. I have most of the code done (in my opinion) but now the window keeps closing after I press Space. Any ideas?

In the following code I turned the second die into a comment just so I can try to resolve the issue with one die first.

Thanks in advance!



-HAVE A NICE DAY!
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 17th Oct 2011 06:32
You need to put a loop in your program and put the "myDie.dieToss();" in it for it to catch the keypress. This code should work:

Login to post a reply

Server time is: 2024-10-02 21:29:36
Your offset time is: 2024-10-02 21:29:36