Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 1042 times)
0 Members and 1 Guest are viewing this topic.
Offline mixandgo

Junior Newbie





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

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

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #1 - Posted 2006-02-04 16: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 01: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!

http://wiki.java.net/bin/view/Games/JeffFAQ
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 14: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 Member





« Reply #4 - Posted 2006-02-05 15:23:53 »

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
Offline Jeff

JGO Coder




Got any cats?


« Reply #5 - Posted 2006-02-05 21: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!

http://wiki.java.net/bin/view/Games/JeffFAQ
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.

CogWheelz (15 views)
2014-07-30 21:08:39

Riven (21 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!