Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (139)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  need advice on learning game coding  (Read 1126 times)
0 Members and 1 Guest are viewing this topic.
Offline mixandgo

Junior Newbie

« Posted 2006-02-04 10:44:46 »


  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 !
Offline Alan_W

JGO Knight

Medals: 8
Projects: 3

Java tames rock!

« Reply #1 - Posted 2006-02-04 15:27:52 »

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 Smiley

Time flies like a bird. Fruit flies like a banana.
Offline Jeff

JGO Coder

Got any cats?

« Reply #2 - Posted 2006-02-05 00:15:44 »

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.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mixandgo

Junior Newbie

« Reply #3 - Posted 2006-02-05 13:43:37 »

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).
Offline kylix999

Junior Devvie

« Reply #4 - Posted 2006-02-05 14:23:53 » - 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
Offline Jeff

JGO Coder

Got any cats?

« Reply #5 - Posted 2006-02-05 20:04:46 »

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).

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.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.


Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Archive (20 views)
2015-01-29 04:26:08

theagentd (21 views)
2015-01-28 15:33:52

GamerIDGoesHere (29 views)
2015-01-27 01:23:23

GamerIDGoesHere (30 views)
2015-01-27 01:22:15

CopyableCougar4 (37 views)
2015-01-27 00:34:41

CopyableCougar4 (23 views)
2015-01-26 04:47:56

Olo (17 views)
2015-01-25 21:26:00

Olo (23 views)
2015-01-25 18:44:22

Robo11 (39 views)
2015-01-25 06:14:26

basil_ (33 views)
2015-01-17 22:29:32
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!