I randomly felt like generating some Java experience and threw together a quick game. Lots of fun learning how screwed up Java is. Anyway, I'd like to nail down some good constants to use in the program. So if you have a moment, I've attached some quick and dirty sliders that vary the key parameters of the game, play a few rounds and tell me what values seem easier/harder.
http://omega0.xepher.net/stuff/test.html
Comments much appreciated.
****NOTE New code uploaded 7 May. Look in that little text box and scroll around, if you don't see a lot of lines saying Vert and Horiz you're still running the old version. Do a search for 'clear java cache'
New version fixes a stupid typo bug in generating the levels and sort-of-maybe generates harder levels.
error in coding if you move the farthest right scroll bar all the way up. stuck on a 2x2 feild. I can't scroll or click any boxes.
interesting game however :)
Several bugs. As noted by Fes, the far right variable borks the whole thing. Also, when you click a "winning" (last/losing?) cross, it ends the game instantly, before actually drawing the cross. Because it doesn't draw the cross, you can cheat on the last one. It gave me a "win" when I started a cross that should've been blocked from the last red square by another cross. That is, there were two reds left, an unimpededed cross would've hit both, but the one I started should've been blocked from one of the reds, but it just did the "instant" win thing anyway. Well, I assume it's "win" it doesn't actually say if you win or lose, just ends the game as soon as you click. The debug area is a bit to small to read more than a few letters.
I keep getting "unable to place point"...I don't know if this is normal or not, but I didn't see any directions about having to click in a specific order?
scrollbar death noted. (easy one, I have a loop that never ends if the grid size < crosses)
Xepher: What browser/OS/etc. are you using? I'm not seeing any instant win or non-drawing of the final cross, and the textbox should show atleast a few full lines (though that one may be simple, if you're using Linux, I've seen java use giant fonts on linux). EDIT -- Is it only a few letters fit in the debug area or it just isn't scrolling? I just noticed with firefox/linux the text area isn't scrolling like it does under firefox/windows.
griever: that's normal. My gamestart() routine is just complaining that it didn't get to create all the points it wanted to. Not sure why you're getting it though, unless you had the gridsize small or a large # of pts/crosses at the time.
Weird, the debug box is actually scrolling now, (I've restarted my browser) and I can see that it's saying "defeat" after the third cross fails to hit all the boxes. What I thought was "instant" win, was that I was running out of crosses with one box left to go, but not realizing it was over. I went to click my final cross to "win" and it would reset to the next game. Since the debug couldn't scroll, I was only seeing about 1.5 lines and it was usually just the "placed 9 points" bit from the new game. I wasn't realizing I was out of crosses, as there wasn't a clear indicator of how many I had, when the debug box wasn't scrolling.
And yes, Firefox 2 on linux. :-)
I have Firefox 1.0.7 on Windows XP SP2
I didn't get to place any points, actually, or if it did, it never showed up (nothing on the grid changed). I have Firefox 2 on Mac OSX, if that's useful.
Quote from: grieverI didn't get to place any points, actually, or if it did, it never showed up.
The points message is completely irrelevant to you, it just means the code to generate the red points smacked itself in the head.
If however nothing is happening when you click on one of the white squares, then there's a problem.
Ahhh...I don't get any red points when the screen loads. I misread and thought they became apparent (like Minesweeper?). That would be problem #1 for me, I guess.
New version uploaded to clean up a few things (time to clear the java cache again). The newness is obvious with an eye-candy feature I tacked on to the end of a game.
Quote from: grieverAhhh...I don't get any red points when the screen loads. I misread and thought they became apparent (like Minesweeper?). That would be problem #1 for me, I guess.
...and it just HAD to be with the mac. Linux or Windows I could bang out tests myself.
OK...can you do the following:
* take a screen shot of the browser after the java loads.
* click on one of the little white squares
* copy out the contents of the textbox
I'll take a look & try to figure out where to go from there.
Ah Java, demonstrating that "Works Everywhere" is subtly different from "Works
the same Everywhere."
Aren't you glad I have a Mac? *runs from the villagers with pitchforks. :P
http://griever.xepher.net/images/omega1.png - at the beginning
http://griever.xepher.net/images/omega2.png - after clicking one square
All that text that loads for each screen is in the text area.
Hmm...Java appears to be using a flashy user interface rather than the bland buttons I asked for...
Can you see red spots if I do this: http://omega0.xepher.net/stuff/test3.html ?
Yay, it works now! I get red dots and I can make crosses.
griever, can you try this version? http://omega0.xepher.net/stuff/test4.html
It's like before - can't see the red dots and it doesn't make crosses. The info box says it's placing points, but nothing shows up.
Lovely, just *ing lovely. Well at least the hacky workaround does something.
Thanks for the help.
OK, how about this one? http://omega0.xepher.net/stuff/test3.html
I've added some code that claims to control the UI.
It works, mostly, although I think that it works just fine, but if you're picky on the details, then it doesn't. When it starts up, I see the red squares. Unlike the previous working version, it doesn't draw the crosses in front of you, but they just appear after you click the square you want. Then, when it says Lose, the red square that I couldn't get rid of remained on the screen, whereas in the previous versions, it didn't.
Well this has gotten weirder, the previous version I had working for you didn't animate for me. No matter, with a version working for both platforms I should be able to do something.
Again thanks for the help.