need advice on learning game coding

hello,

I am just learning java and I like board games very much so I decided I should go and try building some “web browser board games” like poker, blackjack, roulette etc. Could anyone guide me on what should I use ? like which libraries, what java version, etc !

Thank you !

I would suggest coding for Java 1.4.2 rather than 1.5 as it has a larger installed user base. If you are building applets, then you can’t really use external libraries (without getting the user to install stuff manually), so you just have the standard libraries. However for a board game this is just fine.

I am assuming that the games will be stand-alone. i.e. not multiplayer. Multiplayer is tricky to do for a first project & also needs a machine to run a server for the game.

Roulette would be a fine choice to learn on. Here are some thoughts. You could draw the wheel using Paint Shop Pro, Photoshop or even windows Paint. The write some code to rotate it. This will be a bit tricky. Look at java.awt.Graphics2D class in the library perhaps. Some useful things are in there. When you press a key, the wheel can spin up and then gradually slow down and stop.

Once that’s working, you could add the spinning ball. Making this move realistically could be tricky, but for starters, how about making it spin up and then spin down at a slightly slower rate than the wheel. Thus the ball moves for a bit longer than the wheel.

When that’s looking good, you need to determine which slot the ball stopped in. Calculate the relative angle between the wheel final position & the ball final position. Scale and truncate the result to make an integer value representing the slot. Use this to index an array, which contains a list of the wheel slot numbers in the correct order. Print the number on the screen.

Then you can start implementing betting and scoring. You need a way to select a number (or red or black). Point and click with the mouse would be good. Maybe draw a representation of the board where the chips go. Maybe one click for each chip bet, although this would be tedious for large bets. Lot’s of possible usability enhancements are possible here. You need to check the bets against the winning slot & amend the players chips after each play.

Lastly check when the player runs out of money. Game Over :slight_smile:

Note that the Applet space is actually one of the harder oens to code in because of the inherent limitations of Applets.

if you don’t have a specific reason to want to do applets, Id suggest doing little java Applications instead. You can stil launch them from a web browser by using Java Web Start.

thanks Alan_W, really helpfull !

I need it done as an applet because it’s much more user friendly (they don’t have to install it).

http://www.developer.com/java/web/ - for general web java industry info, but for lerning applets programming i suggest you to by any book about java, becouse in net there are everything but you will have to collect all of the information on your own, so the good idea is to buy some the cheapiest book for start and when you get some knowledge you will now what to search in net . Applets are always the easiest for start

Web Star apps auto install (and udpate) over the web. Furthermore they are faster agfter the first install because they cache locally. (I believe most browser appelt cahces clear when you restart the browser.)

ABout the only reasons to use applets are

(a) If you absoilutely cannot make them doa JRE sinstall, in which case you better write to Java 1.1 and expect it to fail eventually on IE when MSFT finally getst he guts to remove all in-built applet support

(b)If you absolutely have to have it embedded in the HTML page and nto ina seperate pop-up window.

Otehr then that APplets are outdated and problematic and ghenerally shoudl be avoided.