...

Yahtzee Game

Terry
06-25-2003, 04:04 AM
I just got finished programming a yahtzee game. It's my first attempt at using OOP on such a a large script. I think it came out pretty good. The GUI interface was inspired by the hand-held electronic version of the game. I only have IE6,Netscape 7 and Opera 7 so if anyone wants to test it on various browsers let me know how it works.

PS: Opera 7 has a weird bug when you click on "instructions" then close the div. Can't figure it out.. works fine in IE and Netscape.

You can view it online here:
http://www.xdevdesign.com/yahtzee/index.html

The script file is here:
http://www.xdevdesign.com/yahtzee/js/yahtzee.js

- Terry

Spookster
06-25-2003, 04:31 AM
Pretty cool. Tried it in IE6 WinXP. :thumbsup:

Spookster
06-25-2003, 04:38 AM
Might make the randomness of the dice roll a little more random though. There are times I roll a large straight or a full house several times in a row or get yahtzees real easy.

Spookster
06-25-2003, 04:44 AM
By the way I don't think too many people can beat my incredibly high score.

321

All hail me. :D

Terry
06-25-2003, 04:57 AM
That's a pretty good score!

I'm not sure how to make it more random. The dice only use the default Math.random but they get a random number six times for the animation effect. The way the dice are displayed looks remarkably similar to the hand-held electronic game I have. The randomness seems to work pretty similar too. Its all the luck of the draw I guess.

Glad you like it. Cheers!

- Terry

Spookster
06-25-2003, 05:26 AM
Just noticed one little bug. When the game is finished and it takes you to the screen to enter your name for the high score....with IE you can store previous text box entries which show up in a drop down below the text box. On that screen the button is in the way of the drop down and causes the drop down to show up further down on the page.

Screenshot: http://www.designqueue.com/yahtzee.jpg

Spookster
06-25-2003, 05:34 AM
By the way I have beat my previously incredibly high score. I am yahtzee king. All hail me.

401

:D

p.s. Damn all those people who create these evil games that I become so addicted to. :mad:

Terry
06-25-2003, 06:49 AM
You the man!

Thanks for the heads up on the submit page. I found another bug in my php or database. That 401 score you made got posted like ten times... not sure how it happened. I had to erase them and left you with one. I changed databases... hopefully it fixed it. The other database I was using had 3 other tables that might of conflicted with the scores table.

- Terry

MotherNatrsSon
06-25-2003, 08:44 AM
Great job. I looked in IE 5.1.6 aand Netscape7.02 for MAC...

MNS

Spookster
06-25-2003, 02:17 PM
Originally posted by Terry
The other database I was using had 3 other tables that might of conflicted with the scores table.



I forgot to post about that bug. It's not your database that is the problem. Once a user submits their score they can hit the back button and submit it again. Might want to modify that process a bit so users can't just keep submitting their score over and over. :D

allida77
06-25-2003, 07:26 PM
That is a cool. The only complaint I have is the black background. I played for about 30 mins straight then went to another screen with a white window....I was blinded.

p.s. Damn all those people who create these evil games that I become so addicted to.

I agree...

Terry
06-25-2003, 07:31 PM
Thanks, Spookster. I figured that out after I posted the reply. Even when the score is posted you can refresh and it will continue recording. I might use a session to stop it... not sure. php is not my strong point. I'll post my code in the php forums later on and see if I can't get some help.

allida77: I'm going to make different color versions pretty soon! Spent a week and a half on the damn thing and I nearly blinded myself!

- Terry

landon11
06-25-2003, 08:14 PM
Great game 470

Spookster
06-25-2003, 08:15 PM
Originally posted by landon11
Great game 470

How dare you beat my high score. You are so on my list now. :mad:

scroots
06-25-2003, 11:13 PM
Originally posted by Spookster
How dare you beat my high score. You are so on my list now. :mad:

document.form.fieldname.value+="000"

or

document.form.fieldname.value="10000"

scroots

Spookster
06-25-2003, 11:25 PM
Originally posted by scroots
document.form.fieldname.value+="000"

or

document.form.fieldname.value="10000"

scroots

Cheaters never prosper. Your're on my list already. I'm gonna whack everyone. :p

A1ien51
06-26-2003, 03:14 AM
I am really in coding games with JavaScript, and I must say that is a very nice look for the game.

Eric

Spookster
06-26-2003, 03:44 AM
501!!!

Beat that Mr. landon11

Might suggest making the playing area big enough to fit the top 10 scores without having to scroll. Of course I never need to scroll down as I am always on top anyways. But for those that will never be as good as I and are at the bottom of the list I am sure it pains them terribly to have to scroll to see their measly little score.

allida77
06-26-2003, 05:58 PM
Ok I admit defeat. Spookster is now officially #1

Spookster
06-26-2003, 06:08 PM
Originally posted by allida77
Ok I admit defeat. Spookster is now officially #1

:D

Which brings up a good point. Never allow offsite form submissions. lol

beetle
06-26-2003, 06:49 PM
Nice game!

My best ever real life Yahtzee score is 631. I got the top bonus and 4 Yahtzees :D

landon11
06-26-2003, 06:57 PM
wow, yall have really messed up the top ten now.

Spookster
06-26-2003, 07:49 PM
Originally posted by landon11
wow, yall have really messed up the top ten now.

It wasn't my fault. allida77 started it. :)

But it is good for us to point out holes in security of the score submissions.

neo2297
12-14-2003, 11:30 PM
NO ONE CAN BEAT MY SCORE.........THAT'S INCREDIBLY LOW OF.......0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 etc...Bow down to the low score king!!!!lol



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum